summary refs log tree commit diff
path: root/clients/common/tests
diff options
context:
space:
mode:
Diffstat (limited to 'clients/common/tests')
-rw-r--r--clients/common/tests/meson.build50
-rw-r--r--clients/common/tests/test-clients-common.c14
-rw-r--r--clients/common/tests/test-libnm-core-aux.c4
3 files changed, 35 insertions, 33 deletions
diff --git a/clients/common/tests/meson.build b/clients/common/tests/meson.build
index 43b1f7c9..28b27ae9 100644
--- a/clients/common/tests/meson.build
+++ b/clients/common/tests/meson.build
@@ -1,45 +1,39 @@
-# SPDX-License-Identifier: LGPL-2.1+
-
-common_c_flags = clients_c_flags + ['-DNETWORKMANAGER_COMPILATION_TEST']
-
-test_name = 'test-clients-common'
-
-deps = [
-  libnmc_base_dep,
-  libnmc_dep,
-]
+# SPDX-License-Identifier: LGPL-2.1-or-later
 
 exe = executable(
-  test_name,
-  test_name + '.c',
-  dependencies: deps,
-  c_args: common_c_flags,
+  'test-clients-common',
+  'test-clients-common.c',
+  dependencies: [
+    libnmc_base_dep,
+    libnmc_dep,
+  ],
+  c_args: [
+    '-DG_LOG_DOMAIN="test"',
+  ],
 )
 
 test(
-  'clients/common/tests/' + test_name,
+  'clients/common/tests/test-clients-common',
   test_script,
   args: test_args + [exe.full_path()],
 )
 
-test_name = 'test-libnm-core-aux'
-
-deps = [
-  libnm_dep,
-  libnm_libnm_core_aux_dep,
-  libnm_nm_default_dep,
-]
-
 exe = executable(
-  test_name,
-  test_name + '.c',
-  dependencies: deps,
-  c_args: common_c_flags,
+  'test-libnm-core-aux',
+  'test-libnm-core-aux.c',
+  dependencies: [
+    libnm_dep,
+    libnm_libnm_core_aux_dep,
+    libnm_nm_default_dep,
+  ],
+  c_args: [
+    '-DG_LOG_DOMAIN="test"',
+  ],
   link_with: libnm_systemd_logging_stub,
 )
 
 test(
-  'clients/common/tests/' + test_name,
+  'clients/common/tests/test-libnm-core-aux',
   test_script,
   args: test_args + [exe.full_path()]
 )
diff --git a/clients/common/tests/test-clients-common.c b/clients/common/tests/test-clients-common.c
index 8a59d4e2..4336f0d5 100644
--- a/clients/common/tests/test-clients-common.c
+++ b/clients/common/tests/test-clients-common.c
@@ -1,9 +1,9 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
 /*
  * Copyright (C) 2017 Red Hat, Inc.
  */
 
-#include "nm-default.h"
+#include "libnm/nm-default-client.h"
 
 #include "nm-meta-setting-access.h"
 #include "nm-vpn-helpers.h"
@@ -53,6 +53,9 @@ test_client_meta_check(void)
 
     for (m = 0; m < _NM_META_SETTING_TYPE_NUM; m++) {
         const NMMetaSettingInfoEditor *info = &nm_meta_setting_infos_editor[m];
+        GType                          gtype;
+        NMSettingPriority              base_priority;
+        gboolean                       is_base_type;
 
         g_assert(info);
         g_assert(info->meta_type == &nm_meta_type_setting_info_editor);
@@ -97,6 +100,11 @@ test_client_meta_check(void)
         } else
             g_assert(!info->properties);
 
+        gtype         = info->general->get_setting_gtype();
+        base_priority = _nm_setting_type_get_base_type_priority(gtype);
+        is_base_type  = (base_priority != NM_SETTING_PRIORITY_INVALID);
+        g_assert((!!info->valid_parts) == is_base_type);
+
         if (info->valid_parts) {
             gsize              i, l;
             gs_unref_hashtable GHashTable *dup = g_hash_table_new(nm_direct_hash, NULL);
@@ -292,7 +300,7 @@ test_client_import_wireguard_missing(void)
                 g_assert_cmpint(-1, ==, *_p_error_line);                                     \
             g_assert(!_local);                                                               \
                                                                                              \
-            for (_i = 0; _i < G_N_ELEMENTS(_values); _i++) {                                 \
+            for (_i = 0; _i < (int) G_N_ELEMENTS(_values); _i++) {                           \
                 const NMUtilsNamedValue *_n = &_values[_i];                                  \
                 const char *             _v;                                                 \
                                                                                              \
diff --git a/clients/common/tests/test-libnm-core-aux.c b/clients/common/tests/test-libnm-core-aux.c
index 5b2b38fd..bf639878 100644
--- a/clients/common/tests/test-libnm-core-aux.c
+++ b/clients/common/tests/test-libnm-core-aux.c
@@ -1,9 +1,9 @@
-/* SPDX-License-Identifier: LGPL-2.1+ */
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
 /*
  * Copyright (C) 2019 Red Hat, Inc.
  */
 
-#include "nm-default.h"
+#include "libnm/nm-default-client.h"
 
 #include "nm-libnm-core-aux/nm-libnm-core-aux.h"
 #include "nm-libnm-core-intern/nm-libnm-core-utils.h"