Debian Codegraph @

testsuite/gtk/calendar.c

raw symbols SCIP
1 #cxx . . $ `<file>/testsuite/gtk/calendar.c`/include <glib-object.h>
2 #include <glib.h>
3 #include <gtk/gtk.h>cxx . . $ `<file>/gtk/gtk.h`/
4
5 static void
6 test_calendar_set_get_propertiescxx . . $ test_calendar_set_get_properties(49f6e7a06ebc5aa8). (void)
7 {
8 GtkWidgetcxx . . $ GtkWidget# *calendar;
9 GDateTimecxx . . $ GDateTime# *date_in;
10 GDateTimecxx . . $ GDateTime# *date_out;
11
12 calendar = gtk_calendar_newcxx . . $ gtk_calendar_new(2369ce5e9f2c7dfd). ();
13 date_in = g_date_time_new_from_iso8601cxx . . $ g_date_time_new_from_iso8601(4bfbcc20d92a41e9). ("1970-01-01T00:00:00Z", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
14 g_object_setcxx . . $ g_object_set(1ac911bdc4e9a14d). (calendar, "date", date_in, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
15 g_object_getcxx . . $ g_object_get(1ac911bdc4e9a14d). (calendar, "date", &date_out, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
16 g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (g_date_time_equal (date_in, date_out));
17 g_date_time_unrefcxx . . $ g_date_time_unref(c543df92a162616f). (date_out);
18 g_date_time_unrefcxx . . $ g_date_time_unref(c543df92a162616f). (date_in);
19 }
20
21 static void
22 test_calendar_set_datecxx . . $ test_calendar_set_date(49f6e7a06ebc5aa8). (void)
23 {
24 GtkWidgetcxx . . $ GtkWidget# *calendar;
25 GDateTimecxx . . $ GDateTime# *date_in;
26 GDateTimecxx . . $ GDateTime# *date_out;
27 calendar = gtk_calendar_newcxx . . $ gtk_calendar_new(2369ce5e9f2c7dfd). ();
28 date_in = g_date_time_new_from_iso8601cxx . . $ g_date_time_new_from_iso8601(4bfbcc20d92a41e9). ("2110-11-03T20:20:05Z", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
29 gtk_calendar_set_datecxx . . $ gtk_calendar_set_date(c458f8571cf2cf8d). (GTK_CALENDARcxx . . $ `gtk/gtkcalendar.h:41:9`! (calendar), date_in);
30 g_object_getcxx . . $ g_object_get(1ac911bdc4e9a14d). (calendar, "date", &date_out, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
31 g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (g_date_time_equal (date_in, date_out));
32 g_date_time_unrefcxx . . $ g_date_time_unref(c543df92a162616f). (date_out);
33 g_date_time_unrefcxx . . $ g_date_time_unref(c543df92a162616f). (date_in);
34 }
35
36 static void
37 test_calendar_get_datecxx . . $ test_calendar_get_date(49f6e7a06ebc5aa8). (void)
38 {
39 GtkWidgetcxx . . $ GtkWidget# *calendar;
40 GDateTimecxx . . $ GDateTime# *date_in;
41 GDateTimecxx . . $ GDateTime# *date_out;
42 calendar = gtk_calendar_newcxx . . $ gtk_calendar_new(2369ce5e9f2c7dfd). ();
43 date_in = g_date_time_new_from_iso8601cxx . . $ g_date_time_new_from_iso8601(4bfbcc20d92a41e9). ("0010-11-25T10:20:30Z", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
44 g_object_setcxx . . $ g_object_set(1ac911bdc4e9a14d). (calendar, "date", date_in, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
45 date_out = gtk_calendar_get_datecxx . . $ gtk_calendar_get_date(9b3c28d90b4c99e0). (GTK_CALENDARcxx . . $ `gtk/gtkcalendar.h:41:9`! (calendar));
46 g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (g_date_time_equal (date_in, date_out));
47 g_date_time_unrefcxx . . $ g_date_time_unref(c543df92a162616f). (date_out);
48 g_date_time_unrefcxx . . $ g_date_time_unref(c543df92a162616f). (date_in);
49 }
50
51 static void
52 test_calendar_set_get_yearcxx . . $ test_calendar_set_get_year(49f6e7a06ebc5aa8). (void)
53 {
54 GtkWidgetcxx . . $ GtkWidget# *calendar;
55 int year;
56
57 calendar = gtk_calendar_newcxx . . $ gtk_calendar_new(2369ce5e9f2c7dfd). ();
58 gtk_calendar_set_daycxx . . $ gtk_calendar_set_day(523634e69b88d277). (GTK_CALENDARcxx . . $ `gtk/gtkcalendar.h:41:9`! (calendar), 10); /* avoid days that don't exist in all years */
59
60 gtk_calendar_set_yearcxx . . $ gtk_calendar_set_year(523634e69b88d277). (GTK_CALENDARcxx . . $ `gtk/gtkcalendar.h:41:9`! (calendar), 2024);
61 year = gtk_calendar_get_yearcxx . . $ gtk_calendar_get_year(cf756541b9c5e3d). (GTK_CALENDARcxx . . $ `gtk/gtkcalendar.h:41:9`! (calendar));
62 g_assert_cmpintcxx . . $ `<external>/15287032793271088244/gtestutils.h:53:9`! (year, ==, 2024);
63 }
64
65 static void
66 test_calendar_set_get_monthcxx . . $ test_calendar_set_get_month(49f6e7a06ebc5aa8). (void)
67 {
68 GtkWidgetcxx . . $ GtkWidget# *calendar;
69 int month;
70
71 calendar = gtk_calendar_newcxx . . $ gtk_calendar_new(2369ce5e9f2c7dfd). ();
72 gtk_calendar_set_daycxx . . $ gtk_calendar_set_day(523634e69b88d277). (GTK_CALENDARcxx . . $ `gtk/gtkcalendar.h:41:9`! (calendar), 10); /* avoid days that don't exist in all months */
73
74 gtk_calendar_set_monthcxx . . $ gtk_calendar_set_month(523634e69b88d277). (GTK_CALENDARcxx . . $ `gtk/gtkcalendar.h:41:9`! (calendar), 1); /* February */
75 month = gtk_calendar_get_monthcxx . . $ gtk_calendar_get_month(cf756541b9c5e3d). (GTK_CALENDARcxx . . $ `gtk/gtkcalendar.h:41:9`! (calendar));
76 g_assert_cmpintcxx . . $ `<external>/15287032793271088244/gtestutils.h:53:9`! (month, ==, 1);
77 }
78
79 static void
80 test_calendar_set_get_daycxx . . $ test_calendar_set_get_day(49f6e7a06ebc5aa8). (void)
81 {
82 GtkWidgetcxx . . $ GtkWidget# *calendar;
83 int day;
84
85 calendar = gtk_calendar_newcxx . . $ gtk_calendar_new(2369ce5e9f2c7dfd). ();
86 gtk_calendar_set_daycxx . . $ gtk_calendar_set_day(523634e69b88d277). (GTK_CALENDARcxx . . $ `gtk/gtkcalendar.h:41:9`! (calendar), 10);
87
88 gtk_calendar_set_daycxx . . $ gtk_calendar_set_day(523634e69b88d277). (GTK_CALENDARcxx . . $ `gtk/gtkcalendar.h:41:9`! (calendar), 11);
89 day = gtk_calendar_get_daycxx . . $ gtk_calendar_get_day(cf756541b9c5e3d). (GTK_CALENDARcxx . . $ `gtk/gtkcalendar.h:41:9`! (calendar));
90 g_assert_cmpintcxx . . $ `<external>/15287032793271088244/gtestutils.h:53:9`! (day, ==, 11);
91 }
92
93 int
94 maincxx . . $ main(afcd3168fc1188a4). (int argc, char *argv[])
95 {
96 gtk_initcxx . . $ gtk_init(49f6e7a06ebc5aa8). ();
97 (g_test_initcxx . . $ g_test_init(b91bcc5cc1349d78).) (&argc, &argv, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
98
99 g_test_add_funccxx . . $ g_test_add_func(18fee6cbb4bb18a4). ("/calendar/set_get_properties", test_calendar_set_get_propertiescxx . . $ test_calendar_set_get_properties(49f6e7a06ebc5aa8).);
100 g_test_add_funccxx . . $ g_test_add_func(18fee6cbb4bb18a4). ("/calendar/set_date", test_calendar_set_datecxx . . $ test_calendar_set_date(49f6e7a06ebc5aa8).);
101 g_test_add_funccxx . . $ g_test_add_func(18fee6cbb4bb18a4). ("/calendar/get_date", test_calendar_get_datecxx . . $ test_calendar_get_date(49f6e7a06ebc5aa8).);
102 g_test_add_funccxx . . $ g_test_add_func(18fee6cbb4bb18a4). ("/calendar/set_get_day", test_calendar_set_get_daycxx . . $ test_calendar_set_get_day(49f6e7a06ebc5aa8).);
103 g_test_add_funccxx . . $ g_test_add_func(18fee6cbb4bb18a4). ("/calendar/set_get_month", test_calendar_set_get_monthcxx . . $ test_calendar_set_get_month(49f6e7a06ebc5aa8).);
104 g_test_add_funccxx . . $ g_test_add_func(18fee6cbb4bb18a4). ("/calendar/set_get_year", test_calendar_set_get_yearcxx . . $ test_calendar_set_get_year(49f6e7a06ebc5aa8).);
105
106 return g_test_runcxx . . $ g_test_run(b126dc7c1de90089). ();
107 }