Skip to contentSkip to conversation

tests: fix modules-test 'duplicate test case' error

PATCH In review Cole Robinson 4 participants 4 messages Nov 13, 2019 – Nov 14, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests: fix modules-test 'duplicate test case' error

./configure --enable-sdl --audio-drv-list=sdl --enable-modules

Will generate two identical test names: /$arch/module/load/sdl Which generates an error like:

(tests/modules-test:23814): GLib-ERROR **: 18:23:06.359: duplicate test case path: /aarch64//module/load/sdl

Add the subsystem prefix in the name as well, so instead we get:

/$arch/module/load/audio-sdl
/$arch/module/load/ui-sdl

---
 tests/modules-test.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tests/modules-test.c +2 -1
index d1a6ace218..88217686e1 100644
@@ -64,7 +64,8 @@ int main(int argc, char *argv[])
     g_test_init(&argc, &argv, NULL);
 
     for (i = 0; i < G_N_ELEMENTS(modules); i += 2) {
-        char *testname = g_strdup_printf("/module/load/%s", modules[i + 1]);
+        char *testname = g_strdup_printf("/module/load/%s%s",
+                                         modules[i], modules[i + 1]);
         qtest_add_data_func(testname, modules + i, test_modules_load);
         g_free(testname);
     }
Signature · 1 line
2.23.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Cole Robinson

./configure --enable-sdl --audio-drv-list=sdl --enable-modules

Will generate two identical test names: /$arch/module/load/sdl Which generates an error like:

Quoted 8 lines

(tests/modules-test:23814): GLib-ERROR **: 18:23:06.359: duplicate test case path: /aarch64//module/load/sdl

Add the subsystem prefix in the name as well, so instead we get:

/$arch/module/load/audio-sdl
/$arch/module/load/ui-sdl

Quoted 21 lines
---
 tests/modules-test.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tests/modules-test.c +2 -2
index d1a6ace218..88217686e1 100644
@@ -64,7 +64,8 @@ int main(int argc, char *argv[])
     g_test_init(&argc, &argv, NULL);
 
     for (i = 0; i < G_N_ELEMENTS(modules); i += 2) {
-        char *testname = g_strdup_printf("/module/load/%s", modules[i + 1]);
+        char *testname = g_strdup_printf("/module/load/%s%s",
+                                         modules[i], modules[i + 1]);
         qtest_add_data_func(testname, modules + i, test_modules_load);
         g_free(testname);
     }
--

2.23.0

Reviewed-by on v1 1/1
#2 lore raw
In reply to Cole Robinson
Quoted 23 lines · Cole Robinson

./configure --enable-sdl --audio-drv-list=sdl --enable-modules

Will generate two identical test names: /$arch/module/load/sdl Which generates an error like:

(tests/modules-test:23814): GLib-ERROR **: 18:23:06.359: duplicate test case path: /aarch64//module/load/sdl

Add the subsystem prefix in the name as well, so instead we get:

/$arch/module/load/audio-sdl
/$arch/module/load/ui-sdl

---
 tests/modules-test.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tests/modules-test.c +0 -0
index d1a6ace218..88217686e1 100644

tests/modules-test.c int main(int argc, char *argv[]) · line 71

Quoted 9 lines
tests/modules-test.c +2 -1
@@ -64,7 +64,8 @@ int main(int argc, char *argv[])
     g_test_init(&argc, &argv, NULL);
 
     for (i = 0; i < G_N_ELEMENTS(modules); i += 2) {
-        char *testname = g_strdup_printf("/module/load/%s", modules[i + 1]);
+        char *testname = g_strdup_printf("/module/load/%s%s",
+                                         modules[i], modules[i + 1]);
         qtest_add_data_func(testname, modules + i, test_modules_load);
         g_free(testname);
     }
Reviewed-by on v1 1/1
#3 lore raw
In reply to Cole Robinson
Quoted 23 lines · Cole Robinson

./configure --enable-sdl --audio-drv-list=sdl --enable-modules

Will generate two identical test names: /$arch/module/load/sdl Which generates an error like:

(tests/modules-test:23814): GLib-ERROR **: 18:23:06.359: duplicate test case path: /aarch64//module/load/sdl

Add the subsystem prefix in the name as well, so instead we get:

/$arch/module/load/audio-sdl
/$arch/module/load/ui-sdl

---
  tests/modules-test.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
tests/modules-test.c +0 -0
index d1a6ace218..88217686e1 100644

tests/modules-test.c int main(int argc, char *argv[]) · line 71

Quoted 9 lines
tests/modules-test.c +2 -1
@@ -64,7 +64,8 @@ int main(int argc, char *argv[])
      g_test_init(&argc, &argv, NULL);
 
      for (i = 0; i < G_N_ELEMENTS(modules); i += 2) {
-        char *testname = g_strdup_printf("/module/load/%s", modules[i + 1]);
+        char *testname = g_strdup_printf("/module/load/%s%s",
+                                         modules[i], modules[i + 1]);
          qtest_add_data_func(testname, modules + i, test_modules_load);
          g_free(testname);
      }