[gnumeric] tests: add test for non-ascii numbers to test suite.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] tests: add test for non-ascii numbers to test suite.
- Date: Tue, 27 Dec 2011 19:13:43 +0000 (UTC)
commit 77d36b6f1f5dcd61d548891e2db5487c8b14f535
Author: Morten Welinder <terra gnome org>
Date: Tue Dec 27 14:13:14 2011 -0500
tests: add test for non-ascii numbers to test suite.
src/sstest.c | 4 ++++
test/t2002-nonascii-numbers.pl | 20 ++++++++++++++++++++
2 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/src/sstest.c b/src/sstest.c
index c2e6dc8..c0a8e8c 100644
--- a/src/sstest.c
+++ b/src/sstest.c
@@ -341,10 +341,14 @@ test_nonascii_numbers (void)
sprintf (buffer, "%ld", LONG_MIN);
buffer[strlen (buffer) - 1]++;
res |= test_strtol_overflow (buffer, FALSE);
+ buffer[strlen (buffer) - 2]++;
+ res |= test_strtol_overflow (buffer, FALSE);
sprintf (buffer, "%ld", LONG_MAX);
buffer[strlen (buffer) - 1]++;
res |= test_strtol_overflow (buffer, TRUE);
+ buffer[strlen (buffer) - 2]++;
+ res |= test_strtol_overflow (buffer, TRUE);
}
g_printerr ("Result = %d\n", res);
diff --git a/test/t2002-nonascii-numbers.pl b/test/t2002-nonascii-numbers.pl
new file mode 100755
index 0000000..50e9585
--- /dev/null
+++ b/test/t2002-nonascii-numbers.pl
@@ -0,0 +1,20 @@
+#!/usr/bin/perl -w
+# -----------------------------------------------------------------------------
+
+use strict;
+use lib ($0 =~ m|^(.*/)| ? $1 : ".");
+use GnumericTest;
+
+my $expected;
+{ local $/; $expected = <DATA>; }
+
+&message ("Checking handling of non-ascii numbers.");
+&sstest ("test_nonascii_numbers", $expected);
+
+__DATA__
+-----------------------------------------------------------------------------
+Start: test_nonascii_numbers
+-----------------------------------------------------------------------------
+
+Result = 0
+End: test_nonascii_numbers
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]