mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-27 16:06:16 +01:00
parent
53a436221f
commit
f64d6640d4
@ -33,6 +33,7 @@
|
|||||||
static void
|
static void
|
||||||
debug (void)
|
debug (void)
|
||||||
{
|
{
|
||||||
|
if (g_test_verbose ())
|
||||||
g_debug ("this is a regular g_debug() from the test suite");
|
g_debug ("this is a regular g_debug() from the test suite");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,36 +43,42 @@ info (void)
|
|||||||
#ifdef g_info
|
#ifdef g_info
|
||||||
#error "rewrite this to use g_info()"
|
#error "rewrite this to use g_info()"
|
||||||
#endif
|
#endif
|
||||||
|
if (g_test_verbose ())
|
||||||
g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, "this is a regular g_log(..., G_LOG_LEVEL_INFO, ...) from the test suite");
|
g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, "this is a regular g_log(..., G_LOG_LEVEL_INFO, ...) from the test suite");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
message (void)
|
message (void)
|
||||||
{
|
{
|
||||||
|
if (g_test_verbose ())
|
||||||
g_message ("this is a regular g_message() from the test suite");
|
g_message ("this is a regular g_message() from the test suite");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
warning (void)
|
warning (void)
|
||||||
{
|
{
|
||||||
|
if (g_test_verbose ())
|
||||||
g_warning ("this is a regular g_warning() from the test suite");
|
g_warning ("this is a regular g_warning() from the test suite");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
critical (void)
|
critical (void)
|
||||||
{
|
{
|
||||||
|
if (g_test_verbose ())
|
||||||
g_critical ("this is a regular g_critical() from the test suite");
|
g_critical ("this is a regular g_critical() from the test suite");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
error (void)
|
error (void)
|
||||||
{
|
{
|
||||||
|
if (g_test_verbose ())
|
||||||
g_error ("this is a regular g_error() from the test suite");
|
g_error ("this is a regular g_error() from the test suite");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtest_message (void)
|
gtest_message (void)
|
||||||
{
|
{
|
||||||
|
if (g_test_verbose ())
|
||||||
g_test_message ("this is a regular g_test_message() from the test suite");
|
g_test_message ("this is a regular g_test_message() from the test suite");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,9 +121,10 @@ test_message (void)
|
|||||||
gchar* argv[] = {
|
gchar* argv[] = {
|
||||||
"./protocol",
|
"./protocol",
|
||||||
NULL,
|
NULL,
|
||||||
"-p", "/glib/testing/protocol:debug",
|
"--verbose",
|
||||||
"-p", "/glib/testing/protocol:message",
|
"-p", "/glib/testing/protocol/debug",
|
||||||
"-p", "/glib/testing/protocol:gtest-message",
|
"-p", "/glib/testing/protocol/message",
|
||||||
|
"-p", "/glib/testing/protocol/gtest-message",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
GTestLogBuffer* tlb;
|
GTestLogBuffer* tlb;
|
||||||
@ -221,9 +229,9 @@ static void
|
|||||||
test_error (void)
|
test_error (void)
|
||||||
{
|
{
|
||||||
gchar* tests[] = {
|
gchar* tests[] = {
|
||||||
"/glib/testing/protocol:warning",
|
"/glib/testing/protocol/warning",
|
||||||
"/glib/testing/protocol:critical",
|
"/glib/testing/protocol/critical",
|
||||||
"/glib/testing/protocol:error"
|
"/glib/testing/protocol/error"
|
||||||
};
|
};
|
||||||
gint i;
|
gint i;
|
||||||
int messages = 0;
|
int messages = 0;
|
||||||
@ -233,6 +241,7 @@ test_error (void)
|
|||||||
gchar* argv[] = {
|
gchar* argv[] = {
|
||||||
"./protocol",
|
"./protocol",
|
||||||
NULL,
|
NULL,
|
||||||
|
"--verbose",
|
||||||
"-p", tests[i],
|
"-p", tests[i],
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
@ -330,13 +339,13 @@ main (int argc,
|
|||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, NULL);
|
||||||
|
|
||||||
/* we use ourself as the testcase, these are the ones we need internally */
|
/* we use ourself as the testcase, these are the ones we need internally */
|
||||||
g_test_add_func ("/glib/testing/protocol:debug", debug);
|
g_test_add_func ("/glib/testing/protocol/debug", debug);
|
||||||
g_test_add_func ("/glib/testing/protocol:info", info);
|
g_test_add_func ("/glib/testing/protocol/info", info);
|
||||||
g_test_add_func ("/glib/testing/protocol:message", message);
|
g_test_add_func ("/glib/testing/protocol/message", message);
|
||||||
g_test_add_func ("/glib/testing/protocol:warning", warning);
|
g_test_add_func ("/glib/testing/protocol/warning", warning);
|
||||||
g_test_add_func ("/glib/testing/protocol:critical", critical);
|
g_test_add_func ("/glib/testing/protocol/critical", critical);
|
||||||
g_test_add_func ("/glib/testing/protocol:error", error);
|
g_test_add_func ("/glib/testing/protocol/error", error);
|
||||||
g_test_add_func ("/glib/testing/protocol:gtest-message", gtest_message);
|
g_test_add_func ("/glib/testing/protocol/gtest-message", gtest_message);
|
||||||
|
|
||||||
/* these are the real tests */
|
/* these are the real tests */
|
||||||
g_test_add_func ("/glib/testing/protocol/test-message", test_message);
|
g_test_add_func ("/glib/testing/protocol/test-message", test_message);
|
||||||
|
Loading…
Reference in New Issue
Block a user