diff options
Diffstat (limited to 'tests/glib-fixture.h')
-rw-r--r-- | tests/glib-fixture.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/glib-fixture.h b/tests/glib-fixture.h index a8f3a76..65d2921 100644 --- a/tests/glib-fixture.h +++ b/tests/glib-fixture.h @@ -17,6 +17,9 @@ * Charles Kerr <charles.kerr@canonical.com> */ +#ifndef INDICATOR_TESTS_GLIB_FIXTURE_H +#define INDICATOR_TESTS_GLIB_FIXTURE_H + #include <map> #include <glib.h> @@ -52,7 +55,7 @@ class GlibFixture : public ::testing::Test if (expected_log[level] != n) for (size_t i=0; i<n; ++i) - g_message("%d %s", (n+1), v[i].c_str()); + g_print("%d %s\n", (n+1), v[i].c_str()); } expected_log.clear(); @@ -64,7 +67,7 @@ class GlibFixture : public ::testing::Test const gchar * message, gpointer self) { - auto tmp = g_strdup_printf ("%s:%d \"%s\"", log_domain, (int)log_level, message); + char* tmp = g_strdup_printf ("%s:%d \"%s\"", log_domain, (int)log_level, message); static_cast<GlibFixture*>(self)->log[log_level].push_back(tmp); g_free(tmp); } @@ -140,4 +143,10 @@ class GlibFixture : public ::testing::Test } GMainLoop * loop; + + public: + + virtual ~GlibFixture() =default; }; + +#endif /* INDICATOR_TESTS_GLIB_FIXTURE_H */ |