aboutsummaryrefslogtreecommitdiff
path: root/tests/testdata.h
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2007-10-16 16:42:02 +1000
committerJon Loeliger <jdl@freescale.com>2007-10-16 08:10:15 -0500
commita756c12bea9e39acbed483d9008852f3a371e4a4 (patch)
tree8ab2b1ce49c726a0df2811ab3f7e359163070b0c /tests/testdata.h
parent333542fabf8720b881e992a5abca32ef4bcb841a (diff)
downloaddtc-a756c12bea9e39acbed483d9008852f3a371e4a4.zip
dtc-a756c12bea9e39acbed483d9008852f3a371e4a4.tar.gz
dtc-a756c12bea9e39acbed483d9008852f3a371e4a4.tar.bz2
dtc: Improve support for string escapes
dtc supports the use of C-style escapes (\n, \t and so forth) in string property definitions via the data_copy_escape_string() function. However, while it supports the most common escape characters, it doesn't support the full set that C does, which is a potential gotcha. Worse, a bug in the lexer means that while data_copy_escape_string() can handle the \" escape, a string with such an escape won't lex correctly. This patch fixes both problems, extending data_copy_escape_string() to support the missing escapes, and fixing the regex for strings in the lexer to handle internal escaped quotes. This also adds a testcase for string escape functionality. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'tests/testdata.h')
-rw-r--r--tests/testdata.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/testdata.h b/tests/testdata.h
index 3d08ff7..525177f 100644
--- a/tests/testdata.h
+++ b/tests/testdata.h
@@ -24,6 +24,7 @@
#define TEST_VALUE_2 cell_to_fdt(0xabcd1234)
#define TEST_STRING_1 "hello world"
+#define TEST_STRING_2 "nastystring: \a\b\t\n\v\f\r\\\"\xff"
#ifndef __ASSEMBLY__
extern struct fdt_header _test_tree1;