17 const char *record_id;
21 static int check_case(const profile_case *test) {
22 dvd_hlds_e7_profile_info info;
23 bool exact = dvd_lookup_hlds_e7_profile(
28 u_int32_t detected = dvd_detect_hlds_e7_type_for_identity(
33 if (exact != test->exact) {
35 "FAIL: %s exact=%d expected=%d\n",
36 test->label, (int) exact, (int) test->exact);
40 if (detected != test->type) {
42 "FAIL: %s type=%u expected=%u\n",
43 test->label, detected, test->type);
48 printf("PASS: %s legacy type=%u\n", test->label, detected);
53 info.type != test->type ||
54 info.static_cdb_base != test->cdb ||
55 info.static_gate != test->gate ||
56 info.mem_blocks != test->blocks ||
57 info.preferred_method != test->method ||
59 strcmp(info.tokens, test->tokens) != 0 ||
61 strcmp(info.record_id, test->record_id) != 0
64 "FAIL: %s type=%u cdb=0x%03x gate=0x%08x "
65 "blocks=%u method=%d tokens=%s record=%s\n",
71 info.preferred_method,
72 info.tokens ? info.tokens : "(null)",
73 info.record_id ? info.record_id : "(null)");
77 printf("PASS: %s exact cdb=0x%03x gate=0x%08x\n",
78 test->label, info.static_cdb_base, info.static_gate);
83 static const profile_case cases[] = {
85 "A102 live inquiry alias",
86 "HL-DT-ST", "CDRW/DVD GCC4243", "A102",
87 true, 3, 0x880U, 0x9003731dU, 5, 8,
88 "hybrid_identity_v3:stage5b_0439",
89 "HL;IT;RPC;RPC_JCS3;RPC_SUFFIX"
92 "A102 canonical alias",
93 "HL-DT-ST", "GCC-4243N", "a102",
94 true, 3, 0x880U, 0x9003731dU, 5, 8,
95 "hybrid_identity_v3:stage5b_0439",
96 "HL;IT;RPC;RPC_JCS3;RPC_SUFFIX"
99 "B101 live inquiry alias",
100 "HL-DT-ST", "CDRW/DVD GCC4244", "B101",
101 true, 3, 0x894U, 0x900386d2U, 5, 8,
102 "hybrid_identity_v3:stage5b_0426",
103 "HL;IT;RPC;RPC_JCS3;RPC_SUFFIX"
106 "B101 canonical alias",
107 "HL-DT-ST", "GCC-4244N", "b101",
108 true, 3, 0x894U, 0x900386d2U, 5, 8,
109 "hybrid_identity_v3:stage5b_0426",
110 "HL;IT;RPC;RPC_JCS3;RPC_SUFFIX"
113 "A101 existing canonical profile",
114 "HL-DT-ST", "GCC-4241N", "A101",
115 true, 21, 0x85cU, 0x900356b7U, 1, 8,
117 "HL;IT;RPC;RPC_JCS3;RPC_SUFFIX"
120 "GDR-8050L 0012 hybrid operating identity",
121 "HL-DT-ST", "DVD-ROM GDR8050L", "0012",
122 true, 44, 0x5d0U, 0x90026160U, 1, 8,
123 "hybrid_identity_v3:gdr8050l_0012",
124 "HL;IT;RPC;RPC_JD4_SPACE;RPC_SUFFIX"
127 "GDR-8050L 0L23 has no false exact metadata",
128 "HL-DT-ST", "DVD-ROM GDR8050L", "0L23",
129 false, 44, 0, 0, 0, 0, NULL, NULL
132 "A103 conservative Type3 fallback",
133 "HL-DT-ST", "CDRW/DVD GCC4243", "A103",
134 false, 3, 0, 0, 0, 0, NULL, NULL
137 "B102 conservative Type3 fallback",
138 "HL-DT-ST", "CDRW/DVD GCC4244", "B102",
139 false, 3, 0, 0, 0, 0, NULL, NULL
142 "non-HL vendor rejected",
143 "NOT-HL", "CDRW/DVD GCC4243", "A102",
144 false, 0, 0, 0, 0, 0, NULL, NULL
150 for (i = 0; i < sizeof(cases) / sizeof(cases[0]); i++)
151 ok &= check_case(&cases[i]);
156 printf("HLDS E7 PROFILE SELECTION TESTS: PASS\n");