static DWORD WINAPI ThreadFunc(LPVOID arg) { if(!setjmp(jump_buf)) main_test(); else set_visible(1); /* could be unsafe to call it from another thread */ return 0; }
int main () { inside_main = 1; main_test (); inside_main = 0; return 0; }
int main(){ initOpenGL(400,400); init_events(); main_test(); std::cout << "Testing mem corruption\n"; int * i = new int[12345]; delete i; std::cout << "OK\n"; return 0; }
int main() { int ret = 0; /* * This is where we set the test agenda. You can * experiment with different flags (ie, to compare * performance). Between tests, you can also make * changes to the global variable g_config to * change which platform or device you want to use * in the next test. */ g_config.config_platform = 1; g_config.config_device = 0; main_test("-Werror -cl-mad-enable"); // main_test("-Werror -cl-mad-enable -D UL_NVIDIA=1"); return ret; }
static int test_case(int in, int ref) { return process_result(in, main_test(in), ref); }
int main() { main_test(); return 0; }
int main(void) { main_test(); // blinky_test(); }
int main(){ printf("Hello, World!\n"); main_test(); printf("Byebye, World!\n"); return 0; }
int main(int argc, char* argv[]) { if (argc > 1 && argv[1] == std::string("test")) { return main_test(argc, argv); } loguru::init(argc, argv); // auto verbose_type_name = loguru::demangle(typeid(std::ofstream).name()); // loguru::add_stack_cleanup(verbose_type_name.c_str(), "std::ofstream"); // std::ofstream os; // die(os); if (argc == 1) { loguru::add_file("latest_readable.log", loguru::Truncate, loguru::Verbosity_INFO); loguru::add_file("everything.log", loguru::Append, loguru::Verbosity_MAX); LOG_F(INFO, "Loguru test"); test_thread_names(); test_scopes(); test_levels(); test_stream(); } else { std::string test = argv[1]; if (test == "ABORT_F") { ABORT_F("ABORT_F format message"); } else if (test == "ABORT_S") { ABORT_S() << "ABORT_S stream message"; } else if (test == "assert") { const char* ptr = 0; assert(ptr && "Error that was unexpected"); } else if (test == "LOG_F(FATAL)") { LOG_F(FATAL, "Fatal format message"); } else if (test == "LOG_S(FATAL)") { LOG_S(FATAL) << "Fatal stream message"; } else if (test == "CHECK_NOTNULL_F") { const char* ptr = 0; CHECK_NOTNULL_F(ptr); } else if (test == "CHECK_F") { CHECK_F(1 > 2); } else if (test == "CHECK_EQ_F") { CHECK_EQ_F(always_increasing(), 0); CHECK_EQ_F(always_increasing(), 1); CHECK_EQ_F(always_increasing(), 42); } else if (test == "CHECK_EQ_F_int") { int x = 42; CHECK_EQ_F(x, x + 1); } else if (test == "CHECK_EQ_F_unsigned") { unsigned x = 42; CHECK_EQ_F(x, x + 1); } else if (test == "CHECK_EQ_F_size_t") { size_t x = 42; CHECK_EQ_F(x, x + 1); } else if (test == "CHECK_EQ_F_message") { CHECK_EQ_F(always_increasing(), 0, "Should pass"); CHECK_EQ_F(always_increasing(), 1, "Should pass"); CHECK_EQ_F(always_increasing(), 42, "Should fail"); } else if (test == "CHECK_EQ_S") { std::string str = "right"; CHECK_EQ_S(str, "wrong") << "Expected to fail, since `str` isn't \"wrong\" but \"" << str << "\""; } else if (test == "CHECK_LT_S") { CHECK_EQ_S(always_increasing(), 0); CHECK_EQ_S(always_increasing(), 1); CHECK_EQ_S(always_increasing(), 42); } else if (test == "CHECK_LT_S_message") { CHECK_EQ_S(always_increasing(), 0) << "Should pass"; CHECK_EQ_S(always_increasing(), 1) << "Should pass"; CHECK_EQ_S(always_increasing(), 42) << "Should fail!"; } else if (test == "deep_abort") { deep_abort_10({"deep_abort"}); } else if (test == "SIGSEGV") { test_SIGSEGV_2(); } else if (test == "hang") { test_hang_2(); } else { LOG_F(ERROR, "Unknown test: '%s'", test.c_str()); } } }