diff options
author | jeffhao <jeffhao@google.com> | 2011-09-29 17:41:15 -0700 |
---|---|---|
committer | jeffhao <jeffhao@google.com> | 2011-09-29 17:41:15 -0700 |
commit | 5d1ac920fdaef5d4ec8f66bb734488cd9660b024 (patch) | |
tree | dd372f306ab70f4c86759869b1f74eca62ff6f2b /test/056-const-string-jumbo | |
parent | c31664f3d82e6cd68275a529a8a73f067a52e8be (diff) | |
download | art-5d1ac920fdaef5d4ec8f66bb734488cd9660b024.tar.gz art-5d1ac920fdaef5d4ec8f66bb734488cd9660b024.tar.bz2 art-5d1ac920fdaef5d4ec8f66bb734488cd9660b024.zip |
Adding old unit tests to test suite.
These tests are copied straight over. They'll still run, but they're
using the old system.
Change-Id: If494519e52ddf858a9febfc55bdae830468cb3c8
Diffstat (limited to 'test/056-const-string-jumbo')
-rw-r--r-- | test/056-const-string-jumbo/build | 47 | ||||
-rw-r--r-- | test/056-const-string-jumbo/expected.txt | 1 | ||||
-rw-r--r-- | test/056-const-string-jumbo/info.txt | 1 | ||||
-rw-r--r-- | test/056-const-string-jumbo/src/Main.java | 21 |
4 files changed, 70 insertions, 0 deletions
diff --git a/test/056-const-string-jumbo/build b/test/056-const-string-jumbo/build new file mode 100644 index 000000000..c5e35dbbc --- /dev/null +++ b/test/056-const-string-jumbo/build @@ -0,0 +1,47 @@ +#!/bin/bash +# +# Copyright (C) 2008 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Stop if something fails. +set -e + +# Write out files with 32768 total static string declarations, so that +# the reference to "zorch" in the real test file will be guaranteed to +# need a jumbo string reference (it sorts last after all the others). +# Note: Each string reference is stored in a separate static variable, +# and that variable's name is also represented in the strings, which +# is why we can just have 32768 and not 65536 declarations. + +awk ' +BEGIN { + writeFile("Zorch1", 0, 16383); + writeFile("Zorch2", 16384, 32767); +} +function writeFile(name, start, end) { + fileName = "src/" name ".java"; + printf("public class %s {\n", name) > fileName; + for (i = start; i <= end; i++) { + printf(" static public final String s%d = \"%d\";\n", + i, i) > fileName; + } + printf("}\n") > fileName; +}' + +mkdir classes +${JAVAC} -d classes src/*.java + +dx -JXmx500m --debug --dex --no-optimize --positions=none --no-locals \ + --dump-to=classes.lst --output=classes.dex classes +zip test.jar classes.dex diff --git a/test/056-const-string-jumbo/expected.txt b/test/056-const-string-jumbo/expected.txt new file mode 100644 index 000000000..bebbf9e7e --- /dev/null +++ b/test/056-const-string-jumbo/expected.txt @@ -0,0 +1 @@ +zorch diff --git a/test/056-const-string-jumbo/info.txt b/test/056-const-string-jumbo/info.txt new file mode 100644 index 000000000..c4ba85600 --- /dev/null +++ b/test/056-const-string-jumbo/info.txt @@ -0,0 +1 @@ +Test that the opcode const-string/jumbo works. diff --git a/test/056-const-string-jumbo/src/Main.java b/test/056-const-string-jumbo/src/Main.java new file mode 100644 index 000000000..68d6e539e --- /dev/null +++ b/test/056-const-string-jumbo/src/Main.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +public class Main { + static public void main(String[] args) { + System.out.println("zorch"); + } +} |