mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-06 02:37:00 +02:00
Merge branch 'test-bug-base' into 'master'
Relax use of g_test_bug() to not require g_test_bug_base() to be called first See merge request GNOME/glib!1044
This commit is contained in:
commit
5f5f98f3d0
@ -2321,7 +2321,6 @@ main (int argc, char **argv)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, NULL);
|
||||||
g_test_bug_base ("");
|
|
||||||
|
|
||||||
loop = g_main_loop_new (NULL, FALSE);
|
loop = g_main_loop_new (NULL, FALSE);
|
||||||
main_thread = g_thread_self ();
|
main_thread = g_thread_self ();
|
||||||
|
@ -150,7 +150,6 @@
|
|||||||
* setlocale (LC_ALL, "");
|
* setlocale (LC_ALL, "");
|
||||||
*
|
*
|
||||||
* g_test_init (&argc, &argv, NULL);
|
* g_test_init (&argc, &argv, NULL);
|
||||||
* g_test_bug_base ("http://bugzilla.gnome.org/show_bug.cgi?id=");
|
|
||||||
*
|
*
|
||||||
* // Define the tests.
|
* // Define the tests.
|
||||||
* g_test_add ("/my-object/test1", MyObjectFixture, "some-user-data",
|
* g_test_add ("/my-object/test1", MyObjectFixture, "some-user-data",
|
||||||
@ -1887,6 +1886,9 @@ g_test_message (const char *format,
|
|||||||
* portion to @uri_pattern, or by replacing the special string
|
* portion to @uri_pattern, or by replacing the special string
|
||||||
* '\%s' within @uri_pattern if that is present.
|
* '\%s' within @uri_pattern if that is present.
|
||||||
*
|
*
|
||||||
|
* If g_test_bug_base() is not called, bug URIs are formed solely
|
||||||
|
* from the value provided by g_test_bug().
|
||||||
|
*
|
||||||
* Since: 2.16
|
* Since: 2.16
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
@ -1903,7 +1905,9 @@ g_test_bug_base (const char *uri_pattern)
|
|||||||
* This function adds a message to test reports that
|
* This function adds a message to test reports that
|
||||||
* associates a bug URI with a test case.
|
* associates a bug URI with a test case.
|
||||||
* Bug URIs are constructed from a base URI set with g_test_bug_base()
|
* Bug URIs are constructed from a base URI set with g_test_bug_base()
|
||||||
* and @bug_uri_snippet.
|
* and @bug_uri_snippet. If g_test_bug_base() has not been called, it is
|
||||||
|
* assumed to be the empty string, so a full URI can be provided to
|
||||||
|
* g_test_bug() instead.
|
||||||
*
|
*
|
||||||
* Since: 2.16
|
* Since: 2.16
|
||||||
* See also: g_test_summary()
|
* See also: g_test_summary()
|
||||||
@ -1911,11 +1915,11 @@ g_test_bug_base (const char *uri_pattern)
|
|||||||
void
|
void
|
||||||
g_test_bug (const char *bug_uri_snippet)
|
g_test_bug (const char *bug_uri_snippet)
|
||||||
{
|
{
|
||||||
char *c;
|
const char *c = NULL;
|
||||||
|
|
||||||
g_return_if_fail (test_uri_base != NULL);
|
|
||||||
g_return_if_fail (bug_uri_snippet != NULL);
|
g_return_if_fail (bug_uri_snippet != NULL);
|
||||||
|
|
||||||
|
if (test_uri_base != NULL)
|
||||||
c = strstr (test_uri_base, "%s");
|
c = strstr (test_uri_base, "%s");
|
||||||
if (c)
|
if (c)
|
||||||
{
|
{
|
||||||
@ -1926,7 +1930,8 @@ g_test_bug (const char *bug_uri_snippet)
|
|||||||
g_free (s);
|
g_free (s);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
g_test_message ("Bug Reference: %s%s", test_uri_base, bug_uri_snippet);
|
g_test_message ("Bug Reference: %s%s",
|
||||||
|
test_uri_base ? test_uri_base : "", bug_uri_snippet);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -188,7 +188,6 @@ int
|
|||||||
main (int argc, char *argv[])
|
main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, NULL);
|
||||||
g_test_bug_base ("");
|
|
||||||
|
|
||||||
g_test_add_func ("/timeout/seconds", test_seconds);
|
g_test_add_func ("/timeout/seconds", test_seconds);
|
||||||
g_test_add_func ("/timeout/weeks-overflow", test_weeks_overflow);
|
g_test_add_func ("/timeout/weeks-overflow", test_weeks_overflow);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user