From c0ada202babacf0f400e7c1177fbfedcbae0e387 Mon Sep 17 00:00:00 2001
From: Jan Breuer <jan.breuer@jaybee.cz>
Date: 周日, 04 10月 2015 19:34:08 +0800
Subject: [PATCH] Fix dimensions in ChannelList

---
 libscpi/test/test_scpi_utils.c |   30 ++++++++++++++++--------------
 1 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/libscpi/test/test_scpi_utils.c b/libscpi/test/test_scpi_utils.c
index dd3bfcc..d4472f3 100644
--- a/libscpi/test/test_scpi_utils.c
+++ b/libscpi/test/test_scpi_utils.c
@@ -152,19 +152,19 @@
         CU_ASSERT_EQUAL(val, v);                        \
         CU_ASSERT_EQUAL(result, r);                     \
     } while(0)                                          \
-    
-    TEST_STR_TO_LONG("", 0, 0, 10);
-    TEST_STR_TO_LONG("1", 1, 1, 10);
-    TEST_STR_TO_LONG("10", 2, 10, 10);
-    TEST_STR_TO_LONG("100MHz", 3, 100, 10);
-    TEST_STR_TO_LONG("MHz", 0, 0, 10);
-    TEST_STR_TO_LONG("1.4", 1, 1, 10);
-    TEST_STR_TO_LONG(" 1", 2, 1, 10);
-    TEST_STR_TO_LONG(" +100", 5, 100, 10); // space and +
-    TEST_STR_TO_LONG("FF", 2, 255, 16); // hexadecimal FF
-    TEST_STR_TO_LONG("77", 2, 63, 8); // octal 77
-    TEST_STR_TO_LONG("18", 1, 1, 8); // octal 1, 8 is ignored
-    TEST_STR_TO_LONG("FFFFFFFF", 8, 0xffffffffu, 16); // octal 1, 8 is ignored
+
+    TEST_STR_TO_ULONG("", 0, 0, 10);
+    TEST_STR_TO_ULONG("1", 1, 1, 10);
+    TEST_STR_TO_ULONG("10", 2, 10, 10);
+    TEST_STR_TO_ULONG("100MHz", 3, 100, 10);
+    TEST_STR_TO_ULONG("MHz", 0, 0, 10);
+    TEST_STR_TO_ULONG("1.4", 1, 1, 10);
+    TEST_STR_TO_ULONG(" 1", 2, 1, 10);
+    TEST_STR_TO_ULONG(" +100", 5, 100, 10); // space and +
+    TEST_STR_TO_ULONG("FF", 2, 255, 16); // hexadecimal FF
+    TEST_STR_TO_ULONG("77", 2, 63, 8); // octal 77
+    TEST_STR_TO_ULONG("18", 1, 1, 8); // octal 1, 8 is ignored
+    TEST_STR_TO_ULONG("FFFFFFFF", 8, 0xffffffffu, 16); // octal 1, 8 is ignored
 }
 
 static void test_strToDouble() {
@@ -464,6 +464,7 @@
 }
 
 int main() {
+    unsigned int result;
     CU_pSuite pSuite = NULL;
 
     /* Initialize the CUnit test registry */
@@ -498,6 +499,7 @@
     /* Run all tests using the CUnit Basic interface */
     CU_basic_set_mode(CU_BRM_VERBOSE);
     CU_basic_run_tests();
+    result = CU_get_number_of_tests_failed();
     CU_cleanup_registry();
-    return CU_get_error();
+    return result ? result : CU_get_error();
 }

--
Gitblit v1.9.1