17 const char *record_id;
19 const char *support_tier;
22 static int check_case(const profile_case *test) {
23 dvd_hlds_e7_profile_info info;
24 bool exact = dvd_lookup_hlds_e7_profile(
29 u_int32_t detected = dvd_detect_hlds_e7_type_for_identity(
34 if (exact != test->exact) {
36 "FAIL: %s exact=%d expected=%d\n",
37 test->label, (int) exact, (int) test->exact);
41 if (detected != test->type) {
43 "FAIL: %s type=%u expected=%u\n",
44 test->label, detected, test->type);
49 printf("PASS: %s legacy type=%u\n", test->label, detected);
54 info.type != test->type ||
55 info.static_cdb_base != test->cdb ||
56 info.static_gate != test->gate ||
57 info.mem_blocks != test->blocks ||
58 info.preferred_method != test->method ||
60 strcmp(info.tokens, test->tokens) != 0 ||
62 strcmp(info.record_id, test->record_id) != 0 ||
64 strcmp(info.support_tier, test->support_tier) != 0
67 "FAIL: %s type=%u cdb=0x%03x gate=0x%08x "
68 "blocks=%u method=%d tokens=%s record=%s tier=%s\n",
74 info.preferred_method,
75 info.tokens ? info.tokens : "(null)",
76 info.record_id ? info.record_id : "(null)",
77 info.support_tier ? info.support_tier : "(null)");
81 printf("PASS: %s exact cdb=0x%03x gate=0x%08x\n",
82 test->label, info.static_cdb_base, info.static_gate);
87 static const profile_case cases[] = {
89 "A102 live inquiry alias",
90 "HL-DT-ST", "CDRW/DVD GCC4243", "A102",
91 true, 3, 0x880U, 0x9003731dU, 5, 8,
92 "hybrid_identity_v3:stage5b_0439",
93 "HL;IT;RPC;RPC_JCS3;RPC_SUFFIX",
94 "known_supported_profile_hardening_live_validated"
97 "A102 canonical alias",
98 "HL-DT-ST", "GCC-4243N", "a102",
99 true, 3, 0x880U, 0x9003731dU, 5, 8,
100 "hybrid_identity_v3:stage5b_0439",
101 "HL;IT;RPC;RPC_JCS3;RPC_SUFFIX",
102 "known_supported_profile_hardening_live_validated"
105 "B101 live inquiry alias",
106 "HL-DT-ST", "CDRW/DVD GCC4244", "B101",
107 true, 3, 0x894U, 0x900386d2U, 5, 8,
108 "hybrid_identity_v3:stage5b_0426",
109 "HL;IT;RPC;RPC_JCS3;RPC_SUFFIX",
110 "known_supported_profile_hardening_live_validated"
113 "B101 canonical alias",
114 "HL-DT-ST", "GCC-4244N", "b101",
115 true, 3, 0x894U, 0x900386d2U, 5, 8,
116 "hybrid_identity_v3:stage5b_0426",
117 "HL;IT;RPC;RPC_JCS3;RPC_SUFFIX",
118 "known_supported_profile_hardening_live_validated"
121 "A101 existing canonical profile",
122 "HL-DT-ST", "GCC-4241N", "A101",
123 true, 21, 0x85cU, 0x900356b7U, 1, 8,
125 "HL;IT;RPC;RPC_JCS3;RPC_SUFFIX",
126 "error_prone_supported_profile_hardening"
129 "GDR-8050L 0012 hybrid operating identity",
130 "HL-DT-ST", "DVD-ROM GDR8050L", "0012",
131 true, 44, 0x5d0U, 0x90026160U, 1, 8,
132 "hybrid_identity_v3:gdr8050l_0012",
133 "HL;IT;RPC;RPC_JD4_SPACE;RPC_SUFFIX",
134 "hybrid_crossflash_modified_firmware_only"
137 "GDR-8050L 0L23 has no false exact metadata",
138 "HL-DT-ST", "DVD-ROM GDR8050L", "0L23",
139 false, 44, 0, 0, 0, 0, NULL, NULL, NULL
142 "A103 conservative Type3 fallback",
143 "HL-DT-ST", "CDRW/DVD GCC4243", "A103",
144 false, 3, 0, 0, 0, 0, NULL, NULL, NULL
147 "B102 conservative Type3 fallback",
148 "HL-DT-ST", "CDRW/DVD GCC4244", "B102",
149 false, 3, 0, 0, 0, 0, NULL, NULL, NULL
152 "non-HL vendor rejected",
153 "NOT-HL", "CDRW/DVD GCC4243", "A102",
154 false, 0, 0, 0, 0, 0, NULL, NULL, NULL
160 for (i = 0; i < sizeof(cases) / sizeof(cases[0]); i++)
161 ok &= check_case(&cases[i]);
166 printf("HLDS E7 PROFILE SELECTION TESTS: PASS\n");