X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=tests%2Fgobject%2Fperformance.c;h=fdc51da28b360214a30b89a9597a2bce09d629f2;hb=8bb6a4aec5dbc7535244a0fa2b96b728eebe75cc;hp=d41955ffa683cf6eaac4e5c645fecd7a4aaa74cc;hpb=4b72bbf9b18a698555bb2aa914b9ab5fd0a4e5f3;p=platform%2Fupstream%2Fglib.git diff --git a/tests/gobject/performance.c b/tests/gobject/performance.c index d41955f..fdc51da 100644 --- a/tests/gobject/performance.c +++ b/tests/gobject/performance.c @@ -275,6 +275,7 @@ enum { COMPLEX_SIGNAL_EMPTY, COMPLEX_SIGNAL_GENERIC, COMPLEX_SIGNAL_GENERIC_EMPTY, + COMPLEX_SIGNAL_ARGS, COMPLEX_LAST_SIGNAL }; @@ -381,6 +382,15 @@ complex_object_class_init (ComplexObjectClass *class) NULL, G_TYPE_NONE, 0); + complex_signals[COMPLEX_SIGNAL_ARGS] = + g_signal_new ("signal-args", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (ComplexObjectClass, signal), + NULL, NULL, + g_cclosure_marshal_VOID__UINT_POINTER, + G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_POINTER); + g_object_class_install_property (object_class, PROP_VAL1, g_param_spec_int ("val1", @@ -622,6 +632,18 @@ test_emission_run (PerformanceTest *test, g_signal_emit (object, data->signal_id, 0); } +static void +test_emission_run_args (PerformanceTest *test, + gpointer _data) +{ + struct EmissionTest *data = _data; + GObject *object = data->object; + int i; + + for (i = 0; i < data->n_checks; i++) + g_signal_emit (object, data->signal_id, 0, 0, NULL); +} + /************************************************************* * Test signal unhandled emissions performance *************************************************************/ @@ -703,6 +725,9 @@ test_emission_handled_setup (PerformanceTest *test) g_signal_connect (data->object, "signal-generic-empty", G_CALLBACK (test_emission_handled_handler), NULL); + g_signal_connect (data->object, "signal-args", + G_CALLBACK (test_emission_handled_handler), + NULL); return data; } @@ -820,6 +845,16 @@ static PerformanceTest tests[] = { test_emission_unhandled_print_result }, { + "emit-unhandled-args", + GINT_TO_POINTER (COMPLEX_SIGNAL_ARGS), + test_emission_unhandled_setup, + test_emission_unhandled_init, + test_emission_run_args, + test_emission_unhandled_finish, + test_emission_unhandled_teardown, + test_emission_unhandled_print_result + }, + { "emit-handled", GINT_TO_POINTER (COMPLEX_SIGNAL), test_emission_handled_setup, @@ -858,6 +893,16 @@ static PerformanceTest tests[] = { test_emission_handled_finish, test_emission_handled_teardown, test_emission_handled_print_result + }, + { + "emit-handled-args", + GINT_TO_POINTER (COMPLEX_SIGNAL_ARGS), + test_emission_handled_setup, + test_emission_handled_init, + test_emission_run_args, + test_emission_handled_finish, + test_emission_handled_teardown, + test_emission_handled_print_result } };