1 #undef NDEBUG
2
3 #include <stdint.h>
4 #include <stdlib.h>
5 #include <assert.h>
6
7 #include "intel_device_info.h"
8 #include "intel_device_info_test.h"
9
10 int
main(int argc,char * argv[])11 main(int argc, char *argv[])
12 {
13 struct {
14 uint32_t pci_id;
15 const char *name;
16 } chipsets[] = {
17 #undef CHIPSET
18 #define CHIPSET(id, family, family_str, str_name, ...) { .pci_id = id, .name = str_name, },
19 #include "pci_ids/iris_pci_ids.h"
20 #include "pci_ids/crocus_pci_ids.h"
21 };
22
23 for (uint32_t i = 0; i < ARRAY_SIZE(chipsets); i++) {
24 struct intel_device_info devinfo = { 0, };
25 char force_probe[10];
26 int len = snprintf(force_probe, sizeof force_probe, "%x",
27 chipsets[i].pci_id);
28 assert(len < sizeof force_probe);
29
30 setenv("INTEL_FORCE_PROBE", force_probe, 1);
31 assert(intel_get_device_info_from_pci_id(chipsets[i].pci_id, &devinfo));
32
33 verify_device_info(&devinfo);
34 }
35
36 return 0;
37 }
38