wifi: iwlwifi: tests: check for device names
authorJohannes Berg <johannes.berg@intel.com>
Fri, 2 May 2025 12:20:22 +0000 (15:20 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Tue, 6 May 2025 19:22:12 +0000 (22:22 +0300)
Add a unit test that checks that each device has a name,
either via the specific name entry or the config's name.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250502151751.c04287134280.Iedc7c05a41dc8bfe04dc8b95fea38543513eac2d@changeid
drivers/net/wireless/intel/iwlwifi/tests/devinfo.c

index 7ef5e89c6af27c1b46b1987f7827e3b84025fcb0..a64880fd33986bc54f9c2d68d2b57b13a4ce8554 100644 (file)
@@ -47,6 +47,17 @@ static void devinfo_table_order(struct kunit *test)
        }
 }
 
+static void devinfo_names(struct kunit *test)
+{
+       int idx;
+
+       for (idx = 0; idx < iwl_dev_info_table_size; idx++) {
+               const struct iwl_dev_info *di = &iwl_dev_info_table[idx];
+
+               KUNIT_ASSERT_TRUE(test, di->name || di->cfg->name);
+       }
+}
+
 static void devinfo_pci_ids(struct kunit *test)
 {
        struct pci_dev *dev;
@@ -71,6 +82,7 @@ static void devinfo_pci_ids(struct kunit *test)
 
 static struct kunit_case devinfo_test_cases[] = {
        KUNIT_CASE(devinfo_table_order),
+       KUNIT_CASE(devinfo_names),
        KUNIT_CASE(devinfo_pci_ids),
        {}
 };