Ejemplo n.º 1
0
int main(int argc, char *argv[])
{
	const struct test *t;
	int arg;
	size_t i;

	arg = test_init(argc, argv, tests);
	if (arg == 0)
		return 0;

	if (arg < argc) {
		t = test_find(tests, argv[arg]);
		if (t == NULL) {
			fprintf(stderr, "could not find test %s\n", argv[arg]);
			exit(EXIT_FAILURE);
		}

		return test_run(t);
	}

	for (i = 0; tests[i] != NULL; i++) {
		if (test_run(tests[i]) != 0)
			exit(EXIT_FAILURE);
	}

	exit(EXIT_SUCCESS);
}
Ejemplo n.º 2
0
int main() {

  test_setup();
  perf_start();

  for (int i = 0; i < NUM_ITER; ++i) {
    test_clear();

    reset_timer();
    start_timer();

    test_run(i);

    stop_timer();

    samples[i] = get_time();
  }

  perf_stop();
  int check = test_check();

  printf("Correct: %d\n", check);
  for (int i = 0; i < NUM_ITER; ++i)
    printf("TS[%d]: %d\n", i, samples[i]);

  perf_print_all();

  return 0;
}
Ejemplo n.º 3
0
/**
 *  @brief Main function for the FreeCoAP HTTP/COAP message/URI cross library unit tests
 *
 *  @returns Operation status
 *  @retval EXIT_SUCCESS Success
 *  @retval EXIT_FAILURE Error
 */
