2020-04-08 12:49:00 +02:00
|
|
|
#include <Platform.h> // Only use angled for Platform, else, xcode project won't compile
|
2020-02-23 12:21:28 +01:00
|
|
|
#include "../cpp_foundation/XArray.h"
|
|
|
|
#include "../cpp_foundation/XObjArray.h"
|
|
|
|
|
2020-03-28 16:14:18 +01:00
|
|
|
#include "../Platform/BasicIO.h" // for PauseForKey
|
2020-03-26 13:59:20 +01:00
|
|
|
|
2020-02-23 12:21:28 +01:00
|
|
|
#include "XArray_tests.h"
|
|
|
|
#include "XObjArray_tests.h"
|
2020-04-26 12:12:05 +02:00
|
|
|
#include "XStringArray_test.h"
|
2020-03-12 15:40:38 +01:00
|
|
|
#include "XString_test.h"
|
2020-03-13 14:11:58 +01:00
|
|
|
#include "strcmp_test.h"
|
|
|
|
#include "strncmp_test.h"
|
|
|
|
#include "strlen_test.h"
|
2021-03-15 10:02:34 +01:00
|
|
|
#include "strcasecmp_test.h"
|
2020-03-21 14:12:26 +01:00
|
|
|
#include "printf_lite-test.h"
|
2020-04-05 14:25:39 +02:00
|
|
|
#include "LoadOptions_test.h"
|
2020-04-30 23:43:44 +02:00
|
|
|
#include "XToolsCommon_test.h"
|
2020-08-13 14:07:40 +02:00
|
|
|
#include "XBuffer_tests.h"
|
2020-08-25 17:35:19 +02:00
|
|
|
#include "plist_tests.h"
|
2020-10-12 13:51:08 +02:00
|
|
|
#include "find_replace_mask_Clover_tests.h"
|
|
|
|
#include "find_replace_mask_OC_tests.h"
|
2020-11-12 22:25:56 +01:00
|
|
|
#include "MacOsVersion_test.h"
|
2021-02-07 15:39:03 +01:00
|
|
|
#include "xml_lite-test.h"
|
|
|
|
#include "config-test.h"
|
2021-04-28 20:30:34 +02:00
|
|
|
#include "XToolsCommon_test.h"
|
|
|
|
#include "../Platform/guid.h"
|
2020-04-10 13:01:16 +02:00
|
|
|
|
|
|
|
#if defined(JIEF_DEBUG) && defined(CLOVER_BUILD)
|
|
|
|
#include "printlib-test.h"
|
|
|
|
#endif
|
2020-02-23 12:21:28 +01:00
|
|
|
|
2020-04-08 12:49:00 +02:00
|
|
|
|
|
|
|
/* On macOS
|
|
|
|
* sizeof(long)=8
|
|
|
|
* sizeof(long long)=8
|
|
|
|
* sizeof(size_t)=8
|
|
|
|
*/
|
|
|
|
|
2020-02-23 12:21:28 +01:00
|
|
|
bool all_tests()
|
|
|
|
{
|
|
|
|
bool all_ok = true;
|
2021-02-07 16:10:01 +01:00
|
|
|
|
2020-02-23 12:21:28 +01:00
|
|
|
|
2020-04-30 23:43:44 +02:00
|
|
|
#if defined(JIEF_DEBUG)
|
2021-04-28 20:30:34 +02:00
|
|
|
|
|
|
|
|
2021-02-07 16:10:01 +01:00
|
|
|
int ret;
|
2021-04-28 20:30:34 +02:00
|
|
|
ret = XString_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
printf("XString_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
|
|
|
ret = XStringArray_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
printf("XStringArray_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
|
|
|
ret = XToolsCommon_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
printf("XToolsCommon_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
|
|
|
ret = xml_lite_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
printf("xml_lite_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
2021-03-15 10:02:34 +01:00
|
|
|
ret = strcasecmp_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
printf("strncmp_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
2021-02-07 15:39:03 +01:00
|
|
|
// ret = config_plist_tests();
|
2020-08-25 17:35:19 +02:00
|
|
|
// if ( ret != 0 ) {
|
2021-02-07 15:39:03 +01:00
|
|
|
// printf("config_plist_tests() failed at test %d\n", ret);
|
|
|
|
// all_ok = false;
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// ret = XUINTN_tests();
|
|
|
|
// if ( ret != 0 ) {
|
|
|
|
// printf("XUINTN_tests() failed at test %d\n", ret);
|
2020-08-25 17:35:19 +02:00
|
|
|
// all_ok = false;
|
|
|
|
// }
|
2020-05-03 17:07:34 +02:00
|
|
|
#endif
|
2021-02-07 15:39:03 +01:00
|
|
|
|
2021-04-28 20:30:34 +02:00
|
|
|
#if defined(JIEF_DEBUG)
|
2021-02-07 15:39:03 +01:00
|
|
|
|
2020-04-23 22:43:35 +02:00
|
|
|
#if defined(JIEF_DEBUG) && defined(CLOVER_BUILD)
|
2020-10-12 13:51:08 +02:00
|
|
|
ret = printlib_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
printf("printlib_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
2020-04-24 11:30:09 +02:00
|
|
|
#endif
|
2020-03-27 09:29:38 +01:00
|
|
|
#ifndef _MSC_VER
|
2020-10-12 13:51:08 +02:00
|
|
|
ret = printf_lite_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
printf("printf_lite_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
2020-03-21 14:12:26 +01:00
|
|
|
#endif
|
2020-10-12 13:51:08 +02:00
|
|
|
ret = strlen_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
printf("strlen_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
|
|
|
ret = strcmp_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
printf("strcmp_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
|
|
|
ret = strncmp_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
printf("strncmp_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
2021-03-15 10:02:34 +01:00
|
|
|
ret = strcasecmp_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
printf("strncmp_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
2020-08-25 17:35:19 +02:00
|
|
|
ret = XToolsCommon_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
printf("printlib_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
2020-10-12 13:51:08 +02:00
|
|
|
ret = XArray_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
printf("XArray_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
|
|
|
ret = XObjArray_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
printf("XObjArray_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
|
|
|
ret = XString_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
printf("XString_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
|
|
|
ret = XStringArray_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
printf("XStringArray_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
2020-08-13 14:07:40 +02:00
|
|
|
ret = BootOptions_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
printf("BootOptions_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
|
|
|
ret = XBuffer_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
printf("XBuffer_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
2020-10-12 13:51:08 +02:00
|
|
|
ret = find_replace_mask_Clover_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
printf("xml_lite_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
|
|
|
ret = find_replace_mask_OC_tests();
|
2020-08-25 17:35:19 +02:00
|
|
|
if ( ret != 0 ) {
|
2020-10-12 13:51:08 +02:00
|
|
|
printf("xml_lite_tests() failed at test %d\n", ret);
|
2020-08-25 17:35:19 +02:00
|
|
|
all_ok = false;
|
|
|
|
}
|
2021-02-07 15:39:03 +01:00
|
|
|
ret = ParseXML_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
printf("plist_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
|
|
|
ret = MacOsVersion_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
printf("MacOsVersion_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
2020-02-23 12:21:28 +01:00
|
|
|
|
2020-10-12 13:51:08 +02:00
|
|
|
if ( !all_ok ) {
|
|
|
|
printf("A test failed\n");
|
|
|
|
}
|
|
|
|
|
2020-04-08 12:49:00 +02:00
|
|
|
#if defined(JIEF_DEBUG)
|
2020-10-12 13:51:08 +02:00
|
|
|
if ( all_ok ) {
|
|
|
|
printf("All tests succeeded\n");
|
|
|
|
}
|
2020-02-23 12:21:28 +01:00
|
|
|
#endif
|
2020-10-12 13:51:08 +02:00
|
|
|
|
2020-04-08 12:49:00 +02:00
|
|
|
#if defined(CLOVER_BUILD) && defined(JIEF_DEBUG)
|
2020-10-12 13:51:08 +02:00
|
|
|
if ( all_ok ) {
|
|
|
|
// PauseForKey(L"press");
|
|
|
|
}else{
|
|
|
|
PauseForKey(L"press");
|
|
|
|
}
|
2020-04-08 12:49:00 +02:00
|
|
|
#endif
|
|
|
|
|
2020-10-12 13:51:08 +02:00
|
|
|
return all_ok;
|
2020-02-23 12:21:28 +01:00
|
|
|
}
|