| 1 | #cxx . . $ `<file>/testsuite/gdk/contentserializer.c`/include <stdlib.h> |
| 2 | |
| 3 | #include <gtk/gtk.h>cxx . . $ `<file>/gtk/gtk.h`/ |
| 4 | |
| 5 | typedef gbooleancxx . . $ gboolean# (* ValueCompareFunccxx . . $ ValueCompareFunc#) (GValuecxx . . $ GValue# *v1, GValuecxx . . $ GValue# *v2); |
| 6 | |
| 7 | typedef structcxx . . $ $anonymous_type_d1a333ca79f48ab8_0# { |
| 8 | GOutputStreamcxx . . $ GOutputStream# *ostreamcxx . . $ $anonymous_type_d1a333ca79f48ab8_0#ostream.; |
| 9 | GInputStreamcxx . . $ GInputStream# *istreamcxx . . $ $anonymous_type_d1a333ca79f48ab8_0#istream.; |
| 10 | const char *mime_typecxx . . $ $anonymous_type_d1a333ca79f48ab8_0#mime_type.; |
| 11 | GValuecxx . . $ GValue# valuecxx . . $ $anonymous_type_d1a333ca79f48ab8_0#value.; |
| 12 | ValueCompareFunccxx . . $ ValueCompareFunc# comparecxx . . $ $anonymous_type_d1a333ca79f48ab8_0#compare.; |
| 13 | gbooleancxx . . $ gboolean# donecxx . . $ $anonymous_type_d1a333ca79f48ab8_0#done.; |
| 14 | } TestDatacxx . . $ TestData#; |
| 15 | |
| 16 | static gbooleancxx . . $ gboolean# |
| 17 | compare_string_valuescxx . . $ compare_string_values(15a6341dcd24321d). (GValuecxx . . $ GValue# *v1, GValuecxx . . $ GValue# *v2) |
| 18 | { |
| 19 | return G_VALUE_TYPEcxx . . $ `<external>/17218264759549183453/gvalue.h:66:9`! (v1) == G_TYPE_STRINGcxx . . $ `<external>/9567554376676449156/gtype.h:165:9`! && |
| 20 | G_VALUE_TYPEcxx . . $ `<external>/17218264759549183453/gvalue.h:66:9`! (v2) == G_TYPE_STRINGcxx . . $ `<external>/9567554376676449156/gtype.h:165:9`! && |
| 21 | strcmpcxx . . $ strcmp(5ae29d726ae57f88). (g_value_get_stringcxx . . $ g_value_get_string(cc0a2be2b8f7bdc8). (v1), g_value_get_stringcxx . . $ g_value_get_string(cc0a2be2b8f7bdc8). (v2)) == 0; |
| 22 | } |
| 23 | |
| 24 | static gbooleancxx . . $ gboolean# |
| 25 | compare_rgba_valuescxx . . $ compare_rgba_values(15a6341dcd24321d). (GValuecxx . . $ GValue# *v1, GValuecxx . . $ GValue# *v2) |
| 26 | { |
| 27 | return G_VALUE_TYPEcxx . . $ `<external>/17218264759549183453/gvalue.h:66:9`! (v1) == GDK_TYPE_RGBAcxx . . $ `gdk/gdkrgba.h:43:9`! && |
| 28 | G_VALUE_TYPEcxx . . $ `<external>/17218264759549183453/gvalue.h:66:9`! (v2) == GDK_TYPE_RGBAcxx . . $ `gdk/gdkrgba.h:43:9`! && |
| 29 | gdk_rgba_equalcxx . . $ gdk_rgba_equal(9148c8c3ff42c9d8). ((GdkRGBAcxx . . $ GdkRGBA# *)g_value_get_boxedcxx . . $ g_value_get_boxed(e12dff36056c2cce). (v1), |
| 30 | (GdkRGBAcxx . . $ GdkRGBA# *)g_value_get_boxedcxx . . $ g_value_get_boxed(e12dff36056c2cce). (v2)); |
| 31 | } |
| 32 | |
| 33 | static gbooleancxx . . $ gboolean# |
| 34 | textures_equalcxx . . $ textures_equal(896ccc81c7885024). (GdkTexturecxx . . $ GdkTexture# *t1, GdkTexturecxx . . $ GdkTexture# *t2) |
| 35 | { |
| 36 | gucharcxx . . $ guchar# *d1, *d2; |
| 37 | int width, height; |
| 38 | gbooleancxx . . $ gboolean# ret; |
| 39 | |
| 40 | width = gdk_texture_get_widthcxx . . $ gdk_texture_get_width(84a21f334421d5dd). (t1); |
| 41 | height = gdk_texture_get_heightcxx . . $ gdk_texture_get_height(84a21f334421d5dd). (t1); |
| 42 | |
| 43 | if (width != gdk_texture_get_widthcxx . . $ gdk_texture_get_width(84a21f334421d5dd). (t2)) |
| 44 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 45 | if (height != gdk_texture_get_heightcxx . . $ gdk_texture_get_height(84a21f334421d5dd). (t2)) |
| 46 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 47 | |
| 48 | d1 = g_malloccxx . . $ g_malloc(bfcfa4d6b7f7ef64). (width * height * 4); |
| 49 | d2 = g_malloccxx . . $ g_malloc(bfcfa4d6b7f7ef64). (width * height * 4); |
| 50 | |
| 51 | gdk_texture_downloadcxx . . $ gdk_texture_download(81a0156881cae20a). (t1, d1, width * 4); |
| 52 | gdk_texture_downloadcxx . . $ gdk_texture_download(81a0156881cae20a). (t2, d2, width * 4); |
| 53 | |
| 54 | ret = memcmpcxx . . $ memcmp(36f949851efa3055). (d1, d2, width * height * 4) == 0; |
| 55 | |
| 56 | if (!ret) |
| 57 | { |
| 58 | gdk_texture_save_to_pngcxx . . $ gdk_texture_save_to_png(603d784a970d124a). (t1, "texture1.png"); |
| 59 | gdk_texture_save_to_pngcxx . . $ gdk_texture_save_to_png(603d784a970d124a). (t2, "texture2.png"); |
| 60 | } |
| 61 | g_freecxx . . $ g_free(5d22bdacc48458e8). (d1); |
| 62 | g_freecxx . . $ g_free(5d22bdacc48458e8). (d2); |
| 63 | |
| 64 | return ret; |
| 65 | } |
| 66 | |
| 67 | static gbooleancxx . . $ gboolean# |
| 68 | compare_texture_valuescxx . . $ compare_texture_values(15a6341dcd24321d). (GValuecxx . . $ GValue# *v1, GValuecxx . . $ GValue# *v2) |
| 69 | { |
| 70 | return G_VALUE_TYPEcxx . . $ `<external>/17218264759549183453/gvalue.h:66:9`! (v1) == GDK_TYPE_TEXTUREcxx . . $ `gdk/gdktexture.h:30:9`! && |
| 71 | G_VALUE_TYPEcxx . . $ `<external>/17218264759549183453/gvalue.h:66:9`! (v2) == GDK_TYPE_TEXTUREcxx . . $ `gdk/gdktexture.h:30:9`! && |
| 72 | textures_equalcxx . . $ textures_equal(896ccc81c7885024). ((GdkTexturecxx . . $ GdkTexture# *)g_value_get_objectcxx . . $ g_value_get_object(e12dff36056c2cce). (v1), |
| 73 | (GdkTexturecxx . . $ GdkTexture# *)g_value_get_objectcxx . . $ g_value_get_object(e12dff36056c2cce). (v2)); |
| 74 | } |
| 75 | |
| 76 | static gbooleancxx . . $ gboolean# |
| 77 | compare_file_valuescxx . . $ compare_file_values(15a6341dcd24321d). (GValuecxx . . $ GValue# *v1, GValuecxx . . $ GValue# *v2) |
| 78 | { |
| 79 | return G_VALUE_TYPEcxx . . $ `<external>/17218264759549183453/gvalue.h:66:9`! (v1) == G_TYPE_FILEcxx . . $ `<external>/13962853800498659056/gfile.h:34:9`! && |
| 80 | G_VALUE_TYPEcxx . . $ `<external>/17218264759549183453/gvalue.h:66:9`! (v2) == G_TYPE_FILEcxx . . $ `<external>/13962853800498659056/gfile.h:34:9`! && |
| 81 | g_file_equalcxx . . $ g_file_equal(248007fe659871da). ((GFilecxx . . $ GFile# *)g_value_get_objectcxx . . $ g_value_get_object(e12dff36056c2cce). (v1), |
| 82 | (GFilecxx . . $ GFile# *)g_value_get_objectcxx . . $ g_value_get_object(e12dff36056c2cce). (v2)); |
| 83 | } |
| 84 | |
| 85 | static gbooleancxx . . $ gboolean# |
| 86 | compare_file_list_valuescxx . . $ compare_file_list_values(15a6341dcd24321d). (GValuecxx . . $ GValue# *v1, GValuecxx . . $ GValue# *v2) |
| 87 | { |
| 88 | GSListcxx . . $ GSList# *s1, *s2, *l1, *l2; |
| 89 | |
| 90 | if (G_VALUE_TYPEcxx . . $ `<external>/17218264759549183453/gvalue.h:66:9`! (v1) != GDK_TYPE_FILE_LISTcxx . . $ `gdk/gdkcontentformats.h:113:9`! || |
| 91 | G_VALUE_TYPEcxx . . $ `<external>/17218264759549183453/gvalue.h:66:9`! (v2) != GDK_TYPE_FILE_LISTcxx . . $ `gdk/gdkcontentformats.h:113:9`!) |
| 92 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 93 | |
| 94 | s1 = g_value_get_boxedcxx . . $ g_value_get_boxed(e12dff36056c2cce). (v1); |
| 95 | s2 = g_value_get_boxedcxx . . $ g_value_get_boxed(e12dff36056c2cce). (v2); |
| 96 | |
| 97 | if (g_slist_lengthcxx . . $ g_slist_length(45e8ed29af795520). (s1) != g_slist_lengthcxx . . $ g_slist_length(45e8ed29af795520). (s2)) |
| 98 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 99 | |
| 100 | for (l1 = s1, l2 = s2; l1 != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; l1 = l1->nextcxx . . $ _GSList#next., l2 = l2->nextcxx . . $ _GSList#next.) |
| 101 | { |
| 102 | GFilecxx . . $ GFile# *f1 = l1->datacxx . . $ _GSList#data.; |
| 103 | GFilecxx . . $ GFile# *f2 = l2->datacxx . . $ _GSList#data.; |
| 104 | if (!g_file_equalcxx . . $ g_file_equal(248007fe659871da). (f1, f2)) |
| 105 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 106 | } |
| 107 | |
| 108 | return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 109 | } |
| 110 | |
| 111 | static void |
| 112 | deserialize_donecxx . . $ deserialize_done(aa1d200d824d915d). (GObjectcxx . . $ GObject# *source, |
| 113 | GAsyncResultcxx . . $ GAsyncResult# *result, |
| 114 | gpointercxx . . $ gpointer# user_data) |
| 115 | { |
| 116 | GErrorcxx . . $ GError# *error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 117 | gbooleancxx . . $ gboolean# res; |
| 118 | TestDatacxx . . $ TestData# *data = user_data; |
| 119 | GValuecxx . . $ GValue# value = G_VALUE_INITcxx . . $ `<external>/17218264759549183453/gvalue.h:250:9`!; |
| 120 | |
| 121 | g_value_initcxx . . $ g_value_init(afc049a76445919c). (&value, G_VALUE_TYPEcxx . . $ `<external>/17218264759549183453/gvalue.h:66:9`! (&data->value)); |
| 122 | |
| 123 | res = gdk_content_deserialize_finishcxx . . $ gdk_content_deserialize_finish(616fa263243dae61). (result, &value, &error); |
| 124 | g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (res); |
| 125 | g_assert_no_errorcxx . . $ `<external>/15287032793271088244/gtestutils.h:217:9`! (error); |
| 126 | |
| 127 | g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (data->compare (&data->value, &value)); |
| 128 | |
| 129 | g_value_unsetcxx . . $ g_value_unset(15c06aff79890746). (&value); |
| 130 | |
| 131 | data->donecxx . . $ $anonymous_type_d1a333ca79f48ab8_0#done. = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 132 | g_main_context_wakeupcxx . . $ g_main_context_wakeup(2c4f9bc69c34eb5d). (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 133 | } |
| 134 | |
| 135 | static void |
| 136 | serialize_donecxx . . $ serialize_done(aa1d200d824d915d). (GObjectcxx . . $ GObject# *source, |
| 137 | GAsyncResultcxx . . $ GAsyncResult# *result, |
| 138 | gpointercxx . . $ gpointer# user_data) |
| 139 | { |
| 140 | GErrorcxx . . $ GError# *error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 141 | gbooleancxx . . $ gboolean# res; |
| 142 | TestDatacxx . . $ TestData# *data = user_data; |
| 143 | gpointercxx . . $ gpointer# serialized_data; |
| 144 | gsizecxx . . $ gsize# serialized_len; |
| 145 | |
| 146 | res = gdk_content_serialize_finishcxx . . $ gdk_content_serialize_finish(aff244c0ed8a2285). (result, &error); |
| 147 | g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (res); |
| 148 | g_assert_no_errorcxx . . $ `<external>/15287032793271088244/gtestutils.h:217:9`! (error); |
| 149 | |
| 150 | serialized_data = g_memory_output_stream_get_datacxx . . $ g_memory_output_stream_get_data(de1ecf9fe1ad5287). (G_MEMORY_OUTPUT_STREAMcxx . . $ `<external>/16534567971107647114/gmemoryoutputstream.h:35:9`! (data->ostream)); |
| 151 | serialized_len = g_memory_output_stream_get_data_sizecxx . . $ g_memory_output_stream_get_data_size(af105c47a2a5e307). (G_MEMORY_OUTPUT_STREAMcxx . . $ `<external>/16534567971107647114/gmemoryoutputstream.h:35:9`! (data->ostream)); |
| 152 | data->istreamcxx . . $ $anonymous_type_d1a333ca79f48ab8_0#istream. = g_memory_input_stream_new_from_datacxx . . $ g_memory_input_stream_new_from_data(c6a471220278f7a2). (serialized_data, serialized_len, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 153 | |
| 154 | gdk_content_deserialize_asynccxx . . $ gdk_content_deserialize_async(dce82195aa0d29a4). (data->istreamcxx . . $ $anonymous_type_d1a333ca79f48ab8_0#istream., |
| 155 | data->mime_typecxx . . $ $anonymous_type_d1a333ca79f48ab8_0#mime_type., |
| 156 | G_VALUE_TYPEcxx . . $ `<external>/17218264759549183453/gvalue.h:66:9`! (&data->value), |
| 157 | G_PRIORITY_DEFAULTcxx . . $ `<external>/1856471541377536744/gmain.h:434:9`!, |
| 158 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 159 | deserialize_donecxx . . $ deserialize_done(aa1d200d824d915d)., |
| 160 | data); |
| 161 | } |
| 162 | |
| 163 | static void |
| 164 | test_content_roundtripcxx . . $ test_content_roundtrip(60204a4fd097ac9e). (const GValuecxx . . $ GValue# *value, |
| 165 | const char *mime_type, |
| 166 | ValueCompareFunccxx . . $ ValueCompareFunc# compare) |
| 167 | { |
| 168 | TestDatacxx . . $ TestData# data = { 0, }; |
| 169 | |
| 170 | data.ostreamcxx . . $ $anonymous_type_d1a333ca79f48ab8_0#ostream. = g_memory_output_stream_new_resizablecxx . . $ g_memory_output_stream_new_resizable(937a4dd9141c33c9). (); |
| 171 | data.mime_typecxx . . $ $anonymous_type_d1a333ca79f48ab8_0#mime_type. = mime_type; |
| 172 | g_value_initcxx . . $ g_value_init(afc049a76445919c). (&data.valuecxx . . $ $anonymous_type_d1a333ca79f48ab8_0#value., G_VALUE_TYPEcxx . . $ `<external>/17218264759549183453/gvalue.h:66:9`! (value)); |
| 173 | g_value_copycxx . . $ g_value_copy(76788ea28990d685). (value, &data.valuecxx . . $ $anonymous_type_d1a333ca79f48ab8_0#value.); |
| 174 | data.comparecxx . . $ $anonymous_type_d1a333ca79f48ab8_0#compare. = compare; |
| 175 | data.donecxx . . $ $anonymous_type_d1a333ca79f48ab8_0#done. = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 176 | |
| 177 | gdk_content_serialize_asynccxx . . $ gdk_content_serialize_async(de4533add184f2ee). (data.ostreamcxx . . $ $anonymous_type_d1a333ca79f48ab8_0#ostream., |
| 178 | data.mime_typecxx . . $ $anonymous_type_d1a333ca79f48ab8_0#mime_type., |
| 179 | &data.valuecxx . . $ $anonymous_type_d1a333ca79f48ab8_0#value., |
| 180 | G_PRIORITY_DEFAULTcxx . . $ `<external>/1856471541377536744/gmain.h:434:9`!, |
| 181 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 182 | serialize_donecxx . . $ serialize_done(aa1d200d824d915d)., |
| 183 | &data); |
| 184 | |
| 185 | while (!data.donecxx . . $ $anonymous_type_d1a333ca79f48ab8_0#done.) |
| 186 | g_main_context_iterationcxx . . $ g_main_context_iteration(53f508c65b8b33ab). (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!); |
| 187 | |
| 188 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (data.ostreamcxx . . $ $anonymous_type_d1a333ca79f48ab8_0#ostream.); |
| 189 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (data.istreamcxx . . $ $anonymous_type_d1a333ca79f48ab8_0#istream.); |
| 190 | g_value_unsetcxx . . $ g_value_unset(15c06aff79890746). (&data.valuecxx . . $ $anonymous_type_d1a333ca79f48ab8_0#value.); |
| 191 | } |
| 192 | |
| 193 | static void |
| 194 | test_content_text_plain_utf8cxx . . $ test_content_text_plain_utf8(49f6e7a06ebc5aa8). (void) |
| 195 | { |
| 196 | GValuecxx . . $ GValue# value = G_VALUE_INITcxx . . $ `<external>/17218264759549183453/gvalue.h:250:9`!; |
| 197 | |
| 198 | g_value_initcxx . . $ g_value_init(afc049a76445919c). (&value, G_TYPE_STRINGcxx . . $ `<external>/9567554376676449156/gtype.h:165:9`!); |
| 199 | g_value_set_stringcxx . . $ g_value_set_string(65b9ea7708b82b9b). (&value, "ABCDEF12345"); |
| 200 | test_content_roundtripcxx . . $ test_content_roundtrip(60204a4fd097ac9e). (&value, "text/plain;charset=utf-8", compare_string_valuescxx . . $ compare_string_values(15a6341dcd24321d).); |
| 201 | g_value_unsetcxx . . $ g_value_unset(15c06aff79890746). (&value); |
| 202 | } |
| 203 | |
| 204 | static void |
| 205 | test_content_text_plaincxx . . $ test_content_text_plain(49f6e7a06ebc5aa8). (void) |
| 206 | { |
| 207 | GValuecxx . . $ GValue# value = G_VALUE_INITcxx . . $ `<external>/17218264759549183453/gvalue.h:250:9`!; |
| 208 | |
| 209 | g_value_initcxx . . $ g_value_init(afc049a76445919c). (&value, G_TYPE_STRINGcxx . . $ `<external>/9567554376676449156/gtype.h:165:9`!); |
| 210 | g_value_set_stringcxx . . $ g_value_set_string(65b9ea7708b82b9b). (&value, "ABCDEF12345"); |
| 211 | test_content_roundtripcxx . . $ test_content_roundtrip(60204a4fd097ac9e). (&value, "text/plain", compare_string_valuescxx . . $ compare_string_values(15a6341dcd24321d).); |
| 212 | g_value_unsetcxx . . $ g_value_unset(15c06aff79890746). (&value); |
| 213 | } |
| 214 | |
| 215 | static void |
| 216 | test_content_colorcxx . . $ test_content_color(49f6e7a06ebc5aa8). (void) |
| 217 | { |
| 218 | GdkRGBAcxx . . $ GdkRGBA# color; |
| 219 | GValuecxx . . $ GValue# value = G_VALUE_INITcxx . . $ `<external>/17218264759549183453/gvalue.h:250:9`!; |
| 220 | |
| 221 | gdk_rgba_parsecxx . . $ gdk_rgba_parse(482ef11efa4439a6). (&color, "magenta"); |
| 222 | g_value_initcxx . . $ g_value_init(afc049a76445919c). (&value, GDK_TYPE_RGBAcxx . . $ `gdk/gdkrgba.h:43:9`!); |
| 223 | g_value_set_boxedcxx . . $ g_value_set_boxed(806599f585dac18b). (&value, &color); |
| 224 | test_content_roundtripcxx . . $ test_content_roundtrip(60204a4fd097ac9e). (&value, "application/x-color", compare_rgba_valuescxx . . $ compare_rgba_values(15a6341dcd24321d).); |
| 225 | g_value_unsetcxx . . $ g_value_unset(15c06aff79890746). (&value); |
| 226 | } |
| 227 | |
| 228 | static void |
| 229 | test_content_texturecxx . . $ test_content_texture(e4289f82fef2c2f9). (gconstpointercxx . . $ gconstpointer# data) |
| 230 | { |
| 231 | const char *mimetype = data; |
| 232 | GValuecxx . . $ GValue# value = G_VALUE_INITcxx . . $ `<external>/17218264759549183453/gvalue.h:250:9`!; |
| 233 | char *path; |
| 234 | GFilecxx . . $ GFile# *file; |
| 235 | GdkTexturecxx . . $ GdkTexture# *texture; |
| 236 | GErrorcxx . . $ GError# *error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 237 | |
| 238 | path = g_test_build_filenamecxx . . $ g_test_build_filename(522294ea697604e8). (G_TEST_DISTcxx . . $ G_TEST_DIST., "image-data", "image.png", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 239 | file = g_file_new_for_pathcxx . . $ g_file_new_for_path(ba1fd5950b7d7bd5). (path); |
| 240 | texture = gdk_texture_new_from_filecxx . . $ gdk_texture_new_from_file(75d6ad717551ba72). (file, &error); |
| 241 | g_assert_no_errorcxx . . $ `<external>/15287032793271088244/gtestutils.h:217:9`! (error); |
| 242 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (file); |
| 243 | g_freecxx . . $ g_free(5d22bdacc48458e8). (path); |
| 244 | |
| 245 | g_value_initcxx . . $ g_value_init(afc049a76445919c). (&value, GDK_TYPE_TEXTUREcxx . . $ `gdk/gdktexture.h:30:9`!); |
| 246 | g_value_set_objectcxx . . $ g_value_set_object(e945b84c1e9702f). (&value, texture); |
| 247 | test_content_roundtripcxx . . $ test_content_roundtrip(60204a4fd097ac9e). (&value, mimetype, compare_texture_valuescxx . . $ compare_texture_values(15a6341dcd24321d).); |
| 248 | g_value_unsetcxx . . $ g_value_unset(15c06aff79890746). (&value); |
| 249 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (texture); |
| 250 | } |
| 251 | |
| 252 | static void |
| 253 | test_content_filecxx . . $ test_content_file(49f6e7a06ebc5aa8). (void) |
| 254 | { |
| 255 | GFilecxx . . $ GFile# *file; |
| 256 | GValuecxx . . $ GValue# value = G_VALUE_INITcxx . . $ `<external>/17218264759549183453/gvalue.h:250:9`!; |
| 257 | |
| 258 | file = g_file_new_for_pathcxx . . $ g_file_new_for_path(ba1fd5950b7d7bd5). ("/etc/passwd"); |
| 259 | g_value_initcxx . . $ g_value_init(afc049a76445919c). (&value, G_TYPE_FILEcxx . . $ `<external>/13962853800498659056/gfile.h:34:9`!); |
| 260 | g_value_set_objectcxx . . $ g_value_set_object(e945b84c1e9702f). (&value, file); |
| 261 | test_content_roundtripcxx . . $ test_content_roundtrip(60204a4fd097ac9e). (&value, "text/uri-list", compare_file_valuescxx . . $ compare_file_values(15a6341dcd24321d).); |
| 262 | g_value_unsetcxx . . $ g_value_unset(15c06aff79890746). (&value); |
| 263 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (file); |
| 264 | } |
| 265 | |
| 266 | static void |
| 267 | test_content_filescxx . . $ test_content_files(49f6e7a06ebc5aa8). (void) |
| 268 | { |
| 269 | GSListcxx . . $ GSList# *files; |
| 270 | GValuecxx . . $ GValue# value = G_VALUE_INITcxx . . $ `<external>/17218264759549183453/gvalue.h:250:9`!; |
| 271 | |
| 272 | files = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 273 | files = g_slist_appendcxx . . $ g_slist_append(6eb923d8c45a5456). (files, g_file_new_for_pathcxx . . $ g_file_new_for_path(ba1fd5950b7d7bd5). ("/etc/passwd")); |
| 274 | files = g_slist_appendcxx . . $ g_slist_append(6eb923d8c45a5456). (files, g_file_new_for_pathcxx . . $ g_file_new_for_path(ba1fd5950b7d7bd5). ("/boot/ostree")); |
| 275 | |
| 276 | g_value_initcxx . . $ g_value_init(afc049a76445919c). (&value, GDK_TYPE_FILE_LISTcxx . . $ `gdk/gdkcontentformats.h:113:9`!); |
| 277 | g_value_set_boxedcxx . . $ g_value_set_boxed(806599f585dac18b). (&value, files); |
| 278 | test_content_roundtripcxx . . $ test_content_roundtrip(60204a4fd097ac9e). (&value, "text/uri-list", compare_file_list_valuescxx . . $ compare_file_list_values(15a6341dcd24321d).); |
| 279 | g_value_unsetcxx . . $ g_value_unset(15c06aff79890746). (&value); |
| 280 | g_slist_free_fullcxx . . $ g_slist_free_full(5c74ad7c36eb6b1f). (files, g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8).); |
| 281 | } |
| 282 | |
| 283 | #define MY_TYPE_INT_LISTcxx . . $ `testsuite/gdk/contentserializer.c:283:9`! (my_int_list_get_type ()) |
| 284 | GTypecxx . . $ GType# my_int_list_get_typecxx . . $ my_int_list_get_type(f708dce9a8856c70). (void) G_GNUC_CONSTcxx . . $ `<external>/12741050725406041920/gmacros.h:640:9`!; |
| 285 | |
| 286 | typedef gpointercxx . . $ gpointer# MyIntListcxx . . $ MyIntList#; |
| 287 | |
| 288 | static gpointercxx . . $ gpointer# |
| 289 | my_int_list_copycxx . . $ my_int_list_copy(9f162e79bfc6c74). (gpointercxx . . $ gpointer# list) |
| 290 | { |
| 291 | int size; |
| 292 | gpointercxx . . $ gpointer# copy; |
| 293 | |
| 294 | size = *(int *)list; |
| 295 | copy = g_malloccxx . . $ g_malloc(bfcfa4d6b7f7ef64). ((size + 1) * sizeof (int)); |
| 296 | memcpycxx . . $ memcpy(cc817cb175f282d). (copy, list, (size + 1) * sizeof (int)); |
| 297 | |
| 298 | return copy; |
| 299 | } |
| 300 | |
| 301 | static void |
| 302 | my_int_list_freecxx . . $ my_int_list_free(5d22bdacc48458e8). (gpointercxx . . $ gpointer# list) |
| 303 | { |
| 304 | g_freecxx . . $ g_free(5d22bdacc48458e8). (list); |
| 305 | } |
| 306 | |
| 307 | G_DEFINE_BOXED_TYPEcxx . . $ `<external>/9567554376676449156/gtype.h:2440:9`! (MyIntList, my_int_list, my_int_list_copy, my_int_list_free) |
| 308 | |
| 309 | static void |
| 310 | int_list_serializer_finishcxx . . $ int_list_serializer_finish(aa1d200d824d915d). (GObjectcxx . . $ GObject# *source, |
| 311 | GAsyncResultcxx . . $ GAsyncResult# *result, |
| 312 | gpointercxx . . $ gpointer# serializer) |
| 313 | { |
| 314 | GOutputStreamcxx . . $ GOutputStream# *stream = G_OUTPUT_STREAMcxx . . $ `<external>/12960712863927311157/goutputstream.h:35:9`! (source); |
| 315 | GErrorcxx . . $ GError# *error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 316 | |
| 317 | if (!g_output_stream_write_all_finishcxx . . $ g_output_stream_write_all_finish(c05eaa1a255c2427). (stream, result, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, &error)) |
| 318 | gdk_content_serializer_return_errorcxx . . $ gdk_content_serializer_return_error(f551dbf6daee8cd6). (serializer, error); |
| 319 | else |
| 320 | gdk_content_serializer_return_successcxx . . $ gdk_content_serializer_return_success(9ebddb52e2aecd59). (serializer); |
| 321 | } |
| 322 | |
| 323 | static void |
| 324 | int_list_serializercxx . . $ int_list_serializer(9ebddb52e2aecd59). (GdkContentSerializercxx . . $ GdkContentSerializer# *serializer) |
| 325 | { |
| 326 | GStringcxx . . $ GString# *str; |
| 327 | const GValuecxx . . $ GValue# *value; |
| 328 | int *data; |
| 329 | |
| 330 | str = g_string_newcxx . . $ g_string_new(e8737c02110bb79b). (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 331 | value = gdk_content_serializer_get_valuecxx . . $ gdk_content_serializer_get_value(590542a31c789f1). (serializer); |
| 332 | |
| 333 | data = g_value_get_boxedcxx . . $ g_value_get_boxed(e12dff36056c2cce). (value); |
| 334 | for (int i = 0; i < data[0] + 1; i++) |
| 335 | { |
| 336 | if (i > 0) |
| 337 | g_string_append_ccxx . . $ `<external>/2906017559248664336/gstring.h:215:9`! (str, ' '); |
| 338 | g_string_append_printfcxx . . $ g_string_append_printf(eeccf837eb821d11). (str, "%d", data[i]); |
| 339 | } |
| 340 | |
| 341 | g_output_stream_write_all_asynccxx . . $ g_output_stream_write_all_async(50e9e3a461521cd4). (gdk_content_serializer_get_output_streamcxx . . $ gdk_content_serializer_get_output_stream(3ab0bc34e9433566). (serializer), |
| 342 | str->strcxx . . $ _GString#str., |
| 343 | str->lencxx . . $ _GString#len., |
| 344 | gdk_content_serializer_get_prioritycxx . . $ gdk_content_serializer_get_priority(7397e6e534b8eaab). (serializer), |
| 345 | gdk_content_serializer_get_cancellablecxx . . $ gdk_content_serializer_get_cancellable(1fa36edb619401c9). (serializer), |
| 346 | int_list_serializer_finishcxx . . $ int_list_serializer_finish(aa1d200d824d915d)., |
| 347 | serializer); |
| 348 | gdk_content_serializer_set_task_datacxx . . $ gdk_content_serializer_set_task_data(e0e3f4ef95ab24bc). (serializer, g_string_freecxx . . $ `<external>/2906017559248664336/gstring.h:73:9`! (str, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!), g_freecxx . . $ g_free(5d22bdacc48458e8).); |
| 349 | } |
| 350 | |
| 351 | static void |
| 352 | int_list_deserializer_finishcxx . . $ int_list_deserializer_finish(aa1d200d824d915d). (GObjectcxx . . $ GObject# *source, |
| 353 | GAsyncResultcxx . . $ GAsyncResult# *result, |
| 354 | gpointercxx . . $ gpointer# deserializer) |
| 355 | { |
| 356 | GOutputStreamcxx . . $ GOutputStream# *stream = G_OUTPUT_STREAMcxx . . $ `<external>/12960712863927311157/goutputstream.h:35:9`! (source); |
| 357 | GErrorcxx . . $ GError# *error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 358 | gssizecxx . . $ gssize# written; |
| 359 | GValuecxx . . $ GValue# *value; |
| 360 | char *str; |
| 361 | char **strv; |
| 362 | int size; |
| 363 | int *data; |
| 364 | |
| 365 | written = g_output_stream_splice_finishcxx . . $ g_output_stream_splice_finish(b971013a7a3f5e1). (stream, result, &error); |
| 366 | if (written < 0) |
| 367 | { |
| 368 | gdk_content_deserializer_return_errorcxx . . $ gdk_content_deserializer_return_error(81438258566819b8). (deserializer, error); |
| 369 | return; |
| 370 | } |
| 371 | |
| 372 | /* write terminating NULL */ |
| 373 | if (g_output_stream_writecxx . . $ g_output_stream_write(6a212f6d19c93115). (stream, "", 1, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, &error) < 0 || |
| 374 | !g_output_stream_closecxx . . $ g_output_stream_close(9a028ff89e05cae6). (stream, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, &error)) |
| 375 | { |
| 376 | gdk_content_deserializer_return_errorcxx . . $ gdk_content_deserializer_return_error(81438258566819b8). (deserializer, error); |
| 377 | return; |
| 378 | } |
| 379 | |
| 380 | str = g_memory_output_stream_steal_datacxx . . $ g_memory_output_stream_steal_data(de1ecf9fe1ad5287). (G_MEMORY_OUTPUT_STREAMcxx . . $ `<external>/16534567971107647114/gmemoryoutputstream.h:35:9`! (stream)); |
| 381 | strv = g_strsplitcxx . . $ g_strsplit(656a2b498280081). (str, " ", -1); |
| 382 | size = atoicxx . . $ atoi(5c4306d8553b3696). (strv[0]); |
| 383 | if (size + 1 != g_strv_lengthcxx . . $ g_strv_length(658e6f1ffe3b2f0c). (strv)) |
| 384 | { |
| 385 | g_set_error_literalcxx . . $ g_set_error_literal(af35e45b47ff535e). (&error, G_IO_ERRORcxx . . $ `<external>/13894955190784973534/gioerror.h:42:9`!, G_IO_ERROR_FAILEDcxx . . $ G_IO_ERROR_FAILED., "Int list corrupt"); |
| 386 | gdk_content_deserializer_return_errorcxx . . $ gdk_content_deserializer_return_error(81438258566819b8). (deserializer, error); |
| 387 | g_freecxx . . $ g_free(5d22bdacc48458e8). (str); |
| 388 | g_strfreevcxx . . $ g_strfreev(3ed91490e421178f). (strv); |
| 389 | return; |
| 390 | } |
| 391 | |
| 392 | data = g_malloccxx . . $ g_malloc(bfcfa4d6b7f7ef64). ((size + 1) * sizeof (int)); |
| 393 | for (int i = 0; i < size + 1; i++) |
| 394 | data[i] = atoicxx . . $ atoi(5c4306d8553b3696). (strv[i]); |
| 395 | g_freecxx . . $ g_free(5d22bdacc48458e8). (str); |
| 396 | g_strfreevcxx . . $ g_strfreev(3ed91490e421178f). (strv); |
| 397 | |
| 398 | value = gdk_content_deserializer_get_valuecxx . . $ gdk_content_deserializer_get_value(acb2aa7c9b757d66). (deserializer); |
| 399 | g_value_take_boxedcxx . . $ g_value_take_boxed(806599f585dac18b). (value, data); |
| 400 | |
| 401 | gdk_content_deserializer_return_successcxx . . $ gdk_content_deserializer_return_success(9c22f94ed9b01fb0). (deserializer); |
| 402 | } |
| 403 | |
| 404 | static void |
| 405 | int_list_deserializercxx . . $ int_list_deserializer(9c22f94ed9b01fb0). (GdkContentDeserializercxx . . $ GdkContentDeserializer# *deserializer) |
| 406 | { |
| 407 | GOutputStreamcxx . . $ GOutputStream# *output; |
| 408 | |
| 409 | output = g_memory_output_stream_new_resizablecxx . . $ g_memory_output_stream_new_resizable(937a4dd9141c33c9). (); |
| 410 | |
| 411 | g_output_stream_splice_asynccxx . . $ g_output_stream_splice_async(e4877396f3e433df). (output, |
| 412 | gdk_content_deserializer_get_input_streamcxx . . $ gdk_content_deserializer_get_input_stream(df5ae86d73d8455d). (deserializer), |
| 413 | G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCEcxx . . $ G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE., |
| 414 | gdk_content_deserializer_get_prioritycxx . . $ gdk_content_deserializer_get_priority(d44d20d39f43eb68). (deserializer), |
| 415 | gdk_content_deserializer_get_cancellablecxx . . $ gdk_content_deserializer_get_cancellable(82ef01bbea1a3c5). (deserializer), |
| 416 | int_list_deserializer_finishcxx . . $ int_list_deserializer_finish(aa1d200d824d915d)., |
| 417 | deserializer); |
| 418 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (output); |
| 419 | } |
| 420 | |
| 421 | static gbooleancxx . . $ gboolean# |
| 422 | compare_int_list_valuescxx . . $ compare_int_list_values(15a6341dcd24321d). (GValuecxx . . $ GValue# *v1, GValuecxx . . $ GValue# *v2) |
| 423 | { |
| 424 | int *d1, *d2; |
| 425 | |
| 426 | if (G_VALUE_TYPEcxx . . $ `<external>/17218264759549183453/gvalue.h:66:9`! (v1) != MY_TYPE_INT_LISTcxx . . $ `testsuite/gdk/contentserializer.c:283:9`! || |
| 427 | G_VALUE_TYPEcxx . . $ `<external>/17218264759549183453/gvalue.h:66:9`! (v2) != MY_TYPE_INT_LISTcxx . . $ `testsuite/gdk/contentserializer.c:283:9`!) |
| 428 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 429 | |
| 430 | d1 = g_value_get_boxedcxx . . $ g_value_get_boxed(e12dff36056c2cce). (v1); |
| 431 | d2 = g_value_get_boxedcxx . . $ g_value_get_boxed(e12dff36056c2cce). (v2); |
| 432 | |
| 433 | if (d1[0] != d2[0]) |
| 434 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 435 | |
| 436 | return memcmpcxx . . $ memcmp(36f949851efa3055). (d1, d2, (d1[0] + 1) * sizeof (int)) == 0; |
| 437 | } |
| 438 | |
| 439 | static void |
| 440 | test_custom_formatcxx . . $ test_custom_format(49f6e7a06ebc5aa8). (void) |
| 441 | { |
| 442 | int *data; |
| 443 | GValuecxx . . $ GValue# value = G_VALUE_INITcxx . . $ `<external>/17218264759549183453/gvalue.h:250:9`!; |
| 444 | |
| 445 | gdk_content_register_serializercxx . . $ gdk_content_register_serializer(608d216c30a62466). (MY_TYPE_INT_LISTcxx . . $ `testsuite/gdk/contentserializer.c:283:9`!, |
| 446 | "application/x-int-list", |
| 447 | int_list_serializercxx . . $ int_list_serializer(9ebddb52e2aecd59)., |
| 448 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 449 | gdk_content_register_deserializercxx . . $ gdk_content_register_deserializer(63cd696220fad2af). ("application/x-int-list", |
| 450 | MY_TYPE_INT_LISTcxx . . $ `testsuite/gdk/contentserializer.c:283:9`!, |
| 451 | int_list_deserializercxx . . $ int_list_deserializer(9c22f94ed9b01fb0)., |
| 452 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 453 | |
| 454 | data = g_malloccxx . . $ g_malloc(bfcfa4d6b7f7ef64). (3 * sizeof (int)); |
| 455 | data[0] = 2; |
| 456 | data[1] = 3; |
| 457 | data[2] = 5; |
| 458 | |
| 459 | g_value_initcxx . . $ g_value_init(afc049a76445919c). (&value, MY_TYPE_INT_LISTcxx . . $ `testsuite/gdk/contentserializer.c:283:9`!); |
| 460 | g_value_set_boxedcxx . . $ g_value_set_boxed(806599f585dac18b). (&value, data); |
| 461 | test_content_roundtripcxx . . $ test_content_roundtrip(60204a4fd097ac9e). (&value, "application/x-int-list", compare_int_list_valuescxx . . $ compare_int_list_values(15a6341dcd24321d).); |
| 462 | g_value_unsetcxx . . $ g_value_unset(15c06aff79890746). (&value); |
| 463 | g_freecxx . . $ g_free(5d22bdacc48458e8). (data); |
| 464 | } |
| 465 | |
| 466 | static void |
| 467 | test_serialize_union_stringcxx . . $ test_serialize_union_string(49f6e7a06ebc5aa8). (void) |
| 468 | { |
| 469 | GdkContentFormatsBuildercxx . . $ GdkContentFormatsBuilder# *builder; |
| 470 | GdkContentFormatscxx . . $ GdkContentFormats# *formats, *result; |
| 471 | const char * expected[] = { |
| 472 | "text/plain;charset=utf-8", |
| 473 | "text/plain", |
| 474 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 475 | }; |
| 476 | const char * const * mime_types; |
| 477 | |
| 478 | builder = gdk_content_formats_builder_newcxx . . $ gdk_content_formats_builder_new(9389eeea6508d907). (); |
| 479 | gdk_content_formats_builder_add_gtypecxx . . $ gdk_content_formats_builder_add_gtype(1fd9ff67a5fc1cf8). (builder, G_TYPE_STRINGcxx . . $ `<external>/9567554376676449156/gtype.h:165:9`!); |
| 480 | formats = gdk_content_formats_builder_free_to_formatscxx . . $ gdk_content_formats_builder_free_to_formats(16f650eca71896f0). (builder); |
| 481 | |
| 482 | result = gdk_content_formats_union_serialize_mime_typescxx . . $ gdk_content_formats_union_serialize_mime_types(f9c6e94556d0b4d1). (formats); |
| 483 | mime_types = gdk_content_formats_get_mime_typescxx . . $ gdk_content_formats_get_mime_types(53fcd5360199a68b). (result, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 484 | |
| 485 | g_assert_cmpstrvcxx . . $ `<external>/15287032793271088244/gtestutils.h:158:9`! (mime_types, expected); |
| 486 | } |
| 487 | |
| 488 | static void |
| 489 | test_deserialize_union_stringcxx . . $ test_deserialize_union_string(49f6e7a06ebc5aa8). (void) |
| 490 | { |
| 491 | GdkContentFormatsBuildercxx . . $ GdkContentFormatsBuilder# *builder; |
| 492 | GdkContentFormatscxx . . $ GdkContentFormats# *formats, *result; |
| 493 | const char * expected[] = { |
| 494 | "text/plain;charset=utf-8", |
| 495 | "text/plain", |
| 496 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 497 | }; |
| 498 | const char * const * mime_types; |
| 499 | |
| 500 | builder = gdk_content_formats_builder_newcxx . . $ gdk_content_formats_builder_new(9389eeea6508d907). (); |
| 501 | gdk_content_formats_builder_add_gtypecxx . . $ gdk_content_formats_builder_add_gtype(1fd9ff67a5fc1cf8). (builder, G_TYPE_STRINGcxx . . $ `<external>/9567554376676449156/gtype.h:165:9`!); |
| 502 | formats = gdk_content_formats_builder_free_to_formatscxx . . $ gdk_content_formats_builder_free_to_formats(16f650eca71896f0). (builder); |
| 503 | |
| 504 | result = gdk_content_formats_union_deserialize_mime_typescxx . . $ gdk_content_formats_union_deserialize_mime_types(f9c6e94556d0b4d1). (formats); |
| 505 | mime_types = gdk_content_formats_get_mime_typescxx . . $ gdk_content_formats_get_mime_types(53fcd5360199a68b). (result, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 506 | |
| 507 | g_assert_cmpstrvcxx . . $ `<external>/15287032793271088244/gtestutils.h:158:9`! (mime_types, expected); |
| 508 | } |
| 509 | |
| 510 | static void |
| 511 | test_serialize_union_textbuffercxx . . $ test_serialize_union_textbuffer(49f6e7a06ebc5aa8). (void) |
| 512 | { |
| 513 | GdkContentFormatsBuildercxx . . $ GdkContentFormatsBuilder# *builder; |
| 514 | GdkContentFormatscxx . . $ GdkContentFormats# *formats, *result; |
| 515 | const char * expected[] = { |
| 516 | "text/plain;charset=utf-8", |
| 517 | "text/plain", |
| 518 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 519 | }; |
| 520 | const char * const * mime_types; |
| 521 | GtkTextBuffercxx . . $ GtkTextBuffer# *b = gtk_text_buffer_newcxx . . $ gtk_text_buffer_new(539b20931c5c334d). (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); // Just to register serializers |
| 522 | |
| 523 | builder = gdk_content_formats_builder_newcxx . . $ gdk_content_formats_builder_new(9389eeea6508d907). (); |
| 524 | gdk_content_formats_builder_add_gtypecxx . . $ gdk_content_formats_builder_add_gtype(1fd9ff67a5fc1cf8). (builder, GTK_TYPE_TEXT_BUFFERcxx . . $ `gtk/gtktextbuffer.h:39:9`!); |
| 525 | formats = gdk_content_formats_builder_free_to_formatscxx . . $ gdk_content_formats_builder_free_to_formats(16f650eca71896f0). (builder); |
| 526 | |
| 527 | result = gdk_content_formats_union_serialize_mime_typescxx . . $ gdk_content_formats_union_serialize_mime_types(f9c6e94556d0b4d1). (formats); |
| 528 | mime_types = gdk_content_formats_get_mime_typescxx . . $ gdk_content_formats_get_mime_types(53fcd5360199a68b). (result, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 529 | |
| 530 | g_assert_cmpstrvcxx . . $ `<external>/15287032793271088244/gtestutils.h:158:9`! (mime_types, expected); |
| 531 | |
| 532 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (b); |
| 533 | } |
| 534 | |
| 535 | static void |
| 536 | test_deserialize_union_textbuffercxx . . $ test_deserialize_union_textbuffer(49f6e7a06ebc5aa8). (void) |
| 537 | { |
| 538 | GdkContentFormatsBuildercxx . . $ GdkContentFormatsBuilder# *builder; |
| 539 | GdkContentFormatscxx . . $ GdkContentFormats# *formats, *result; |
| 540 | const char * expected[] = { |
| 541 | "text/plain;charset=utf-8", |
| 542 | "text/plain", |
| 543 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 544 | }; |
| 545 | const char * const * mime_types; |
| 546 | GtkTextBuffercxx . . $ GtkTextBuffer# *b = gtk_text_buffer_newcxx . . $ gtk_text_buffer_new(539b20931c5c334d). (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 547 | |
| 548 | builder = gdk_content_formats_builder_newcxx . . $ gdk_content_formats_builder_new(9389eeea6508d907). (); |
| 549 | gdk_content_formats_builder_add_gtypecxx . . $ gdk_content_formats_builder_add_gtype(1fd9ff67a5fc1cf8). (builder, GTK_TYPE_TEXT_BUFFERcxx . . $ `gtk/gtktextbuffer.h:39:9`!); |
| 550 | formats = gdk_content_formats_builder_free_to_formatscxx . . $ gdk_content_formats_builder_free_to_formats(16f650eca71896f0). (builder); |
| 551 | |
| 552 | result = gdk_content_formats_union_deserialize_mime_typescxx . . $ gdk_content_formats_union_deserialize_mime_types(f9c6e94556d0b4d1). (formats); |
| 553 | mime_types = gdk_content_formats_get_mime_typescxx . . $ gdk_content_formats_get_mime_types(53fcd5360199a68b). (result, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 554 | |
| 555 | g_assert_cmpstrvcxx . . $ `<external>/15287032793271088244/gtestutils.h:158:9`! (mime_types, expected); |
| 556 | |
| 557 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (b); |
| 558 | } |
| 559 | |
| 560 | static void |
| 561 | my_string_serializercxx . . $ my_string_serializer(9ebddb52e2aecd59). (GdkContentSerializercxx . . $ GdkContentSerializer# *serializer) |
| 562 | { |
| 563 | int *count; |
| 564 | GOutputStreamcxx . . $ GOutputStream# *stream; |
| 565 | const GValuecxx . . $ GValue# *value; |
| 566 | const char *text; |
| 567 | gbooleancxx . . $ gboolean# res; |
| 568 | gsizecxx . . $ gsize# written; |
| 569 | GErrorcxx . . $ GError# *error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 570 | |
| 571 | g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (gdk_content_serializer_get_gtype (serializer) == G_TYPE_STRINGcxx . . $ `<external>/9567554376676449156/gtype.h:165:9`!); |
| 572 | g_assert_cmpstrcxx . . $ `<external>/15287032793271088244/gtestutils.h:46:9`! (gdk_content_serializer_get_mime_type (serializer), ==, "text/plain;charset=utf-8"); |
| 573 | |
| 574 | count = gdk_content_serializer_get_user_datacxx . . $ gdk_content_serializer_get_user_data(a00fb8e1e97e7905). (serializer); |
| 575 | (*count)++; |
| 576 | |
| 577 | stream = gdk_content_serializer_get_output_streamcxx . . $ gdk_content_serializer_get_output_stream(3ab0bc34e9433566). (serializer); |
| 578 | value = gdk_content_serializer_get_valuecxx . . $ gdk_content_serializer_get_value(590542a31c789f1). (serializer); |
| 579 | |
| 580 | text = g_value_get_stringcxx . . $ g_value_get_string(cc0a2be2b8f7bdc8). (value); |
| 581 | res = g_output_stream_write_allcxx . . $ g_output_stream_write_all(bc39c6265c1f8b99). (stream, text, strlencxx . . $ strlen(751346f8406fd082). (text), &written, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, &error); |
| 582 | g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (res); |
| 583 | g_assert_no_errorcxx . . $ `<external>/15287032793271088244/gtestutils.h:217:9`! (error); |
| 584 | |
| 585 | gdk_content_serializer_return_successcxx . . $ gdk_content_serializer_return_success(9ebddb52e2aecd59). (serializer); |
| 586 | } |
| 587 | |
| 588 | static void |
| 589 | my_serialize_donecxx . . $ my_serialize_done(aa1d200d824d915d). (GObjectcxx . . $ GObject# *source, |
| 590 | GAsyncResultcxx . . $ GAsyncResult# *result, |
| 591 | gpointercxx . . $ gpointer# data) |
| 592 | { |
| 593 | gbooleancxx . . $ gboolean# *done = data; |
| 594 | gbooleancxx . . $ gboolean# res; |
| 595 | GErrorcxx . . $ GError# *error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 596 | |
| 597 | res = gdk_content_serialize_finishcxx . . $ gdk_content_serialize_finish(aff244c0ed8a2285). (result, &error); |
| 598 | g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (res); |
| 599 | g_assert_no_errorcxx . . $ `<external>/15287032793271088244/gtestutils.h:217:9`! (error); |
| 600 | |
| 601 | *done = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 602 | |
| 603 | g_main_context_wakeupcxx . . $ g_main_context_wakeup(2c4f9bc69c34eb5d). (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 604 | } |
| 605 | |
| 606 | static int my_serializer_countcxx . . $ my_serializer_count. = 0; |
| 607 | |
| 608 | static void |
| 609 | test_override_serializercxx . . $ test_override_serializer(49f6e7a06ebc5aa8). (void) |
| 610 | { |
| 611 | GOutputStreamcxx . . $ GOutputStream# *stream; |
| 612 | GValuecxx . . $ GValue# value = G_VALUE_INITcxx . . $ `<external>/17218264759549183453/gvalue.h:250:9`!; |
| 613 | gbooleancxx . . $ gboolean# done = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 614 | |
| 615 | gdk_content_register_serializercxx . . $ gdk_content_register_serializer(608d216c30a62466). (G_TYPE_STRINGcxx . . $ `<external>/9567554376676449156/gtype.h:165:9`!, "text/plain;charset=utf-8", |
| 616 | my_string_serializercxx . . $ my_string_serializer(9ebddb52e2aecd59)., |
| 617 | &my_serializer_countcxx . . $ my_serializer_count., |
| 618 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 619 | |
| 620 | g_value_initcxx . . $ g_value_init(afc049a76445919c). (&value, G_TYPE_STRINGcxx . . $ `<external>/9567554376676449156/gtype.h:165:9`!); |
| 621 | g_value_set_stringcxx . . $ g_value_set_string(65b9ea7708b82b9b). (&value, "bu ba bla"); |
| 622 | |
| 623 | stream = g_memory_output_stream_new_resizablecxx . . $ g_memory_output_stream_new_resizable(937a4dd9141c33c9). (); |
| 624 | |
| 625 | gdk_content_serialize_asynccxx . . $ gdk_content_serialize_async(de4533add184f2ee). (stream, |
| 626 | "text/plain;charset=utf-8", |
| 627 | &value, |
| 628 | G_PRIORITY_DEFAULTcxx . . $ `<external>/1856471541377536744/gmain.h:434:9`!, |
| 629 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 630 | my_serialize_donecxx . . $ my_serialize_done(aa1d200d824d915d)., |
| 631 | &done); |
| 632 | |
| 633 | while (!done) |
| 634 | g_main_context_iterationcxx . . $ g_main_context_iteration(53f508c65b8b33ab). (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!); |
| 635 | |
| 636 | g_assert_truecxx . . $ `<external>/15287032793271088244/gtestutils.h:227:9`! (my_serializer_count > 0); |
| 637 | |
| 638 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (stream); |
| 639 | g_value_unsetcxx . . $ g_value_unset(15c06aff79890746). (&value); |
| 640 | } |
| 641 | |
| 642 | int |
| 643 | maincxx . . $ main(afcd3168fc1188a4). (int argc, char *argv[]) |
| 644 | { |
| 645 | (g_test_initcxx . . $ g_test_init(b91bcc5cc1349d78).) (&argc, &argv, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 646 | |
| 647 | gtk_initcxx . . $ gtk_init(49f6e7a06ebc5aa8). (); |
| 648 | |
| 649 | g_test_add_funccxx . . $ g_test_add_func(18fee6cbb4bb18a4). ("/content/text_plain_utf8", test_content_text_plain_utf8cxx . . $ test_content_text_plain_utf8(49f6e7a06ebc5aa8).); |
| 650 | g_test_add_funccxx . . $ g_test_add_func(18fee6cbb4bb18a4). ("/content/text_plain", test_content_text_plaincxx . . $ test_content_text_plain(49f6e7a06ebc5aa8).); |
| 651 | g_test_add_funccxx . . $ g_test_add_func(18fee6cbb4bb18a4). ("/content/color", test_content_colorcxx . . $ test_content_color(49f6e7a06ebc5aa8).); |
| 652 | g_test_add_data_funccxx . . $ g_test_add_data_func(a7326f7e8f3610af). ("/content/texture/png", "image/png", test_content_texturecxx . . $ test_content_texture(e4289f82fef2c2f9).); |
| 653 | g_test_add_data_funccxx . . $ g_test_add_data_func(a7326f7e8f3610af). ("/content/texture/tiff", "image/tiff", test_content_texturecxx . . $ test_content_texture(e4289f82fef2c2f9).); |
| 654 | g_test_add_funccxx . . $ g_test_add_func(18fee6cbb4bb18a4). ("/content/file", test_content_filecxx . . $ test_content_file(49f6e7a06ebc5aa8).); |
| 655 | g_test_add_funccxx . . $ g_test_add_func(18fee6cbb4bb18a4). ("/content/files", test_content_filescxx . . $ test_content_files(49f6e7a06ebc5aa8).); |
| 656 | g_test_add_funccxx . . $ g_test_add_func(18fee6cbb4bb18a4). ("/content/custom", test_custom_formatcxx . . $ test_custom_format(49f6e7a06ebc5aa8).); |
| 657 | g_test_add_funccxx . . $ g_test_add_func(18fee6cbb4bb18a4). ("/content/serialize/union/string", test_serialize_union_stringcxx . . $ test_serialize_union_string(49f6e7a06ebc5aa8).); |
| 658 | g_test_add_funccxx . . $ g_test_add_func(18fee6cbb4bb18a4). ("/content/serialize/union/textbuffer", test_serialize_union_textbuffercxx . . $ test_serialize_union_textbuffer(49f6e7a06ebc5aa8).); |
| 659 | g_test_add_funccxx . . $ g_test_add_func(18fee6cbb4bb18a4). ("/content/deserialize/union/string", test_deserialize_union_stringcxx . . $ test_deserialize_union_string(49f6e7a06ebc5aa8).); |
| 660 | g_test_add_funccxx . . $ g_test_add_func(18fee6cbb4bb18a4). ("/content/deserialize/union/textbuffer", test_deserialize_union_textbuffercxx . . $ test_deserialize_union_textbuffer(49f6e7a06ebc5aa8).); |
| 661 | g_test_add_funccxx . . $ g_test_add_func(18fee6cbb4bb18a4). ("/content/serializer/override", test_override_serializercxx . . $ test_override_serializer(49f6e7a06ebc5aa8).); |
| 662 | |
| 663 | return g_test_runcxx . . $ g_test_run(b126dc7c1de90089). (); |
| 664 | } |