mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-11-05 19:03:31 +00:00
tests: add NMTST_EXPECT*() macros
Will be used next...
This commit is contained in:
parent
22ef6a507a
commit
66b80bd652
2 changed files with 22 additions and 0 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue