aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2014-07-28 17:34:17 +0200
committerMichael S. Tsirkin <mst@redhat.com>2014-07-29 12:26:12 +0200
commitcb348985abd3673b40c8af069c3e3b84f547b6f7 (patch)
treec2988d77fa189c742b6740362ba8e98d5dc9d191
parent07fb61760cdea7c3f1b9c897513986945bca8e89 (diff)
bios-tables-test: fix ASL normalization false positive
My version of IASL (from RHEL7) puts two newlines between the head comment and the DefinitionBlock property. Kill all newlines after the comment, so that normalize_asl works properly. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
-rw-r--r--tests/bios-tables-test.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c
index 62771f7608..045eb27577 100644
--- a/tests/bios-tables-test.c
+++ b/tests/bios-tables-test.c
@@ -487,7 +487,11 @@ static GString *normalize_asl(gchar *asl_code)
/* strip comments (different generation days) */
comment = g_strstr_len(asl->str, asl->len, COMMENT_END);
if (comment) {
- asl = g_string_erase(asl, 0, comment + sizeof(COMMENT_END) - asl->str);
+ comment += strlen(COMMENT_END);
+ while (*comment == '\n') {
+ comment++;
+ }
+ asl = g_string_erase(asl, 0, comment - asl->str);
}
/* strip def block name (it has file path in it) */