示例#1
0
G_GNUC_NORETURN
static void test_run(G_GNUC_UNUSED void *data)
{
	gui_set_view(GUI_VIEW_TEXT);
	delay();

	// Test plain hash
	for (int i = 0; i < HASH_FUNCS_N; i++) {
		char *str = g_strdup_printf("/hash/func/%s", hash.funcs[i].name);
		g_test_add_data_func(str, &hash.funcs[i],
			(GTestDataFunc)test_hash_func);
		g_free(str);
	}

	// Test HMAC
	for (int i = 0; i < HASH_FUNCS_N; i++) {
		if (!hash.funcs[i].supported || !hash.funcs[i].hmac_supported)
			continue;

		char *str = g_strdup_printf("/hash/func/HMAC-%s", hash.funcs[i].name);
		g_test_add_data_func(str, &hash.funcs[i],
			(GTestDataFunc)test_hash_func_hmac);
		g_free(str);
	}

	g_test_set_nonfatal_assertions();

	exit(g_test_run());
}
int
main (int argc, char *argv[])
{
    g_test_init (&argc, &argv, NULL);
    g_test_set_nonfatal_assertions ();
    nautilus_ensure_extension_points();

    setup_test_suite ();

    return g_test_run ();
}
int
main (int argc, char *argv[])
{
    g_autoptr (NautilusFileUndoManager) undo_manager = NULL;

    undo_manager = nautilus_file_undo_manager_new ();
    g_test_init (&argc, &argv, NULL);
    g_test_set_nonfatal_assertions ();
    nautilus_ensure_extension_points();

    setup_test_suite ();

    return g_test_run ();
}
示例#4
0
文件: test-796.c 项目: dequis/irssi
int main(int argc, char **argv)
{
	g_test_init(&argc, &argv, NULL);
	g_test_bug_base("https://github.com/irssi/irssi/issues/");

	g_test_add("/test/server_destroy_flood", ServerDestroyFloodData, NULL,
		   server_destroy_flood_set_up, test_server_destroy_flood,
		   server_destroy_flood_tear_down);

	g_test_set_nonfatal_assertions();

	core_preinit(*argv);
	irssi_gui = IRSSI_GUI_NONE;

	return g_test_run();
}
示例#5
0
文件: test-formats.c 项目: ahf/irssi
int main(int argc, char **argv)
{
	int i;

	g_test_init(&argc, &argv, NULL);

	for (i = 0; i < G_N_ELEMENTS(format_real_length_fixtures); i++) {
		char *name = g_strdup_printf("/test/format_real_length/%d", i);
		g_test_add_data_func(name, &format_real_length_fixtures[i], (GTestDataFunc)test_format_real_length);
		g_free(name);
	}

#if GLIB_CHECK_VERSION(2,38,0)
	g_test_set_nonfatal_assertions();
#endif
	return g_test_run();
}
示例#6
0
int main (int argc, char **argv)
{
  g_test_init (&argc, &argv, NULL);

  g_test_add_func ("/Utils/safename_returns_foobar", test_safename1);
  g_test_add_func ("/Utils/safename_returns_html_entities", test_safename2);
  g_test_add_func ("/Utils/safename_returns_null", test_safename3);

  g_test_add_func ("/Utils/application_menu_with_prefix", test_application_menu_with_prefix);
  g_test_add_func ("/Utils/application_menu_without_prefix", test_application_menu_without_prefix);

  g_test_add_func ("/Context/set_terminal_cmd", test_set_terminal_cmd);
  g_test_add_func ("/Context/set_desktop_flag", test_set_desktop_flag);
  g_test_add_func ("/Context/add_desktop_flag", test_add_desktop_flag);

  g_test_add_func ("/Context/set_persistent_true", test_persistent_true);
  g_test_add_func ("/Context/set_persistent_false", test_persistent_false);



  g_test_set_nonfatal_assertions ();

  return g_test_run();
}
示例#7
0
int sc_run_unit_tests(int *argc, char ***argv)
{
	g_test_init(argc, argv, NULL);
	g_test_set_nonfatal_assertions();
	return g_test_run();
}
示例#8
0
int
main(int argc, char **argv)
{

	int i = init_file();

	if (!i) {
		HC_TEST_INIT(argc, argv);

		const char *ns = "NS";

		gs_error_t *err = NULL;
		gs_grid_storage_t *gs = gs_grid_storage_init(ns, &err);

		if (!gs) {
			fprintf(stderr, "OIO init error : (%d) %s\n", err->code, err->msg);
			_gs_error_clear(&err);
			abort();
		}

		g_test_set_nonfatal_assertions();

		g_test_add_data_func("/client/lib/prop/set_ref_prop", gs,
			(GTestDataFunc) test_set_reference_property);

		g_test_add_data_func("/client/lib/prop/get_ref_prop", gs,
			(GTestDataFunc) test_get_reference_property);
		g_test_add_data_func("/client/lib/prop/get_ref_prop_v", gs,
			(GTestDataFunc) test_get_reference_property_void);
		g_test_add_data_func("/client/lib/prop/get_ref_prop_w", gs,
			(GTestDataFunc)
			test_get_reference_property_wrong_key);

		g_test_add_data_func("/client/lib/prop/del_ref_prop", gs,
			(GTestDataFunc) test_delete_reference_property);

		g_test_add_data_func("/client/lib/prop/set_cont_strpol", gs,
			(GTestDataFunc)
			test_set_container_storage_policy);
		g_test_add_data_func("/client/lib/prop/set_cont_strpol_wrong", gs,
			(GTestDataFunc)
			test_set_container_storage_policy_wrong);

		g_test_add_data_func("/client/lib/prop/set_cont_quot", gs,
			(GTestDataFunc) test_set_container_quota);

		g_test_add_data_func("/client/lib/prop/set_cont_vers", gs,
			(GTestDataFunc) test_set_container_versioning);

		g_test_add_data_func("/client/lib/prop/del_cont_vers", gs,
			(GTestDataFunc) test_del_container_versioning);
		g_test_add_data_func("/client/lib/prop/del_cont_vers_v", gs,
			(GTestDataFunc)
			test_del_container_versioning_void);

		g_test_add_data_func("/client/lib/prop/set_content_strpol", gs,
			(GTestDataFunc) test_set_content_storage_policy);
		g_test_add_data_func("/client/lib/prop/set_content_strpol_w_path", gs,
			(GTestDataFunc)
			test_set_content_storage_policy_bad_path);
		g_test_add_data_func("/client/lib/prop/set_content_strpol_w", gs,
			(GTestDataFunc)
			test_set_content_storage_policy_wrong);

		g_test_add_data_func("/client/lib/prop/get_content_prop", gs,
			(GTestDataFunc) test_get_content_properties);

		g_test_add_data_func("/client/lib/prop/set_content_prop", gs,
			(GTestDataFunc) test_set_content_property);
		g_test_add_data_func("/client/lib/prop/set_content_prop_w", gs,
			(GTestDataFunc) test_set_content_property_wrong);
		g_test_add_data_func("/client/lib/prop/set_content_prop_again", gs,
			(GTestDataFunc) test_set_content_property_again);

		//g_test_add_data_func("/client/lib/prop/del_content_prop", gs,
		//  (GTestDataFunc) test_delete_content_property);

		g_test_add_data_func("/client/lib/prop/copy_content", gs,
			(GTestDataFunc) test_copy_content);

		int success = g_test_run();

		remove("file_test.txt");

		gs_grid_storage_free(gs);
		gs = NULL;

		return success;
	}
	else
		return 0;
}