Commit 66b80bd6 authored by Thomas Haller's avatar Thomas Haller

tests: add NMTST_EXPECT*() macros

Will be used next...
parent 22ef6a50
......@@ -670,6 +670,20 @@ nmtst_test_quick (void)
} G_STMT_END
#endif
#define NMTST_EXPECT(domain, level, msg) g_test_expect_message (domain, level, msg)
#if (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_UTIL
#define NMTST_EXPECT_LIBNM_U(level, msg) NMTST_EXPECT ("libnm-util", level, msg)
#define NMTST_EXPECT_LIBNM_G(level, msg) NMTST_EXPECT ("libnm-glib", level, msg)
#define NMTST_EXPECT_LIBNM_U_CRITICAL(msg) NMTST_EXPECT_LIBNM_U (G_LOG_LEVEL_CRITICAL, msg)
#define NMTST_EXPECT_LIBNM_G_CRITICAL(msg) NMTST_EXPECT_LIBNM_G (G_LOG_LEVEL_CRITICAL, msg)
#else
#define NMTST_EXPECT_LIBNM(level, msg) NMTST_EXPECT ("libnm", level, msg)
#define NMTST_EXPECT_LIBNM_CRITICAL(msg) NMTST_EXPECT_LIBNM (G_LOG_LEVEL_CRITICAL, msg)
#endif
/*****************************************************************************/
typedef struct _NmtstTestData NmtstTestData;
......
......@@ -30,6 +30,14 @@
/*****************************************************************************/
#define NMTST_EXPECT_NM(level, msg) NMTST_EXPECT ("NetworkManager", level, msg)
#define NMTST_EXPECT_NM_ERROR(msg) NMTST_EXPECT_NM (G_LOG_LEVEL_MESSAGE, "*<error> [*] "msg)
#define NMTST_EXPECT_NM_WARN(msg) NMTST_EXPECT_NM (G_LOG_LEVEL_MESSAGE, "*<warn> [*] "msg)
#define NMTST_EXPECT_NM_INFO(msg) NMTST_EXPECT_NM (G_LOG_LEVEL_INFO, "*<info> [*] "msg)
#define NMTST_EXPECT_NM_DEBUG(msg) NMTST_EXPECT_NM (G_LOG_LEVEL_DEBUG, "*<debug> [*] "msg)
#define NMTST_EXPECT_NM_TRACE(msg) NMTST_EXPECT_NM (G_LOG_LEVEL_DEBUG, "*<trace> [*] "msg)
static inline void
nmtst_init_with_logging (int *argc, char ***argv, const char *log_level, const char *log_domains)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment