Commit fa22a93e authored by Johannes Berg's avatar Johannes Berg Committed by Miri Korenblit
Browse files

wifi: iwlwifi: tests: check for device names



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: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250502151751.c04287134280.Iedc7c05a41dc8bfe04dc8b95fea38543513eac2d@changeid
parent a925fe70
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -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),
	{}
};