tests/marker.c
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #undef G_DISABLE_ASSERT | ||
| 2 | |||
| 3 | #include <gtk/gtk.h> | ||
| 4 | #include <shumate/shumate.h> | ||
| 5 | |||
| 6 | static void | ||
| 7 | 1 | test_marker_child (void) | |
| 8 | { | ||
| 9 | 1 | ShumateMarker *marker; | |
| 10 | 1 | GtkWidget *button; | |
| 11 | |||
| 12 | 1 | marker = shumate_marker_new (); | |
| 13 |
1/2✗ Branch 4 → 5 not taken.
✓ Branch 4 → 6 taken 1 time.
|
1 | g_assert_null (gtk_widget_get_first_child (GTK_WIDGET (marker))); |
| 14 | |||
| 15 | 1 | button = gtk_button_new (); | |
| 16 | 1 | shumate_marker_set_child (marker, button); | |
| 17 |
1/2✗ Branch 9 → 10 not taken.
✓ Branch 9 → 11 taken 1 time.
|
1 | g_assert_true (gtk_widget_get_first_child (GTK_WIDGET (marker)) == button); |
| 18 | |||
| 19 | 1 | shumate_marker_set_child (marker, NULL); | |
| 20 |
1/2✗ Branch 13 → 14 not taken.
✓ Branch 13 → 15 taken 1 time.
|
1 | g_assert_null (gtk_widget_get_first_child (GTK_WIDGET (marker))); |
| 21 | 1 | } | |
| 22 | |||
| 23 | int | ||
| 24 | 1 | main (int argc, char *argv[]) | |
| 25 | { | ||
| 26 | 1 | g_test_init (&argc, &argv, NULL); | |
| 27 | 1 | gtk_init (); | |
| 28 | |||
| 29 | 1 | g_test_add_func ("/marker/child", test_marker_child); | |
| 30 | |||
| 31 | 1 | return g_test_run (); | |
| 32 | } | ||
| 33 |