CloverBootloader/rEFIt_UEFI/cpp_unit_test/all_tests.cpp

110 lines
2.5 KiB
C++
Raw Normal View History

#include <Platform.h>
#include "../cpp_foundation/XStringW.h"
#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
#include "XArray_tests.h"
#include "XObjArray_tests.h"
#include "XStringWArray_test.h"
2020-03-12 15:40:38 +01:00
#include "XString_test.h"
#include "XStringW_test.h"
#include "XUINTN_test.h"
#include "strcmp_test.h"
#include "strncmp_test.h"
#include "strlen_test.h"
#include <Platform.h> // Only use angled for Platform, else, xcode project won't compile
#include "printf_lite-test.h"
2020-03-31 18:05:34 +02:00
//#include "poolprint-test.h"
//#include "printlib-test.h"
bool all_tests()
{
bool all_ok = true;
int ret;
#ifdef JIEF_DEBUG
2020-03-26 13:59:20 +01:00
#if defined(CLOVER_BUILD)
// ret = printlib_tests();
// if ( ret != 0 ) {
// DebugLog(2, "printlib_tests() failed at test %d\n", ret);
// all_ok = false;
// }
// ret = poolprint_tests();
// if ( ret != 0 ) {
// DebugLog(2, "poolprint_tests() failed at test %d\n", ret);
// all_ok = false;
// }
2020-03-26 13:59:20 +01:00
#endif
#endif
#ifndef _MSC_VER
ret = printf_lite_tests();
if ( ret != 0 ) {
DebugLog(2, "printf_lite_tests() failed at test %d\n", ret);
all_ok = false;
}
#endif
#ifdef JIEF_DEBUG
//return ret;
#endif
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;
}
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;
}
#ifndef _MSC_VER
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;
}
ret = XStringW_tests();
if ( ret != 0 ) {
DebugLog(2, "XStringW_tests() failed at test %d\n", ret);
all_ok = false;
}
#endif
ret = XStringWArray_tests();
if ( ret != 0 ) {
DebugLog(2, "XStringWArray_tests() failed at test %d\n", ret);
all_ok = false;
}
ret = XUINTN_tests();
if ( ret != 0 ) {
DebugLog(2, "XUINTN_tests() failed at test %d\n", ret);
all_ok = false;
}
if ( !all_ok ) {
DebugLog(2, "A test failed\n");
PauseForKey(L"press");
}else{
2020-03-04 22:54:59 +01:00
#ifdef JIEF_DEBUG
DebugLog(2, "All tests are ok\n");
2020-03-05 08:38:15 +01:00
// PauseForKey(L"press");
#endif
}
return all_ok;
}