2020-02-28 21:28:33 +01:00
|
|
|
#include <Platform.h>
|
2020-02-23 12:21:28 +01:00
|
|
|
#include "../cpp_foundation/XStringW.h"
|
|
|
|
#include "../cpp_foundation/XArray.h"
|
|
|
|
#include "../cpp_foundation/XObjArray.h"
|
|
|
|
|
|
|
|
#include "XArray_tests.h"
|
|
|
|
#include "XObjArray_tests.h"
|
2020-02-23 21:23:31 +01:00
|
|
|
#include "XStringWArray_test.h"
|
2020-03-12 15:40:38 +01:00
|
|
|
#include "XString_test.h"
|
2020-02-23 21:23:31 +01:00
|
|
|
#include "XStringW_test.h"
|
2020-03-11 15:23:58 +01:00
|
|
|
#include "XUINTN_test.h"
|
2020-03-13 14:11:58 +01:00
|
|
|
#include "strcmp_test.h"
|
|
|
|
#include "strncmp_test.h"
|
|
|
|
#include "strlen_test.h"
|
2020-02-23 21:23:31 +01:00
|
|
|
#include <Platform.h> // Only use angled for Platform, else, xcode project won't compile
|
2020-03-21 14:12:26 +01:00
|
|
|
#include "printf_lite-test.h"
|
2020-03-25 19:32:44 +01:00
|
|
|
#include "poolprint-test.h"
|
|
|
|
#include "printlib-test.h"
|
2020-02-23 12:21:28 +01:00
|
|
|
|
|
|
|
bool all_tests()
|
|
|
|
{
|
|
|
|
bool all_ok = true;
|
|
|
|
int ret;
|
|
|
|
|
2020-03-25 19:32:44 +01:00
|
|
|
#ifdef JIEF_DEBUG
|
|
|
|
ret = printlib_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
DebugLog(2, "printf_lite_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
|
|
|
ret = poolprint_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
DebugLog(2, "printf_lite_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
|
|
|
#endif
|
2020-03-21 14:12:26 +01:00
|
|
|
ret = printf_lite_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
DebugLog(2, "printf_lite_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
|
|
|
#ifdef JIEF_DEBUG
|
|
|
|
//return ret;
|
|
|
|
#endif
|
2020-03-13 14:11:58 +01:00
|
|
|
ret = strlen_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
DebugLog(2, "posix_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
|
|
|
ret = strcmp_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
DebugLog(2, "posix_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
|
|
|
ret = strncmp_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
DebugLog(2, "posix_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
2020-02-23 12:21:28 +01:00
|
|
|
ret = XArray_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
DebugLog(2, "XArray_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
|
|
|
ret = XObjArray_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
DebugLog(2, "XObjArray_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
2020-03-12 15:40:38 +01:00
|
|
|
ret = XString_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
DebugLog(2, "XString_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
2020-02-23 21:23:31 +01:00
|
|
|
ret = XStringW_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
DebugLog(2, "XStringW_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
|
|
|
ret = XStringWArray_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
DebugLog(2, "XStringWArray_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
2020-03-11 15:23:58 +01:00
|
|
|
ret = XUINTN_tests();
|
|
|
|
if ( ret != 0 ) {
|
|
|
|
DebugLog(2, "XUINTN_tests() failed at test %d\n", ret);
|
|
|
|
all_ok = false;
|
|
|
|
}
|
2020-02-23 12:21:28 +01:00
|
|
|
|
|
|
|
if ( !all_ok ) {
|
2020-02-23 21:23:31 +01:00
|
|
|
DebugLog(2, "A test failed\n");
|
2020-02-23 12:21:28 +01:00
|
|
|
PauseForKey(L"press");
|
|
|
|
}else{
|
2020-03-04 22:54:59 +01:00
|
|
|
#ifdef JIEF_DEBUG
|
2020-03-10 05:32:08 +01:00
|
|
|
DebugLog(2, "All tests are ok\n");
|
2020-03-05 08:38:15 +01:00
|
|
|
// PauseForKey(L"press");
|
2020-02-23 12:21:28 +01:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
return all_ok;
|
|
|
|
}
|