示例#1
0
int main(int argc, char** argv)
{
    g_thread_init(NULL);
    gtk_test_init(&argc, &argv, NULL);

    g_test_bug_base("https://bugs.webkit.org/");
    const char* selected_span_html = "<html><body>"
        "<span id=\"mainspan\">All work and no play <span>make Jack a dull</span> boy.</span>"
        "<script>document.getSelection().collapse();\n"
        "document.getSelection().selectAllChildren(document.getElementById('mainspan'));\n"
        "</script></body></html>";
    const char* no_selection_html = "<html><body>"
        "<span id=\"mainspan\">All work and no play <span>make Jack a dull</span> boy</span>"
        "<script>document.getSelection().collapse();\n"
        "</script></body></html>";

    g_test_add("/webkit/copyandpaste/selection", CopyAndPasteFixture,
               test_info_new(selected_span_html, "All work and no play make Jack a dull boy."),
               copy_and_paste_fixture_setup,
               test_copy_and_paste,
               copy_and_paste_fixture_teardown);
    g_test_add("/webkit/copyandpaste/no-selection", CopyAndPasteFixture,
               test_info_new(no_selection_html, 0),
               copy_and_paste_fixture_setup,
               test_copy_and_paste,
               copy_and_paste_fixture_teardown);

    return g_test_run();
}
int main(int argc, char** argv)
{
    g_thread_init(NULL);
    gtk_test_init(&argc, &argv, NULL);

    g_test_bug_base("https://bugs.webkit.org/");

    g_test_add("/webkit/keyevent/textfield", KeyEventFixture,
               test_info_new("<html><body><input id=\"in\" type=\"text\">"
                             "<script>document.getElementById('in').focus();"
                             "</script></body></html>", TRUE),
               key_event_fixture_setup,
               test_keypress,
               key_event_fixture_teardown);

    g_test_add("/webkit/keyevent/buttons", KeyEventFixture,
               test_info_new("<html><body><input id=\"in\" type=\"button\">"
                             "<script>document.getElementById('in').focus();"
                             "</script></body></html>", FALSE),
               key_event_fixture_setup,
               test_keypress,
               key_event_fixture_teardown);

    g_test_add("/webkit/keyevent/link", KeyEventFixture,
               test_info_new("<html><body><a href=\"http://www.gnome.org\" id=\"in\">"
                             "LINKY MCLINKERSON</a><script>"
                             "document.getElementById('in').focus();</script>"
                             "</body></html>", FALSE),
               key_event_fixture_setup,
               test_keypress,
               key_event_fixture_teardown);

    return g_test_run();
}
int main(int argc, char** argv)
{
    gtk_test_init(&argc, &argv, NULL);

    g_test_bug_base("https://bugs.webkit.org/");

    g_test_add("/webkit/hittestresult/document", HitTestResultFixture, 
               test_info_new("<html><body><h1>WebKitGTK+!</h1></body></html>",
                             WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT),
               hit_test_result_fixture_setup, test_webkit_hit_test_result, hit_test_result_fixture_teardown);
    /* We hardcode all elements to be at 0,0 so that we know where to
     * generate the button events */
    g_test_add("/webkit/hittestresult/image", HitTestResultFixture,
               test_info_new("<html><body><img style='position:absolute; left:0; top:0'src='0xdeadbeef' width=50 height=50></img></body></html>",
                             WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE),
               hit_test_result_fixture_setup, test_webkit_hit_test_result, hit_test_result_fixture_teardown);
    g_test_add("/webkit/hittestresult/editable", HitTestResultFixture,
               test_info_new("<html><body><input style='position:absolute; left:0; top:0' size='35'></input>></body></html>",
                             WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE),
               hit_test_result_fixture_setup, test_webkit_hit_test_result, hit_test_result_fixture_teardown);
    g_test_add("/webkit/hittestresult/link", HitTestResultFixture,
               test_info_new("<html><body><a style='position:absolute; left:0; top:0' href='http://www.example.com'>HELLO WORLD</a></body></html>",
                             WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK),
               hit_test_result_fixture_setup, test_webkit_hit_test_result, hit_test_result_fixture_teardown);
               
    return g_test_run ();
}
示例#4
0
gint
main (gint argc, gchar *argv[])
{
  g_test_init (&argc, &argv, NULL);
  ncm_cfg_init_full_ptr (&argc, &argv);
  ncm_cfg_enable_gsl_err_handler ();

  g_test_add ("/ncm/obj_array/add", TestNcmObjArray, NULL,
              &test_ncm_obj_array_new,
              &test_ncm_obj_array_add,
              &test_ncm_obj_array_free);

  g_test_add ("/ncm/obj_array/saveload", TestNcmObjArray, NULL,
              &test_ncm_obj_array_new,
              &test_ncm_obj_array_saveload,
              &test_ncm_obj_array_free);

  g_test_add ("/ncm/obj_array/traps", TestNcmObjArray, NULL,
              &test_ncm_obj_array_new,
              &test_ncm_obj_array_traps,
              &test_ncm_obj_array_free);
#if GLIB_CHECK_VERSION(2,38,0)
  g_test_add ("/ncm/obj_array/invalid/add/subprocess", TestNcmObjArray, NULL,
              &test_ncm_obj_array_new,
              &test_ncm_obj_array_invalid_add,
              &test_ncm_obj_array_free);

  g_test_add ("/ncm/obj_array/invalid/set/subprocess", TestNcmObjArray, NULL,
              &test_ncm_obj_array_new,
              &test_ncm_obj_array_invalid_set,
              &test_ncm_obj_array_free);
#endif
  g_test_run ();
}
示例#5
0
int main(int argc, char **argv) {
	if (log4c_init()) {
		g_message("log4c init error!");
	}
	g_test_init(&argc, &argv, NULL);
	g_test_add("/misc/icache_insert_1", 
				Fixture, 
				NULL,
				case_setup, 
				test_icache_insert_1, 
				case_teardown);
	g_test_add("/misc/icache_insert_2", 
				Fixture, 
				NULL,
				case_setup, 
				test_icache_insert_2, 
				case_teardown);
	g_test_add("/misc/icache_query_1", 
				Fixture, 
				NULL,
				case_setup, 
				test_icache_query_1, 
				case_teardown);
	g_test_add("/misc/icache_query_2", 
				Fixture, 
				NULL,
				case_setup, 
				test_icache_query_2, 
				case_teardown);
	
	return g_test_run();
}
gint
main (gint argc,
      gchar **argv)
{
	g_test_init (&argc, &argv, NULL);
	g_test_bug_base ("http://bugzilla.gnome.org/");

	g_test_add (
		"/ECalClient/RemoveObject/Sync",
		ETestServerFixture,
		&cal_closure_sync,
		e_test_server_utils_setup,
		test_remove_object_sync,
		e_test_server_utils_teardown);
	g_test_add (
		"/ECalClient/RemoveObject/Async",
		ETestServerFixture,
		&cal_closure_async,
		e_test_server_utils_setup,
		test_remove_object_async,
		e_test_server_utils_teardown);
	g_test_add (
		"/ECalClient/RemoveObject/EmptyUid",
		ETestServerFixture,
		&cal_closure_sync,
		e_test_server_utils_setup,
		test_remove_object_empty_uid,
		e_test_server_utils_teardown);

	return e_test_server_utils_run ();
}
示例#7
0
static void
add_one_stream_test(const char *base_name,
                    void (* func) (OutputTestFixture*, gconstpointer))
{
    gsize i;

    for (i = 0; i < G_N_ELEMENTS(single_stream_tests); ++i) {
        char *s;
        s = g_strdup_printf("/output/%s_one_task_%s",
                            base_name, single_stream_tests[i].name);
        g_test_add(s,
                   OutputTestFixture,
                   &single_stream_tests[i],
                   setup_one_task_no_chain,
                   func,
                   teardown);
        g_free(s);

        s = g_strdup_printf("/output/%s_two_tasks_%s",
                            base_name, single_stream_tests[i].name);
        g_test_add(s,
                   OutputTestFixture,
                   &single_stream_tests[i],
                   setup_two_tasks_no_chain,
                   func,
                   teardown);
        g_free(s);
    }
}
int
main(int argc, char *argv[])
{
    g_test_init(&argc, &argv, NULL);

    g_test_add_func("/compression_wrapper/test_cr_contentstat",
            test_cr_contentstat);
    g_test_add_func("/compression_wrapper/test_cr_compression_suffix",
            test_cr_compression_suffix);
    g_test_add_func("/compression_wrapper/test_cr_detect_compression",
            test_cr_detect_compression);
    g_test_add_func("/compression_wrapper/test_cr_compression_type",
            test_cr_compression_type);
    g_test_add_func("/compression_wrapper/test_cr_detect_compression_bad_suffix",
            test_cr_detect_compression_bad_suffix);
    g_test_add_func("/compression_wrapper/test_cr_read_with_autodetection",
            test_cr_read_with_autodetection);
    g_test_add("/compression_wrapper/outputtest_cw_output", Outputtest, NULL,
            outputtest_setup, outputtest_cw_output, outputtest_teardown);
    g_test_add_func("/compression_wrapper/test_cr_error_handling",
            test_cr_error_handling);
    g_test_add("/compression_wrapper/test_contentstating_singlewrite",
            Outputtest, NULL, outputtest_setup,
            test_contentstating_singlewrite, outputtest_teardown);
    g_test_add("/compression_wrapper/test_contentstating_multiwrite",
            Outputtest, NULL, outputtest_setup,
            test_contentstating_multiwrite, outputtest_teardown);

    return g_test_run();
}
gint
main (gint argc,
      gchar **argv)
{
#if !GLIB_CHECK_VERSION (2, 35, 1)
	g_type_init ();
#endif
	g_test_init (&argc, &argv, NULL);
	g_test_bug_base ("http://bugzilla.gnome.org/");

	g_test_add (
		"/EBook/CommitContact/Sync",
		ETestServerFixture,
		&book_closure,
		e_test_server_utils_setup,
		test_commit_contact_sync,
		e_test_server_utils_teardown);
	g_test_add (
		"/EBook/CommitContact/Async",
		ETestServerFixture,
		&book_closure,
		e_test_server_utils_setup,
		test_commit_contact_async,
		e_test_server_utils_teardown);

	return e_test_server_utils_run ();
}
示例#10
0
int main(int argc, char **argv){
    g_test_init(&argc, &argv, NULL);
    g_test_add ("/set1/new test", dfixture, NULL,
                                  dict_setup, test_new, dict_teardown);
    g_test_add ("/set1/copy test", dfixture, NULL,
                                  dict_setup, test_copy, dict_teardown);
    g_test_add_func ("/set2/fail test", test_failure);
    return g_test_run();
}
示例#11
0
int
main(int argc, char *argv[])
{
	g_test_init(&argc, &argv, NULL);
#if !GLIB_CHECK_VERSION(2, 36, 0)
	g_type_init();
#endif
	g_test_add(CLASS"/001", gpointer, NULL, NULL, test_001, NULL);
	g_test_add(CLASS"/002", gpointer, NULL, NULL, test_002, NULL);
	return g_test_run();
}
示例#12
0
int
main(int argc, char *argv[])
{
    g_test_init(&argc, &argv, NULL);

    g_test_add("/sqlite/test_cr_open_db", TestData, NULL, testdata_setup, test_cr_open_db, testdata_teardown);
    g_test_add("/sqlite/test_cr_db_add_primary_pkg", TestData, NULL, testdata_setup, test_cr_db_add_primary_pkg, testdata_teardown);
    g_test_add("/sqlite/test_cr_db_dbinfo_update", TestData, NULL, testdata_setup, test_cr_db_dbinfo_update, testdata_teardown);
    g_test_add("/sqlite/test_all", TestData, NULL, testdata_setup, test_all, testdata_teardown);

    return g_test_run();
}
示例#13
0
int
main (int   argc,
      char *argv[])
{
  g_test_init (&argc, &argv, NULL);

  g_test_add ("/gdbus/close-pending", Fixture, "close",
      setup, test_many_times, teardown);
  g_test_add ("/gdbus/unref-pending", Fixture, "unref",
      setup, test_many_times, teardown);

  return g_test_run();
}
示例#14
0
int
main (int argc, char **argv)
{
	g_test_init (&argc, &argv, NULL);

	g_test_add_func ("/gck/module/initialize_async", test_initialize_async);
	g_test_add ("/gck/module/invalid_modules", Test, NULL, setup, test_invalid_modules, teardown);
	g_test_add ("/gck/module/module_equals_hash", Test, NULL, setup, test_module_equals_hash, teardown);
	g_test_add ("/gck/module/module_props", Test, NULL, setup, test_module_props, teardown);
	g_test_add ("/gck/module/module_info", Test, NULL, setup, test_module_info, teardown);

	return egg_tests_run_with_loop ();
}
示例#15
0
int
main(int argc, char *argv[])
{
	g_test_init(&argc, &argv, NULL);
	g_type_init();
#ifndef G_THREADS_IMPL_NONE
	if (!g_thread_supported()) {
		g_thread_init(NULL);
	}
#endif
	g_test_add(CLASS"/001", gpointer, NULL, NULL, test_001, teardown);
	g_test_add(CLASS"/002", gpointer, NULL, NULL, test_002, teardown);
	g_test_add(CLASS"/003", gpointer, NULL, NULL, test_003, teardown);
	g_test_add(CLASS"/004", gpointer, NULL, NULL, test_004, teardown);
	return g_test_run();
}
示例#16
0
static void
add_test (const char *path,
	  gboolean    mixed,
	  int         test_type,
	  gboolean    use_align,
	  gdouble     row_align,
	  void (* setup) (ScrollFixture *, gconstpointer),
	  void (* scroll_func) (ScrollFixture *, gconstpointer))
{
	gchar *test_path;
	gchar *align;

	align = align_string (use_align, row_align);

	test_path = g_strdup_printf ("/TreeView/scrolling/%s/%s-height/path-%s-%s",
				     test_type_string (test_type),
				     mixed ? "mixed" : "constant",
				     path, align);
	g_free (align);

	g_test_add (test_path, ScrollFixture, path,
		    setup, scroll_func, scroll_fixture_teardown);

	g_free (test_path);
}
示例#17
0
static void event_test_add(const char *testpath,
                           void (*test_func)(TestEventData *data,
                                             const void *user_data))
{
    g_test_add(testpath, TestEventData, NULL, event_prepare, test_func,
               event_teardown);
}
static void input_visitor_test_add(const char *testpath,
                                   TestInputVisitorData *data,
                                   void (*test_func)(TestInputVisitorData *data, const void *user_data))
{
    g_test_add(testpath, TestInputVisitorData, data, NULL, test_func,
               visitor_input_teardown);
}
void add_set_item(lfTestParams *p)
{
  gchar *desc = NULL;

  desc = describe(p, "modifier/coord/serialFor");
  g_test_add(desc, lfFixture, p, mod_setup, test_mod_coord_scale, mod_teardown);
  g_free(desc);
  desc = NULL;

#ifdef _OPENMP
  desc = describe(p, "modifier/coord/parallelFor");
  g_test_add(desc, lfFixture, p, mod_setup, test_mod_coord_scale_parallel, mod_teardown);
  g_free(desc);
  desc = NULL;
#endif
}
示例#20
0
void add_set_item(lfTestParams *p, const char *f)
{
  gchar *desc = NULL;

  desc = describe(p, "modifier/color/serialFor", f);
  g_test_add(desc, lfFixture, p, mod_setup<T>, test_mod_color<T>, mod_teardown);
  g_free(desc);
  desc = NULL;

#ifdef _OPENMP
  desc = describe(p, "modifier/color/parallelFor", f);
  g_test_add(desc, lfFixture, p, mod_setup<T>, test_mod_color_parallel<T>, mod_teardown);
  g_free(desc);
  desc = NULL;
#endif
}
示例#21
0
static void
add_test(const char *testpath,
         void (*test_func)(OptsVisitorFixture *f, gconstpointer test_data),
         gconstpointer test_data)
{
    g_test_add(testpath, OptsVisitorFixture, test_data, setup_fixture,
               test_func, teardown_fixture);
}
示例#22
0
int
main (int argc,
      char *argv[])
{
  cockpit_test_init (&argc, &argv);

  g_test_add ("/portal/simple", TestCase, NULL,
              setup, test_simple, teardown);
  g_test_add ("/portal/failover", TestCase, NULL,
              setup, test_failover, teardown);
  g_test_add ("/portal/fail", TestCase, NULL,
              setup, test_fail, teardown);
  g_test_add ("/portal/fallback", TestCase, NULL,
              setup, test_fallback, teardown);

  return g_test_run ();
}
示例#23
0
int
main (int argc,
    char **argv)
{
  test_init (&argc, &argv);

  g_test_add ("/refs/connection", Fixture, NULL, setup_connection,
      test_connection, teardown);
  g_test_add ("/refs/message", Fixture, NULL, setup,
      test_message, teardown);
  g_test_add ("/refs/pending-call", Fixture, NULL, setup_connection,
      test_pending_call, teardown);
  g_test_add ("/refs/server", Fixture, NULL, setup,
      test_server, teardown);

  return g_test_run ();
}
gint
main (gint argc,
      gchar **argv)
{
#if !GLIB_CHECK_VERSION (2, 35, 1)
	g_type_init ();
#endif
	g_test_init (&argc, &argv, NULL);

	g_test_add (
		"/ECalClient/GetRevisionView/Sync", ETestServerFixture, &cal_closure,
		e_test_server_utils_setup, test_get_revision_view_sync, e_test_server_utils_teardown);
	g_test_add (
		"/ECalClient/GetRevisionView/Async", ETestServerFixture, &cal_closure,
		e_test_server_utils_setup, test_get_revision_view_async, e_test_server_utils_teardown);

	return e_test_server_utils_run ();
}
gint
main (gint argc,
      gchar **argv)
{
#if !GLIB_CHECK_VERSION (2, 35, 1)
	g_type_init ();
#endif
	g_test_init (&argc, &argv, NULL);

	g_test_add (
		"/EBookClient/RemoveContact/Sync", ETestServerFixture, &book_closure,
		e_test_server_utils_setup, test_remove_contact_sync, e_test_server_utils_teardown);
	g_test_add (
		"/EBookClient/RemoveContact/Async", ETestServerFixture, &book_closure,
		e_test_server_utils_setup, test_remove_contact_async, e_test_server_utils_teardown);

	return e_test_server_utils_run ();
}
示例#26
0
int
main (int argc, char **argv)
{
#if !GLIB_CHECK_VERSION(2,35,0)
	g_type_init ();
#endif
	egg_libgcrypt_initialize();

	g_test_init (&argc, &argv, NULL);

	g_test_add ("/gkm/data-asn1/integers", Test, NULL, setup, test_asn1_integers, teardown);
	g_test_add ("/gkm/data-asn1/string_mpi", Test, NULL, setup, test_asn1_string_mpi, teardown);
	g_test_add ("/gkm/data-asn1/bit_string", Test, NULL, setup, test_asn1_bit_string, teardown);
	g_test_add ("/gkm/data-asn1/string", Test, NULL, setup, test_asn1_string, teardown);
	g_test_add ("/gkm/data-asn1/oid", Test, NULL, setup, test_asn1_oid, teardown);

	return g_test_run ();
}
示例#27
0
int
main (int argc, char **argv)
{
	gchar *current_dir;
	gint result;
	gint i;

	/* Warning warning!!! We need to impose a proper LC_COLLATE here, so
	 * that the expected order in the test results is always the same! */
	setlocale (LC_COLLATE, "en_US.utf8");

	current_dir = g_get_current_dir ();
	tests_data_dir = g_build_path (G_DIR_SEPARATOR_S, current_dir, "test-data", NULL);
	g_free (current_dir);

	g_test_init (&argc, &argv, NULL);

	/* add test cases */
	g_test_add ("/libtracker-data/ontology-init", TestInfo, GINT_TO_POINTER(0), setup_all_others, test_ontology_init, teardown);

	for (i = 0; nie_tests[i].test_name; i++) {
		gchar *testpath;

		testpath = g_strconcat ("/libtracker-data/nie/", nie_tests[i].test_name, NULL);
		g_test_add (testpath, TestInfo, GINT_TO_POINTER(i), setup_nie, test_query, teardown);
		g_free (testpath);
	}

	for (i = 0; nmo_tests[i].test_name; i++) {
		gchar *testpath;

		testpath = g_strconcat ("/libtracker-data/nmo/", nmo_tests[i].test_name, NULL);
		g_test_add (testpath, TestInfo, GINT_TO_POINTER(i), setup_nmo, test_query, teardown);
		g_free (testpath);
	}

	/* run tests */
	result = g_test_run ();

	g_remove (tests_data_dir);
	g_free (tests_data_dir);

	return result;
}
示例#28
0
int
main(int argc, char *argv[])
{
	g_test_init(&argc, &argv, NULL);
#if !GLIB_CHECK_VERSION(2, 36, 0)
	g_type_init();
#endif
	g_test_add(CLASS"/001", Fixture, NULL, setup, test_001, teardown);
	return g_test_run();
}
gint
main (gint argc,
      gchar **argv)
{
#if !GLIB_CHECK_VERSION (2, 35, 1)
	g_type_init ();
#endif
	g_test_init (&argc, &argv, NULL);
	g_test_bug_base ("http://bugzilla.gnome.org/");

	g_test_add (
		"/EBookClient/UidOnlyView/Sync/AllData",
		ETestServerFixture,
		&book_closure_all_data,
		e_test_server_utils_setup,
		test_get_view_sync,
		e_test_server_utils_teardown);
	g_test_add (
		"/EBookClient/UidOnlyView/Sync/UidsOnly",
		ETestServerFixture,
		&book_closure_uids_only,
		e_test_server_utils_setup,
		test_get_view_sync,
		e_test_server_utils_teardown);

	g_test_add (
		"/EBookClient/UidOnlyView/Async/AllData",
		ETestServerFixture,
		&book_closure_all_data,
		e_test_server_utils_setup,
		test_get_view_async,
		e_test_server_utils_teardown);
	g_test_add (
		"/EBookClient/UidOnlyView/Async/UidsOnly",
		ETestServerFixture,
		&book_closure_uids_only,
		e_test_server_utils_setup,
		test_get_view_async,
		e_test_server_utils_teardown);

	return e_test_server_utils_run ();
}
示例#30
0
int main(int argc, char** argv)
{
    gtk_test_init(&argc, &argv, NULL);

    g_test_bug_base("https://bugs.webkit.org/");

    g_test_add("/webkit/domdomview/signals",
               DomDomviewFixture, HTML_DOCUMENT,
               dom_domview_fixture_setup,
               test_dom_domview_signals,
               dom_domview_fixture_teardown);

    g_test_add("/webkit/domdomview/dispatch_event",
               DomDomviewFixture, HTML_DOCUMENT,
               dom_domview_fixture_setup,
               test_dom_domview_dispatch_event,
               dom_domview_fixture_teardown);

    return g_test_run();
}