summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSzuWei Lin <szuweilin@google.com>2017-03-28 17:14:56 +0800
committerSzuWei Lin <szuweilin@google.com>2017-03-29 13:29:48 +0800
commit3407a9c362f9c3930c68ab0548184a8215a9f8bd (patch)
tree87a6b48e7a711c5772d809c6d72a1ec307ee7706 /tests
parent523ab1c32a3ec29b74b53430bd0abfea71e91aee (diff)
downloadlibufdt-3407a9c362f9c3930c68ab0548184a8215a9f8bd.tar.gz
Fix the problem of not enough merged dtb size
The dtc has suffix compression for string, ex. "a_string", "string" and "ing", these strings could share a same string in dtb string table. libufdt assumes the merged dtb size shouldn't larger than the summary size of base and overlay dtb, and doesn't apply the same compression. The patch add a test case for this case and fix the problem. Bug: 35255584 Test: tests/run_tests.sh Change-Id: I6bac1e2823ca90dbdb852452544c41ab040a5ccc
Diffstat (limited to 'tests')
-rwxr-xr-xtests/run_tests.sh3
-rw-r--r--tests/testdata/suffix_compress-base.dts18
-rw-r--r--tests/testdata/suffix_compress-overlay.dts6
3 files changed, 27 insertions, 0 deletions
diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index 4513950..ea3e5ba 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -69,6 +69,9 @@ main() {
run_test_case \
"empty_overlay" \
"Run test about overlaying with empty base and overlay dt"
+ run_test_case \
+ "suffix_compress" \
+ "Run test about string suffix compression"
)
if [ $? -ne 0 ]; then
diff --git a/tests/testdata/suffix_compress-base.dts b/tests/testdata/suffix_compress-base.dts
new file mode 100644
index 0000000..1c51284
--- /dev/null
+++ b/tests/testdata/suffix_compress-base.dts
@@ -0,0 +1,18 @@
+/dts-v1/;
+
+/ {
+ /* these name could be suffix compressed in dtb after compiled */
+ longlonglonglonglonglonglonglonglonglonglonglongname: longlonglonglonglonglonglonglonglonglonglonglongname {};
+ longlonglonglonglonglonglonglonglonglonglongname: longlonglonglonglonglonglonglonglonglonglongname {};
+ longlonglonglonglonglonglonglonglonglongname: longlonglonglonglonglonglonglonglonglongname {};
+ longlonglonglonglonglonglonglonglongname: longlonglonglonglonglonglonglonglongname {};
+ longlonglonglonglonglonglonglongname: longlonglonglonglonglonglonglongname {};
+ longlonglonglonglonglonglongname: longlonglonglonglonglonglongname {};
+ longlonglonglonglonglongname: longlonglonglonglonglongname {};
+ longlonglonglonglongname: longlonglonglonglongname {};
+ longlonglonglongname: longlonglonglongname {};
+ longlonglongname: longlonglongname {};
+ longlongname: longlongname {};
+ longname: longname {};
+};
+
diff --git a/tests/testdata/suffix_compress-overlay.dts b/tests/testdata/suffix_compress-overlay.dts
new file mode 100644
index 0000000..382e376
--- /dev/null
+++ b/tests/testdata/suffix_compress-overlay.dts
@@ -0,0 +1,6 @@
+/dts-v1/;
+/plugin/;
+
+&longname {
+ x {};
+};