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-04-05 14:20:17 +0800
commit32ad7f08f23a0d9e1f5a09c186e383ebe4cce51f (patch)
tree87a6b48e7a711c5772d809c6d72a1ec307ee7706 /tests
parent5f9e3c616657378354ed5ca1e4d0c91e33afceca (diff)
downloadlibufdt-32ad7f08f23a0d9e1f5a09c186e383ebe4cce51f.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 (cherry picked from commit 3407a9c362f9c3930c68ab0548184a8215a9f8bd)
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 {};
+};