Skip to content

Commit 408ca92

Browse files
Igor Mammedovmstsirkin
authored andcommitted
tests: acpi: test short OEM_ID/OEM_TABLE_ID values in test_oem_fields()
Previous patch [1] added explicit whitespace padding to OEM_ID/OEM_TABLE_ID values used in test_oem_fields() testcase to avoid false positive and bisection issues when QEMU is switched to \0' padding. As result testcase ceased to test values that were shorter than max possible length values. Update testcase to make sure that it's testing shorter IDs like it used to before [2]. 1) "tests: acpi: manually pad OEM_ID/OEM_TABLE_ID for test_oem_fields() test" 2) 602b458 ("acpi: Permit OEM ID and OEM table ID fields to be changed") Signed-off-by: Igor Mammedov <[email protected]> Message-Id: <[email protected]> Reviewed-by: Michael S. Tsirkin <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 5adc3ab commit 408ca92

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/qtest/bios-tables-test.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@
7171

7272
#define ACPI_REBUILD_EXPECTED_AML "TEST_ACPI_REBUILD_AML"
7373

74-
#define OEM_ID "TEST "
75-
#define OEM_TABLE_ID "OEM "
76-
#define OEM_TEST_ARGS "-machine x-oem-id='" OEM_ID "',x-oem-table-id='" \
77-
OEM_TABLE_ID "'"
74+
#define OEM_ID "TEST"
75+
#define OEM_TABLE_ID "OEM"
76+
#define OEM_TEST_ARGS "-machine x-oem-id=" OEM_ID ",x-oem-table-id=" \
77+
OEM_TABLE_ID
7878

7979
typedef struct {
8080
bool tcg_only;
@@ -1530,8 +1530,8 @@ static void test_oem_fields(test_data *data)
15301530
continue;
15311531
}
15321532

1533-
g_assert(memcmp(sdt->aml + 10, OEM_ID, 6) == 0);
1534-
g_assert(memcmp(sdt->aml + 16, OEM_TABLE_ID, 8) == 0);
1533+
g_assert(strncmp((char *)sdt->aml + 10, OEM_ID, 6) == 0);
1534+
g_assert(strncmp((char *)sdt->aml + 16, OEM_TABLE_ID, 8) == 0);
15351535
}
15361536
}
15371537

0 commit comments

Comments
 (0)