diff options
author | Andreas Gampe <agampe@google.com> | 2014-07-22 18:52:29 -0700 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2014-07-23 10:03:00 -0700 |
commit | 1c83cbc4a817acbd7f9abb5b29a2d418a958e6a1 (patch) | |
tree | aae7ea1d5559718d6e264175aa1cb2ae1fc1e9ed /test/004-InterfaceTest | |
parent | 7dfc30b591aee167f0a38ab61a90894cc76f2066 (diff) | |
download | art-1c83cbc4a817acbd7f9abb5b29a2d418a958e6a1.zip art-1c83cbc4a817acbd7f9abb5b29a2d418a958e6a1.tar.gz art-1c83cbc4a817acbd7f9abb5b29a2d418a958e6a1.tar.bz2 |
ART: Make run tests out of oat tests
Transforms all former oat tests into run tests.
Change-Id: I190dd39456454c36e5538a2c044d993965a67533
Diffstat (limited to 'test/004-InterfaceTest')
-rw-r--r-- | test/004-InterfaceTest/expected.txt | 2 | ||||
-rw-r--r-- | test/004-InterfaceTest/info.txt | 1 | ||||
-rw-r--r-- | test/004-InterfaceTest/src/Main.java | 53 |
3 files changed, 56 insertions, 0 deletions
diff --git a/test/004-InterfaceTest/expected.txt b/test/004-InterfaceTest/expected.txt new file mode 100644 index 0000000..4854e24 --- /dev/null +++ b/test/004-InterfaceTest/expected.txt @@ -0,0 +1,2 @@ +test_virtual done +test_interface done diff --git a/test/004-InterfaceTest/info.txt b/test/004-InterfaceTest/info.txt new file mode 100644 index 0000000..00b0d9a --- /dev/null +++ b/test/004-InterfaceTest/info.txt @@ -0,0 +1 @@ +Imported from oat tests. diff --git a/test/004-InterfaceTest/src/Main.java b/test/004-InterfaceTest/src/Main.java new file mode 100644 index 0000000..9ebac59 --- /dev/null +++ b/test/004-InterfaceTest/src/Main.java @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2011 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. + */ + +import java.util.Map; +import java.util.HashMap; + +public class Main { + + public static long test_virtual(HashMap map) { + Integer intobj = new Integer(0); + String s = "asdf"; + long start = System.currentTimeMillis(); + for (int i = 0; i < 1000000; i++) { + map.put(intobj, s); + } + long end = System.currentTimeMillis(); + return (end - start); + } + + public static long test_interface(Map map) { + Integer intobj = new Integer(0); + String s = "asdf"; + long start = System.currentTimeMillis(); + for (int i = 0; i < 1000000; i++) { + map.put(intobj, s); + } + long end = System.currentTimeMillis(); + return (end - start); + } + + public static void main(String[] args) { + HashMap hashmap = new HashMap(); + long elapsed = test_virtual(hashmap); + System.out.println("test_virtual done"); + hashmap.clear(); + + elapsed = test_interface(hashmap); + System.out.println("test_interface done"); + } +} |