From bfe522304da217296e2a61040f58e35ec5d6f3f2 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Mon, 16 Aug 2021 09:51:46 +0200 Subject: New upstream version 1.30.6 --- src/core/tests/test-systemd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/core/tests/test-systemd.c') diff --git a/src/core/tests/test-systemd.c b/src/core/tests/test-systemd.c index 03576c13..fa510366 100644 --- a/src/core/tests/test-systemd.c +++ b/src/core/tests/test-systemd.c @@ -247,11 +247,11 @@ _test_unbase64mem_mem(const char *base64, const guint8 *expected_arr, gsize expe { gs_free char *expected_base64 = NULL; int r; - gs_free guint8 *exp2_arr = NULL; - gs_free guint8 *exp3_arr = NULL; - gsize exp2_len; - gsize exp3_len; - gsize i; + nm_auto_free guint8 *exp2_arr = NULL; + nm_auto_free guint8 *exp3_arr = NULL; + gsize exp2_len; + gsize exp3_len; + gsize i; expected_base64 = g_base64_encode(expected_arr, expected_len); -- cgit 1.3.0-6-gf8a5 From e74c568b07b50b97873fb4ee1d776dedefbd54d6 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Fri, 1 Oct 2021 23:05:04 +0200 Subject: New upstream version 1.32.12 --- src/core/tests/test-systemd.c | 130 ++++++++++-------------------------------- 1 file changed, 31 insertions(+), 99 deletions(-) (limited to 'src/core/tests/test-systemd.c') diff --git a/src/core/tests/test-systemd.c b/src/core/tests/test-systemd.c index fa510366..12d2b911 100644 --- a/src/core/tests/test-systemd.c +++ b/src/core/tests/test-systemd.c @@ -3,68 +3,12 @@ * Copyright (C) 2016 Red Hat, Inc. */ -#include "src/core/systemd/nm-default-systemd.h" +#include "libnm-systemd-core/nm-default-systemd-core.h" -#include "systemd/nm-sd.h" -#include "systemd/nm-sd-utils-shared.h" +#include "libnm-systemd-core/nm-sd.h" +#include "libnm-systemd-shared/nm-sd-utils-shared.h" -#include "nm-test-utils-core.h" - -/***************************************************************************** - * Stub implementations of libNetworkManagerBase symbols - *****************************************************************************/ - -gboolean -nm_utils_get_testing_initialized(void) -{ - return TRUE; -} - -void -_nm_utils_set_testing(NMUtilsTestFlags flags) -{ - g_assert_not_reached(); -} - -gint32 -nm_utils_get_monotonic_timestamp_sec(void) -{ - return 1; -} - -NMLogDomain _nm_logging_enabled_state[_LOGL_N_REAL]; - -gboolean -_nm_log_enabled_impl(gboolean mt_require_locking, NMLogLevel level, NMLogDomain domain) -{ - return FALSE; -} - -void -_nm_log_impl(const char *file, - guint line, - const char *func, - gboolean mt_require_locking, - NMLogLevel level, - NMLogDomain domain, - int error, - const char *ifname, - const char *con_uuid, - const char *fmt, - ...) -{} - -gboolean -nm_logging_setup(const char *level, const char *domains, char **bad_domains, GError **error) -{ - return TRUE; -} - -const char * -nm_strerror_native(int errsv) -{ - return g_strerror(errsv); -} +#include "libnm-glib-aux/nm-test-utils.h" /*****************************************************************************/ @@ -178,46 +122,34 @@ test_sd_event(void) static void test_path_equal(void) { -#define _path_equal_check1(path, kill_dots, expected) \ - G_STMT_START \ - { \ - const gboolean _kill_dots = (kill_dots); \ - const char * _path0 = (path); \ - const char * _expected = (expected); \ - gs_free char * _path = g_strdup(_path0); \ - const char * _path_result; \ - \ - if (!_kill_dots && !nm_sd_utils_path_equal(_path0, _expected)) \ - g_error("Paths \"%s\" and \"%s\" don't compare equal", _path0, _expected); \ - \ - _path_result = nm_sd_utils_path_simplify(_path, _kill_dots); \ - g_assert(_path_result == _path); \ - g_assert_cmpstr(_path, ==, _expected); \ - } \ - G_STMT_END - -#define _path_equal_check(path, expected_no_kill_dots, expected_kill_dots) \ - G_STMT_START \ - { \ - _path_equal_check1(path, FALSE, expected_no_kill_dots); \ - _path_equal_check1(path, TRUE, expected_kill_dots ?: expected_no_kill_dots); \ - } \ +#define _path_equal_check(path, expected) \ + G_STMT_START \ + { \ + const char * _path0 = (path); \ + const char * _expected = (expected); \ + gs_free char *_path = g_strdup(_path0); \ + const char * _path_result; \ + \ + _path_result = nm_sd_utils_path_simplify(_path); \ + g_assert(_path_result == _path); \ + g_assert_cmpstr(_path, ==, _expected); \ + } \ G_STMT_END - _path_equal_check("", "", NULL); - _path_equal_check(".", ".", NULL); - _path_equal_check("..", "..", NULL); - _path_equal_check("/..", "/..", NULL); - _path_equal_check("//..", "/..", NULL); - _path_equal_check("/.", "/.", "/"); - _path_equal_check("./", ".", "."); - _path_equal_check("./.", "./.", "."); - _path_equal_check(".///.", "./.", "."); - _path_equal_check(".///./", "./.", "."); - _path_equal_check(".////", ".", "."); - _path_equal_check("//..//foo/", "/../foo", NULL); - _path_equal_check("///foo//./bar/.", "/foo/./bar/.", "/foo/bar"); - _path_equal_check(".//./foo//./bar/.", "././foo/./bar/.", "foo/bar"); + _path_equal_check("", ""); + _path_equal_check(".", "."); + _path_equal_check("..", ".."); + _path_equal_check("/..", "/.."); + _path_equal_check("//..", "/.."); + _path_equal_check("/.", "/"); + _path_equal_check("./", "."); + _path_equal_check("./.", "."); + _path_equal_check(".///.", "."); + _path_equal_check(".///./", "."); + _path_equal_check(".////", "."); + _path_equal_check("//..//foo/", "/../foo"); + _path_equal_check("///foo//./bar/.", "/foo/bar"); + _path_equal_check(".//./foo//./bar/.", "foo/bar"); } /*****************************************************************************/ @@ -327,7 +259,7 @@ NMTST_DEFINE(); int main(int argc, char **argv) { - nmtst_init_assert_logging(&argc, &argv, "INFO", "ALL"); + nmtst_init(&argc, &argv, TRUE); g_test_add_func("/systemd/dhcp/create", test_dhcp_create); g_test_add_func("/systemd/lldp/create", test_lldp_create); -- cgit 1.3.0-6-gf8a5 From 88c227d90a6b7b388c5c85d72802a0ca8f05ed5c Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Thu, 13 Jan 2022 22:30:39 +0100 Subject: New upstream version 1.34.0 --- src/core/tests/test-systemd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/core/tests/test-systemd.c') diff --git a/src/core/tests/test-systemd.c b/src/core/tests/test-systemd.c index 12d2b911..be070248 100644 --- a/src/core/tests/test-systemd.c +++ b/src/core/tests/test-systemd.c @@ -36,14 +36,14 @@ test_dhcp_create(void) static void test_lldp_create(void) { - sd_lldp *lldp = NULL; - int r; + sd_lldp_rx *lldp = NULL; + int r; - r = sd_lldp_new(&lldp); + r = sd_lldp_rx_new(&lldp); g_assert(r == 0); g_assert(lldp); - sd_lldp_unref(lldp); + sd_lldp_rx_unref(lldp); } /*****************************************************************************/ -- cgit 1.3.0-6-gf8a5