From fe8520a97cc7cd03ac121cb3b9651578afe5456f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 16 Dec 2017 11:56:33 +0100 Subject: Check contents in string tests --- src/sord_test.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sord_test.c b/src/sord_test.c index ab2b918..9bb39a5 100644 --- a/src/sord_test.c +++ b/src/sord_test.c @@ -554,6 +554,8 @@ main(int argc, char** argv) str = sord_node_get_string_measured(lit_id2, &n_bytes, &n_chars); if (n_bytes != strlen("hello") || n_chars != strlen("hello")) { return test_fail("ASCII literal measured length incorrect\n"); + } else if (strcmp((const char*)str, "hello")) { + return test_fail("ASCII literal string incorrect\n"); } str = sord_node_get_string_measured(chello, &n_bytes, &n_chars); @@ -561,6 +563,8 @@ main(int argc, char** argv) return test_fail("Multi-byte literal byte count incorrect\n"); } else if (n_chars != 2) { return test_fail("Multi-byte literal character count incorrect\n"); + } else if (strcmp((const char*)str, (const char*)ni_hao)) { + return test_fail("Multi-byte literal string incorrect\n"); } // Check interning doesn't clash non-equivalent values -- cgit v1.2.1