Skip to content

Commit

Permalink
Code auto-formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Libmodulemd CI <[email protected]>
  • Loading branch information
Libmodulemd CI committed Apr 21, 2021
1 parent 0132015 commit 31d4883
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 15 deletions.
11 changes: 6 additions & 5 deletions modulemd/modulemd-module-stream-v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1261,11 +1261,12 @@ modulemd_module_stream_v2_validate_context (const gchar *context,
{
if (!g_ascii_isalnum (*i) && *i != '_')
{
g_set_error (error,
MODULEMD_ERROR,
MMD_ERROR_VALIDATE,
"Stream context '%s' can only contain [a-zA-Z0-9_] characters",
context);
g_set_error (
error,
MODULEMD_ERROR,
MMD_ERROR_VALIDATE,
"Stream context '%s' can only contain [a-zA-Z0-9_] characters",
context);
return FALSE;
}
}
Expand Down
29 changes: 19 additions & 10 deletions modulemd/tests/test-modulemd-context.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ test_modulemd_v2_context_valid (void)
g_assert_true (type == MODULEMD_TYPE_MODULE_STREAM_V2);
g_assert_no_error (error);
/* Reading v2 document does not validate it; validating explictly */
g_assert_true (modulemd_module_stream_validate (MODULEMD_MODULE_STREAM (object), &error));
g_assert_true (
modulemd_module_stream_validate (MODULEMD_MODULE_STREAM (object), &error));
}


Expand Down Expand Up @@ -164,7 +165,8 @@ test_modulemd_v2_context_overlong (void)
{
g_test_incomplete ("Reading v2 document does not validate it");
/* Validating explicitly */
g_assert_false (modulemd_module_stream_validate (MODULEMD_MODULE_STREAM (object), &error));
g_assert_false (modulemd_module_stream_validate (
MODULEMD_MODULE_STREAM (object), &error));
}
}

Expand Down Expand Up @@ -199,7 +201,8 @@ test_modulemd_v2_context_bad_character (void)
{
g_test_incomplete ("Reading v2 document does not validate it");
/* Validating explicitly */
g_assert_false (modulemd_module_stream_validate (MODULEMD_MODULE_STREAM (object), &error));
g_assert_false (modulemd_module_stream_validate (
MODULEMD_MODULE_STREAM (object), &error));
}
}

Expand All @@ -213,13 +216,19 @@ main (int argc, char *argv[])
g_test_bug_base ("https://github.com/fedora-modularity/libmodulemd/issues/");
g_test_bug ("549");

g_test_add_func ("/modulemd/v3/context/valid", test_modulemd_v3_context_valid);
g_test_add_func ("/modulemd/v3/context/overlong", test_modulemd_v3_context_overlong);
g_test_add_func ("/modulemd/v3/context/bad_underscore", test_modulemd_v3_context_bad_underscore);

g_test_add_func ("/modulemd/v2/context/valid", test_modulemd_v2_context_valid);
g_test_add_func ("/modulemd/v2/context/overlong", test_modulemd_v2_context_overlong);
g_test_add_func ("/modulemd/v2/context/bad_character", test_modulemd_v2_context_bad_character);
g_test_add_func ("/modulemd/v3/context/valid",
test_modulemd_v3_context_valid);
g_test_add_func ("/modulemd/v3/context/overlong",
test_modulemd_v3_context_overlong);
g_test_add_func ("/modulemd/v3/context/bad_underscore",
test_modulemd_v3_context_bad_underscore);

g_test_add_func ("/modulemd/v2/context/valid",
test_modulemd_v2_context_valid);
g_test_add_func ("/modulemd/v2/context/overlong",
test_modulemd_v2_context_overlong);
g_test_add_func ("/modulemd/v2/context/bad_character",
test_modulemd_v2_context_bad_character);

return g_test_run ();
}

0 comments on commit 31d4883

Please sign in to comment.