test/main.c

changeset 253
e19825a1430a
parent 252
6342cbbd1922
child 254
c45c385ac578
--- a/test/main.c	Wed Oct 18 12:03:44 2017 +0200
+++ b/test/main.c	Wed Oct 18 14:23:57 2017 +0200
@@ -45,58 +45,60 @@
 #include "utils_tests.h"
 #include "avl_tests.h"
 
-UCX_EXTERN UCX_TEST(testTestSuitePositive) {
-    UCX_TEST_BEGIN
-    UCX_TEST_ASSERT(2*2 == 4, "the test framework fails");
-    UCX_TEST_END
-}
+extern "C" {
+    UCX_TEST(testTestSuitePositive) {
+        UCX_TEST_BEGIN
+        UCX_TEST_ASSERT(2*2 == 4, "the test framework fails");
+        UCX_TEST_END
+    }
 
-UCX_EXTERN UCX_TEST(testTestSuiteNegative) {
-    UCX_TEST_BEGIN
-    UCX_TEST_ASSERT(2*(-2) == 4, "the test framework works");
-    UCX_TEST_END
-}
+    UCX_TEST(testTestSuiteNegative) {
+        UCX_TEST_BEGIN
+        UCX_TEST_ASSERT(2*(-2) == 4, "the test framework works");
+        UCX_TEST_END
+    }
 
-UCX_EXTERN UCX_TEST_SUBROUTINE(testTestSuiteRoutineRoutine, float f) {
-    UCX_TEST_ASSERT(f == 3.14f, "calling routine in a routine fails");
-}
+    UCX_TEST_SUBROUTINE(testTestSuiteRoutineRoutine, float f) {
+        UCX_TEST_ASSERT(f == 3.14f, "calling routine in a routine fails");
+    }
 
-UCX_EXTERN UCX_TEST_SUBROUTINE(testTestSuiteRoutine2Param, int i, float f) {
-    UCX_TEST_ASSERT(i == 42, "two parameter routine fails");
-    UCX_TEST_CALL_SUBROUTINE(testTestSuiteRoutineRoutine, f);
-}
+    UCX_TEST_SUBROUTINE(testTestSuiteRoutine2Param, int i, float f) {
+        UCX_TEST_ASSERT(i == 42, "two parameter routine fails");
+        UCX_TEST_CALL_SUBROUTINE(testTestSuiteRoutineRoutine, f);
+    }
 
-UCX_EXTERN UCX_TEST_SUBROUTINE(testTestSuiteRoutineSuccess, int* i) {
-    *i += 2;
-    UCX_TEST_ASSERT(*i==4, "the test framework fails");
-}
+    UCX_TEST_SUBROUTINE(testTestSuiteRoutineSuccess, int* i) {
+        *i += 2;
+        UCX_TEST_ASSERT(*i==4, "the test framework fails");
+    }
 
-UCX_EXTERN UCX_TEST_SUBROUTINE(testTestSuiteRoutineFailure, int* i) {
-    *i += 2;
-    // Next test shall fail!
-    UCX_TEST_ASSERT(*i==4, "the test framework works");
-}
+    UCX_TEST_SUBROUTINE(testTestSuiteRoutineFailure, int* i) {
+        *i += 2;
+        // Next test shall fail!
+        UCX_TEST_ASSERT(*i==4, "the test framework works");
+    }
+
+    UCX_TEST(testTestSuiteRoutinePositive) {
+        int i = 2;
+        UCX_TEST_BEGIN
+        UCX_TEST_CALL_SUBROUTINE(testTestSuiteRoutineSuccess, &i);
+        UCX_TEST_ASSERT(i==4, "the test framework fails");
+        UCX_TEST_END
+    }
 
-UCX_EXTERN UCX_TEST(testTestSuiteRoutinePositive) {
-    int i = 2;
-    UCX_TEST_BEGIN
-    UCX_TEST_CALL_SUBROUTINE(testTestSuiteRoutineSuccess, &i);
-    UCX_TEST_ASSERT(i==4, "the test framework fails");
-    UCX_TEST_END
-}
+    UCX_TEST(testTestSuiteRoutineNegative) {
+        int i = 0;
+        UCX_TEST_BEGIN
+        UCX_TEST_CALL_SUBROUTINE(testTestSuiteRoutineFailure, &i);
+        UCX_TEST_ASSERT(1, "the test framework fails");
+        UCX_TEST_END
+    }
 
-UCX_EXTERN UCX_TEST(testTestSuiteRoutineNegative) {
-    int i = 0;
-    UCX_TEST_BEGIN
-    UCX_TEST_CALL_SUBROUTINE(testTestSuiteRoutineFailure, &i);
-    UCX_TEST_ASSERT(1, "the test framework fails");
-    UCX_TEST_END
-}
-
-UCX_EXTERN UCX_TEST(testTestSuiteRoutineMultiparam) {
-    UCX_TEST_BEGIN
-    UCX_TEST_CALL_SUBROUTINE(testTestSuiteRoutine2Param, 42, 3.14f);
-    UCX_TEST_END
+    UCX_TEST(testTestSuiteRoutineMultiparam) {
+        UCX_TEST_BEGIN
+        UCX_TEST_CALL_SUBROUTINE(testTestSuiteRoutine2Param, 42, 3.14f);
+        UCX_TEST_END
+    }   
 }
 
 int main(int argc, char **argv) {

mercurial