|
@@ -1,36 +1,35 @@
|
|
|
#ifndef CORE_TEST_HPP
|
|
|
#define CORE_TEST_HPP
|
|
|
|
|
|
-void Test_finalize(void);
|
|
|
+void coreFinalizeTests(void);
|
|
|
|
|
|
#define CORE_TEST_ARGS const char *file, int line
|
|
|
-#define CORE_TEST_NAMED_FUNCTION(name, type) \
|
|
|
- bool Test_compare_##name(CORE_TEST_ARGS, type wanted, type actual)
|
|
|
-#define CORE_TEST_FUNCTION(type) CORE_TEST_NAMED_FUNCTION(type, type)
|
|
|
+#define CORE_TEST_FUNCTION(name, type) \
|
|
|
+ bool coreTest##name(CORE_TEST_ARGS, type wanted, type actual)
|
|
|
|
|
|
-CORE_TEST_FUNCTION(int);
|
|
|
-CORE_TEST_NAMED_FUNCTION(bool, bool);
|
|
|
-CORE_TEST_NAMED_FUNCTION(string, const char*);
|
|
|
+CORE_TEST_FUNCTION(Int, int);
|
|
|
+CORE_TEST_FUNCTION(Bool, bool);
|
|
|
+CORE_TEST_FUNCTION(String, const char*);
|
|
|
|
|
|
-bool Test_compare_float(CORE_TEST_ARGS, float wanted, float actual,
|
|
|
- float error);
|
|
|
+bool coreTestFloat(CORE_TEST_ARGS, float wanted, float actual, float error);
|
|
|
|
|
|
-bool Test_isNull(CORE_TEST_ARGS, const void* p);
|
|
|
-bool Test_isNotNull(CORE_TEST_ARGS, const void* p);
|
|
|
+bool coreTestNull(CORE_TEST_ARGS, const void* p);
|
|
|
+bool coreTestNotNull(CORE_TEST_ARGS, const void* p);
|
|
|
|
|
|
-#define CORE_TEST(wanted, actual, type) \
|
|
|
- Test_compare_##type(__FILE__, __LINE__, wanted, actual)
|
|
|
+#define CORE_TEST(wanted, actual, name, type) \
|
|
|
+ coreTest##name(__FILE__, __LINE__, wanted, actual)
|
|
|
|
|
|
#define CORE_TEST_FLOAT(wanted, actual, error) \
|
|
|
- Test_compare_float(__FILE__, __LINE__, wanted, actual, error)
|
|
|
+ coreTestFloat(__FILE__, __LINE__, wanted, actual, error)
|
|
|
|
|
|
-#define CORE_TEST_BOOL(wanted, actual) CORE_TEST(wanted, actual, bool)
|
|
|
-#define CORE_TEST_INT(wanted, actual) CORE_TEST(wanted, actual, int)
|
|
|
-#define CORE_TEST_STRING(wanted, actual) CORE_TEST(wanted, actual, string)
|
|
|
+#define CORE_TEST_BOOL(wanted, actual) CORE_TEST(wanted, actual, Bool, bool)
|
|
|
+#define CORE_TEST_INT(wanted, actual) CORE_TEST(wanted, actual, Int, int)
|
|
|
+#define CORE_TEST_STRING(wanted, actual) \
|
|
|
+ CORE_TEST(wanted, actual, String, string)
|
|
|
|
|
|
-#define CORE_TEST_FALSE(actual) CORE_TEST(false, actual, bool)
|
|
|
-#define CORE_TEST_TRUE(actual) CORE_TEST(true, actual, bool)
|
|
|
-#define CORE_TEST_NULL(actual) Test_isNull(__FILE__, __LINE__, actual)
|
|
|
-#define CORE_TEST_NOT_NULL(actual) Test_isNotNull(__FILE__, __LINE__, actual)
|
|
|
+#define CORE_TEST_FALSE(actual) CORE_TEST(false, actual, Bool, bool)
|
|
|
+#define CORE_TEST_TRUE(actual) CORE_TEST(true, actual, Bool, bool)
|
|
|
+#define CORE_TEST_NULL(actual) coreTestNull(__FILE__, __LINE__, actual)
|
|
|
+#define CORE_TEST_NOT_NULL(actual) coreTestNotNull(__FILE__, __LINE__, actual)
|
|
|
|
|
|
#endif
|