int main(void)
{
    test_t tests[] = {{test_uri_http_to_coap_func, &test1_data},
                      {test_uri_http_to_coap_func, &test2_data},
                      {test_uri_http_to_coap_func, &test3_data},
                      {test_uri_http_to_coap_func, &test4_data},
                      {test_uri_http_to_coap_func, &test5_data},
                      {test_uri_http_to_coap_func, &test6_data},
                      {test_uri_http_to_coap_func, &test7_data},
                      {test_uri_coap_to_http_func, &test1_data},
                      {test_uri_coap_to_http_func, &test2_data},
                      {test_uri_coap_to_http_func, &test3_data},
                      {test_uri_coap_to_http_func, &test4_data},
                      {test_uri_coap_to_http_func, &test5_data},
                      {test_uri_coap_to_http_func, &test6_data},
                      {test_uri_coap_to_http_func, &test7_data},
                      {test_msg_http_to_coap_func, &test8_data},
                      {test_msg_http_to_coap_func, &test9_data},
                      {test_msg_http_to_coap_func, &test10_data},
                      {test_msg_http_to_coap_func, &test11_data},
                      {test_msg_coap_to_http_func, &test12_data}};
    unsigned num_tests = DIM(tests);
    unsigned num_pass = 0;

    coap_log_set_level(COAP_LOG_ERROR);
    num_pass = test_run(tests, num_tests);

    return num_pass == num_tests ? EXIT_SUCCESS : EXIT_FAILURE;
}
Ejemplo n.º 4
0
static shell_result test_shell_handler(shell_command* command) {
	if (strcmp(command->command, "test") == 0) {
		test_run();
		return SHELL_RESULT_SUCCESS;
	}
	return SHELL_RESULT_FAIL;
}
Ejemplo n.º 5
0
int main(int argc, char **argv)
{
    int suite = -1, tcase = -1;

    setenv("NTFSV_TRACE_PATHNAME", "/hostfs/repl-opensaf/saflog/ntfa.log", 1);

    srandom(getpid());

    if (argc > 1)
    {
        suite = atoi(argv[1]);
    }

    if (argc > 2)
    {
        tcase = atoi(argv[2]);
    }

    if (suite == 0)
    {
        test_list();
        return 0;
    }

    test_run(suite, tcase);

    return 0;
}
BOOST_FIXTURE_TEST_CASE( test_simple_order, _3cases )
{
    ut::test_unit_id order[] = {master->p_id, tc1->p_id, tc2->p_id, tc3->p_id};
    std::vector<ut::test_unit_id> expected_order(order, order+4);

    test_run( expected_order );
}
int main(void)
{
	static void (*test_functions[])(void) = {
		test_dsync_mailbox_tree_sync_creates,
		test_dsync_mailbox_tree_sync_deletes,
		test_dsync_mailbox_tree_sync_renames1,
		test_dsync_mailbox_tree_sync_renames2,
		test_dsync_mailbox_tree_sync_renames3,
		test_dsync_mailbox_tree_sync_renames4,
		test_dsync_mailbox_tree_sync_renames5,
		test_dsync_mailbox_tree_sync_renames6,
		test_dsync_mailbox_tree_sync_renames7,
		test_dsync_mailbox_tree_sync_renames8,
		test_dsync_mailbox_tree_sync_renames9,
		test_dsync_mailbox_tree_sync_renames10,
		test_dsync_mailbox_tree_sync_renames11,
		test_dsync_mailbox_tree_sync_renames12,
		test_dsync_mailbox_tree_sync_renames13,
		test_dsync_mailbox_tree_sync_renames14,
		test_dsync_mailbox_tree_sync_renames15,
		test_dsync_mailbox_tree_sync_renames16,
		test_dsync_mailbox_tree_sync_renames17,
		test_dsync_mailbox_tree_sync_renames18,
		test_dsync_mailbox_tree_sync_renames19,
		test_dsync_mailbox_tree_sync_renames20,
		test_dsync_mailbox_tree_sync_random,
		NULL
	};
	return test_run(test_functions);
}
Ejemplo n.º 8
0
int main(int argc, char **argv) 
{
    int suite = ALL_SUITES, tcase = ALL_TESTS;

    srandom(getpid());
    clm_init();	

    if (argc > 1)
    {
        suite = atoi(argv[1]);
    }

    if (argc > 2)
    {
        tcase = atoi(argv[2]);
    }

    if (suite == 0)
    {
        test_list();
        return 0;
    }

    return test_run(suite, tcase);
}  
Ejemplo n.º 9
0
static void event_loop(sp_session *session) {
	int timeout = -1;
#ifndef _WIN32
	sigset_t sigset;

	sigemptyset(&sigset);
	sigaddset(&sigset, SIGIO);
#endif

	while (g_exit_code < 0) {

#ifndef _WIN32
		pthread_sigmask(SIG_BLOCK, &sigset, NULL);
#endif

		DSFYDEBUG("Calling sp_session_process_events()\n");
		sp_session_process_events(session, &timeout);

		if(test_run() < 0) {
			DSFYDEBUG("Done running test, existing event loop\n");
			break;
		}

#ifdef _WIN32
		WaitForSingleObject(g_notify_event, timeout);
#else
		pthread_sigmask(SIG_UNBLOCK, &sigset, NULL);
		usleep(timeout * 1000);
#endif
	}

	DSFYDEBUG("Exiting from loop()\n");
}
Ejemplo n.º 10
0
int main(int argc, char *argv[])
{
	const char *msg;
	msg = parse_opts(argc, argv, NULL, NULL);
	if (msg != NULL)
		tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);

	tst_require_root(NULL);

	if (tst_kvercmp(2, 6, 0) < 0) {
		tst_brkm(TCONF, NULL,
			"Test must be run with kernel 2.6 or newer");
	}

	tst_sig(FORK, DEF_HANDLER, cleanup);

	tst_module_load(NULL, module_name, NULL);
	module_loaded = 1;

	test_run();

	cleanup();

	tst_exit();
}
Ejemplo n.º 11
0
void
test_battery()
{
        int retval;
        struct libdaemon_config *cfg;

        /* ensure run before init fails */
        retval = test_run();

        /* ensure destroy before init fails */
        retval = test_destroy();

        /* ensure init works */
        retval = test_init();

        cfg = daemon_getconfig();
        if ((NULL != cfg) && (NULL != cfg->rundir))
            printf("[+] rundir: %s\n\n", cfg->rundir);

        /* ensure double init fails */
        retval = test_init();

        /* test run works */
//        retval = test_run();

        /* test destroy works */
        retval = test_destroy();

}
Ejemplo n.º 12
0
int main() {
    plan();

    test_run();
    
    return exit_status();
}
Ejemplo n.º 13
0
int main(void) {
	random_init();
	dcrypt_initialize("openssl", NULL, NULL);

	static void (*test_functions[])(void) = {
		test_cipher_test_vectors,
		test_cipher_aead_test_vectors,
		test_hmac_test_vectors,
		test_load_v1_keys,
		test_load_v1_key,
		test_load_v1_public_key,
		test_load_v2_key,
		test_load_v2_public_key,
		test_get_info_v2_key,
		test_gen_and_get_info_rsa_pem,
		test_get_info_rsa_private_key,
		NULL
	};

	int ret = test_run(test_functions);

	dcrypt_deinitialize();
	random_deinit();

	return ret;
}
static int __init
test_module_init(void)
{
    int result;
    
    result = test_init();
    if(result < 0)
    {
        pr_err("Failed to init test.");
        return result;
    }
    else if(result > 0)
    {
        pr_err("Test initialization function returns positive result.");
        return -EINVAL;
    }

    result = test_run();
    
    test_cleanup();

    if(result < 0)
    {
        pr_err("Test failed.");
        return result;
    }
    else if(result > 0)
    {
        pr_err("Test execution returns positive result.");
        return -EINVAL;
    }

    return 0;
}
int main(void)
{
	static void (*test_functions[])(void) = {
		test_message_parser_small_blocks,
		NULL
	};
	return test_run(test_functions);
}
Ejemplo n.º 16
0
int main(void)
{
	static void (*test_functions[])(void) = {
		test_quota_transaction_is_over,
		NULL
	};
	return test_run(test_functions);
}
int main(void)
{
	static void (*test_functions[])(void) = {
		test_istream_dot,
		NULL
	};
	return test_run(test_functions);
}
Ejemplo n.º 18
0
int main(void)
{
	static void (*test_functions[])(void) = {
		test_mail_html2text,
		NULL
	};
	return test_run(test_functions);
}
Ejemplo n.º 19
0
int main(void)
{
	static void (*test_functions[])(void) = {
		test_message_date_parse,
		NULL
	};
	return test_run(test_functions);
}
Ejemplo n.º 20
0
int main(void)
{
	static void (*test_functions[])(void) = {
		test_settings_get_time,
		NULL
	};
	return test_run(test_functions);
}
Ejemplo n.º 21
0
int main(void)
{
	static void (*test_functions[])(void) = {
		test_quoted_printable_q_decode,
		NULL
	};
	return test_run(test_functions);
}
Ejemplo n.º 22
0
int main(void) {
	void (*tests[])(void) = {
		test_lua,
		NULL
	};

	return test_run(tests);
}
Ejemplo n.º 23
0
int main(void)
{
	static void (*test_functions[])(void) = {
		test_penalty_checksum,
		NULL
	};
	return test_run(test_functions);
}
Ejemplo n.º 24
0
int main(void)
{
	static void (*test_functions[])(void) = {
		test_message_id_get_next,
		NULL
	};
	return test_run(test_functions);
}
Ejemplo n.º 25
0
int main(void)
{
	static void (*test_functions[])(void) = {
		test_message_snippet,
		NULL
	};
	return test_run(test_functions);
}
Ejemplo n.º 26
0
int main(void)
{
	static void (*test_functions[])(void) = {
		test_imap_parse_system_flag,
		NULL
	};
	return test_run(test_functions);
}
Ejemplo n.º 27
0
int main(void)
{
	static void (*test_functions[])(void) = {
		test_dict_escape,
		NULL
	};
	return test_run(test_functions);
}
Ejemplo n.º 28
0
int main(void)
{
	static void (*test_functions[])(void) = {
		test_imap_parser_crlf,
		NULL
	};
	return test_run(test_functions);
}
Ejemplo n.º 29
0
int main(void)
{
	static void (*test_functions[])(void) = {
		test_imap_bodystructure_write,
		test_imap_bodystructure_parse,
		NULL
	};
	return test_run(test_functions);
}
Ejemplo n.º 30
0
int main(int argc, char* argv[])
{
	void *app = test_init();
	egx_wnd_t window = window_create_((char*)"Test Qt Hahaha",0,0,0,640,480);
	window_show_(window);
	test_run(app);
	test_quit(app);
	return 0;
}