test/main.c

changeset 134
4d320dc3a7af
parent 131
fc3af16818a3
child 140
15f871f50bfd
equal deleted inserted replaced
133:0a70e0d36949 134:4d320dc3a7af
39 #include "mpool_tests.h" 39 #include "mpool_tests.h"
40 #include "map_tests.h" 40 #include "map_tests.h"
41 #include "prop_tests.h" 41 #include "prop_tests.h"
42 #include "buffer_tests.h" 42 #include "buffer_tests.h"
43 43
44 UCX_EXTERN UCX_TEST_IMPLEMENT(testTestSuitePositive) { 44 UCX_EXTERN UCX_TEST(testTestSuitePositive) {
45 UCX_TEST_BEGIN 45 UCX_TEST_BEGIN
46 UCX_TEST_ASSERT(2*2 == 4, "the test framework fails"); 46 UCX_TEST_ASSERT(2*2 == 4, "the test framework fails");
47 UCX_TEST_END 47 UCX_TEST_END
48 } 48 }
49 49
50 UCX_EXTERN UCX_TEST_IMPLEMENT(testTestSuiteNegative) { 50 UCX_EXTERN UCX_TEST(testTestSuiteNegative) {
51 UCX_TEST_BEGIN 51 UCX_TEST_BEGIN
52 UCX_TEST_ASSERT(2*(-2) == 4, "the test framework works"); 52 UCX_TEST_ASSERT(2*(-2) == 4, "the test framework works");
53 UCX_TEST_END 53 UCX_TEST_END
54 } 54 }
55 55
71 *i += 2; 71 *i += 2;
72 // Next test shall fail! 72 // Next test shall fail!
73 UCX_TEST_ASSERT(*i==4, "the test framework works"); 73 UCX_TEST_ASSERT(*i==4, "the test framework works");
74 } 74 }
75 75
76 UCX_EXTERN UCX_TEST_IMPLEMENT(testTestSuiteRoutinePositive) { 76 UCX_EXTERN UCX_TEST(testTestSuiteRoutinePositive) {
77 int i = 2; 77 int i = 2;
78 UCX_TEST_BEGIN 78 UCX_TEST_BEGIN
79 UCX_TEST_CALL_SUBROUTINE(testTestSuiteRoutineSuccess, &i); 79 UCX_TEST_CALL_SUBROUTINE(testTestSuiteRoutineSuccess, &i);
80 UCX_TEST_ASSERT(i==4, "the test framework fails"); 80 UCX_TEST_ASSERT(i==4, "the test framework fails");
81 UCX_TEST_END 81 UCX_TEST_END
82 } 82 }
83 83
84 UCX_EXTERN UCX_TEST_IMPLEMENT(testTestSuiteRoutineNegative) { 84 UCX_EXTERN UCX_TEST(testTestSuiteRoutineNegative) {
85 int i = 0; 85 int i = 0;
86 UCX_TEST_BEGIN 86 UCX_TEST_BEGIN
87 UCX_TEST_CALL_SUBROUTINE(testTestSuiteRoutineFailure, &i); 87 UCX_TEST_CALL_SUBROUTINE(testTestSuiteRoutineFailure, &i);
88 UCX_TEST_ASSERT(1, "the test framework fails"); 88 UCX_TEST_ASSERT(1, "the test framework fails");
89 UCX_TEST_END 89 UCX_TEST_END
90 } 90 }
91 91
92 UCX_EXTERN UCX_TEST_IMPLEMENT(testTestSuiteRoutineMultiparam) { 92 UCX_EXTERN UCX_TEST(testTestSuiteRoutineMultiparam) {
93 UCX_TEST_BEGIN 93 UCX_TEST_BEGIN
94 UCX_TEST_CALL_SUBROUTINE(testTestSuiteRoutine2Param, 42, 3.14f); 94 UCX_TEST_CALL_SUBROUTINE(testTestSuiteRoutine2Param, 42, 3.14f);
95 UCX_TEST_END 95 UCX_TEST_END
96 } 96 }
97 97

mercurial