mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-09-18 15:42:15 +00:00
libnm-util/test: use "nm-test-utils.h" in test-setting-dcb
This commit is contained in:
parent
120847c8a3
commit
9fdc5e6596
|
@ -454,6 +454,16 @@ __nmtst_init (int *argc, char ***argv, gboolean assert_logging, const char *log_
|
|||
/* ensure that monotonic timestamp is called (because it initially logs a line) */
|
||||
nm_utils_get_monotonic_timestamp_s ();
|
||||
#endif
|
||||
|
||||
#ifdef NM_UTILS_H
|
||||
{
|
||||
gs_free_error GError *error = NULL;
|
||||
|
||||
if (!nm_utils_init (&error))
|
||||
g_assert_not_reached ();
|
||||
g_assert_no_error (error);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef __NETWORKMANAGER_LOGGING_H__
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
#include "nm-default.h"
|
||||
#include "nm-setting-dcb.h"
|
||||
|
||||
#include "nm-test-utils.h"
|
||||
|
||||
#define DCB_FLAGS_ALL (NM_SETTING_DCB_FLAG_ENABLE | \
|
||||
NM_SETTING_DCB_FLAG_ADVERTISE | \
|
||||
NM_SETTING_DCB_FLAG_WILLING)
|
||||
|
@ -299,22 +301,11 @@ test_dcb_bandwidth_sums (void)
|
|||
|
||||
#define TPATH "/libnm-util/settings/dcb/"
|
||||
|
||||
NMTST_DEFINE ();
|
||||
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
GError *error = NULL;
|
||||
gboolean success;
|
||||
|
||||
g_test_init (&argc, &argv, NULL);
|
||||
|
||||
nm_g_type_init ();
|
||||
|
||||
success = nm_utils_init (&error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (success);
|
||||
|
||||
#if !GLIB_CHECK_VERSION(2,34,0)
|
||||
g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL);
|
||||
#endif
|
||||
nmtst_init (&argc, &argv, TRUE);
|
||||
|
||||
g_test_add_func (TPATH "flags-valid", test_dcb_flags_valid);
|
||||
g_test_add_func (TPATH "flags-invalid", test_dcb_flags_invalid);
|
||||
|
|
Loading…
Reference in a new issue