From 70ba00ae53908421fa2b8bc79a98064a2c3df5ae Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 18 May 2023 08:40:50 -0400 Subject: [PATCH] testsuite: Make this test compile clang did not like this creative use of strings at all. Rightfully so. --- testsuite/gtk/treelistmodel.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/testsuite/gtk/treelistmodel.c b/testsuite/gtk/treelistmodel.c index aeb00b59ae..3ea9a9b941 100644 --- a/testsuite/gtk/treelistmodel.c +++ b/testsuite/gtk/treelistmodel.c @@ -550,6 +550,7 @@ test_same_child_model (void) GtkTreeListModel *treelist; DemoNode *d; guint i, j; + char str[2] = { 0, }; i = N_MODELS; while (i --> 0) @@ -557,7 +558,8 @@ test_same_child_model (void) models[i] = g_list_store_new (demo_node_get_type ()); for (j = 0; j < N_ITEMS_PER_MODEL; j++) { - d = demo_node_new ("A" + j, i + 1 < N_MODELS ? models[i + 1] : NULL); + str[0] = 'A' + j; + d = demo_node_new (str, i + 1 < N_MODELS ? models[i + 1] : NULL); g_list_store_append (models[i], d); } } @@ -579,7 +581,8 @@ test_same_child_model (void) case 0: if (n_items < 10) { - d = demo_node_new ("A" + (i % 26), model_id + 1 < N_MODELS ? models[model_id + 1] : NULL); + str[0] = 'A' + (i % 26); + d = demo_node_new (str, model_id + 1 < N_MODELS ? models[model_id + 1] : NULL); g_list_store_insert (model, g_test_rand_int_range (0, n_items + 1), d); @@ -591,7 +594,8 @@ test_same_child_model (void) g_list_store_remove (model, g_test_rand_int_range (0, n_items)); break; case 2: - d = demo_node_new ("A" + (i % 26), model_id + 1 < N_MODELS ? models[model_id + 1] : NULL); + str[0] = 'A' + (i % 26); + d = demo_node_new (str, model_id + 1 < N_MODELS ? models[model_id + 1] : NULL); g_list_store_splice (model, n_items ? g_test_rand_int_range (0, n_items) : 0, n_items ? 1 : 0,