aboutsummaryrefslogtreecommitdiff
path: root/core/test
diff options
context:
space:
mode:
authorOliver O'Halloran <oohall@gmail.com>2016-12-21 16:35:36 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-03-07 17:43:51 +1100
commit0cdfe0b14780152ebec39f21cf99f37d4330843d (patch)
treed603770de4be5a4009b1e7f8de98c5dcebb76946 /core/test
parent65561f0e9362d6373afbc62de510720b76c238e0 (diff)
downloadskiboot-0cdfe0b14780152ebec39f21cf99f37d4330843d.zip
skiboot-0cdfe0b14780152ebec39f21cf99f37d4330843d.tar.gz
skiboot-0cdfe0b14780152ebec39f21cf99f37d4330843d.tar.bz2
core/test: use strcmp for console tests
The console logging tests use a memcmp and strlen() with string literal arguments. Unfortunately the strings were updated at some point and not kept in sync. strcmp() should be fine here so use that instead. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/test')
-rw-r--r--core/test/run-console-log-pr_fmt.c6
-rw-r--r--core/test/run-console-log.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/core/test/run-console-log-pr_fmt.c b/core/test/run-console-log-pr_fmt.c
index 03ee476..ae9d206 100644
--- a/core/test/run-console-log-pr_fmt.c
+++ b/core/test/run-console-log-pr_fmt.c
@@ -52,7 +52,7 @@ int main(void)
debug_descriptor.console_log_levels = 0x75;
prlog(PR_EMERG, "Hello World");
- assert(memcmp(console_buffer, "[ 0.000000042,0] PREFIX: Hello World", strlen("[ 0.000042,0] PREFIX: Hello World")) == 0);
+ assert(strcmp(console_buffer, "[ 0.000000042,0] PREFIX: Hello World") == 0);
assert(flushed_to_drivers==true);
memset(console_buffer, 0, sizeof(console_buffer));
@@ -63,11 +63,11 @@ int main(void)
// Should not be flushed to console
prlog(PR_DEBUG, "Hello World");
- assert(memcmp(console_buffer, "[ 0.000000042,7] PREFIX: Hello World", strlen("[ 0.000042,7] PREFIX: Hello World")) == 0);
+ assert(strcmp(console_buffer, "[ 0.000000042,7] PREFIX: Hello World") == 0);
assert(flushed_to_drivers==false);
printf("Hello World");
- assert(memcmp(console_buffer, "[ 0.000000042,5] PREFIX: Hello World", strlen("[ 0.000042,5] PREFIX: Hello World")) == 0);
+ assert(strcmp(console_buffer, "[ 0.000000042,5] PREFIX: Hello World") == 0);
assert(flushed_to_drivers==true);
return 0;
diff --git a/core/test/run-console-log.c b/core/test/run-console-log.c
index 6d6d366..01376ee 100644
--- a/core/test/run-console-log.c
+++ b/core/test/run-console-log.c
@@ -52,7 +52,7 @@ int main(void)
debug_descriptor.console_log_levels = 0x75;
prlog(PR_EMERG, "Hello World");
- assert(memcmp(console_buffer, "[ 0.000000042,0] Hello World", strlen("[ 0.000042,0] Hello World")) == 0);
+ assert(strcmp(console_buffer, "[ 0.000000042,0] Hello World") == 0);
assert(flushed_to_drivers==true);
memset(console_buffer, 0, sizeof(console_buffer));
@@ -63,11 +63,11 @@ int main(void)
// Should not be flushed to console
prlog(PR_DEBUG, "Hello World");
- assert(memcmp(console_buffer, "[ 0.000000042,7] Hello World", strlen("[ 0.000042,7] Hello World")) == 0);
+ assert(strcmp(console_buffer, "[ 0.000000042,7] Hello World") == 0);
assert(flushed_to_drivers==false);
printf("Hello World");
- assert(memcmp(console_buffer, "[ 0.000000042,5] Hello World", strlen("[ 0.000042,5] Hello World")) == 0);
+ assert(strcmp(console_buffer, "[ 0.000000042,5] Hello World") == 0);
assert(flushed_to_drivers==true);
return 0;