Skip to content

Commit 6d02f70

Browse files
ppisarsgallagher
authored andcommitted
tests: Do not use g_test_incomplete() broken in old glib
The context validation tests dealt with v2 format not being valided implicitly by marking the tests as expected to fail. But g_test_incomplete() seems to be broken in glib2-2.56.4. It will return a failure exit code if a test expected to fail indeed fails. This is not how 2.68.1 behaves. This patch accommodates to both behaviours by not using the broken g_test_incomplete() at all. Related to <#549>.
1 parent 31d4883 commit 6d02f70

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

modulemd/tests/test-modulemd-context.c

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -159,15 +159,11 @@ test_modulemd_v2_context_overlong (void)
159159
" context: a234567890_234\n"
160160
"...\n";
161161
type = modulemd_read_packager_string (yaml_string, &object, &error);
162-
g_assert_true (type == G_TYPE_INVALID);
163-
g_assert_error (error, MODULEMD_ERROR, MMD_ERROR_VALIDATE);
164-
if (type != G_TYPE_INVALID)
165-
{
166-
g_test_incomplete ("Reading v2 document does not validate it");
167-
/* Validating explicitly */
168-
g_assert_false (modulemd_module_stream_validate (
169-
MODULEMD_MODULE_STREAM (object), &error));
170-
}
162+
g_assert_true (type == MODULEMD_TYPE_MODULE_STREAM_V2);
163+
g_assert_no_error (error);
164+
/* Reading v2 document does not validate it; validating explictly */
165+
g_assert_false (
166+
modulemd_module_stream_validate (MODULEMD_MODULE_STREAM (object), &error));
171167
}
172168

173169

@@ -195,15 +191,11 @@ test_modulemd_v2_context_bad_character (void)
195191
" context: '-'\n"
196192
"...\n";
197193
type = modulemd_read_packager_string (yaml_string, &object, &error);
198-
g_assert_true (type == G_TYPE_INVALID);
199-
g_assert_error (error, MODULEMD_ERROR, MMD_ERROR_VALIDATE);
200-
if (type != G_TYPE_INVALID)
201-
{
202-
g_test_incomplete ("Reading v2 document does not validate it");
203-
/* Validating explicitly */
204-
g_assert_false (modulemd_module_stream_validate (
205-
MODULEMD_MODULE_STREAM (object), &error));
206-
}
194+
g_assert_true (type == MODULEMD_TYPE_MODULE_STREAM_V2);
195+
g_assert_no_error (error);
196+
/* Reading v2 document does not validate it; validating explictly */
197+
g_assert_false (
198+
modulemd_module_stream_validate (MODULEMD_MODULE_STREAM (object), &error));
207199
}
208200

209201

0 commit comments

Comments
 (0)