aboutsummaryrefslogtreecommitdiffhomepage
path: root/fish_tests.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2015-01-18 16:03:21 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2015-01-18 16:03:21 -0800
commit68efa5233c3fb338a52c38730a04d0da1c50ff30 (patch)
treee438b29438e8dd05a69190536f6d972ea374cd10 /fish_tests.cpp
parentdce487380c771da7a9507549baf6fde496d14d57 (diff)
Fix and add tests for format_long_safe with negative numbers
Diffstat (limited to 'fish_tests.cpp')
-rw-r--r--fish_tests.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/fish_tests.cpp b/fish_tests.cpp
index 28089bda..6cab5a66 100644
--- a/fish_tests.cpp
+++ b/fish_tests.cpp
@@ -296,6 +296,12 @@ static void test_format(void)
format_long_safe(buff1, j);
sprintf(buff2, "%d", j);
do_test(! strcmp(buff1, buff2));
+
+ wchar_t wbuf1[128], wbuf2[128];
+ format_long_safe(wbuf1, j);
+ swprintf(wbuf2, 128, L"%d", j);
+ do_test(! wcscmp(wbuf1, wbuf2));
+
}
long q = LONG_MIN;
@@ -303,7 +309,6 @@ static void test_format(void)
format_long_safe(buff1, q);
sprintf(buff2, "%ld", q);
do_test(! strcmp(buff1, buff2));
-
}
/**