From c462509adfd68e8b849b8a6713360fb4f9026578 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Thu, 10 Apr 2025 02:00:58 +0300 Subject: fixed formatting of the smallest possible integer * In other words, fixed `-9223372036854775808\` on --with-teco-integer=64 (which is the default). * The reason is that ABS(G_MININT64) == G_MININT64 since -G_MININT64 == G_MININT64. It is therefore important not to call ABS() on arbitrary teco_int_t's. --- tests/atlocal.in | 7 +++++++ tests/testsuite.at | 9 +++++++++ 2 files changed, 16 insertions(+) (limited to 'tests') diff --git a/tests/atlocal.in b/tests/atlocal.in index 8465f96..1992c54 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -26,6 +26,13 @@ ESCAPE=`printf '\33'` # is used. SCITECOPATH="@abs_top_srcdir@/lib" +TECO_INTEGER=@TECO_INTEGER@ + +MAXINT32=2147483647 +MININT32=-2147483648 +MAXINT64=9223372036854775807 +MININT64=-9223372036854775808 + GREP="@GREP@" # Glib debug options diff --git a/tests/testsuite.at b/tests/testsuite.at index 20a76c5..d8d88e1 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -117,6 +117,15 @@ AT_CHECK([$SCITECO -e "[[\$ @FG'..' ]]\$ :Q\$-1Q\$-^^r\"=(0/0)'"], 0, ignore, ig AT_CHECK([$SCITECO -e "[[: @I/XXX/ ]]: .\"N(0/0)'"], 0, ignore, ignore) AT_CLEANUP +AT_SETUP([Formatting numbers]) +# MAXINT32/MININT32: should always work. +AT_CHECK([$SCITECO -e "$MAXINT32\\ J::@S/$MAXINT32/\"F(0/0)'"], 0, ignore, ignore) +AT_CHECK([$SCITECO -e "$MININT32\\ J::@S/$MININT32/\"F(0/0)'"], 0, ignore, ignore) +AT_SKIP_IF([test $TECO_INTEGER -lt 64]) +AT_CHECK([$SCITECO -e "$MAXINT64\\ J::@S/$MAXINT64/\"F(0/0)'"], 0, ignore, ignore) +AT_CHECK([$SCITECO -e "$MININT64\\ J::@S/$MININT64/\"F(0/0)'"], 0, ignore, ignore) +AT_CLEANUP + AT_SETUP([Convert between line and glyph positions]) AT_CHECK([$SCITECO -e "@I/1^J2^J3/J 2^QC :^Q-3\"N(0/0)'"], 0, ignore, ignore) AT_CLEANUP -- cgit v1.2.3