summaryrefslogtreecommitdiff
path: root/startop/view_compiler/dex_builder_test
diff options
context:
space:
mode:
authorEric Holk <eholk@google.com>2019-07-26 09:37:46 -0700
committerEric Holk <eholk@google.com>2019-07-26 09:46:18 -0700
commit70445d0d89cb2b730e148cdb92e580585c1ef9c6 (patch)
tree0d5d2895a2921aa644d35ec65c6d5a76e7c09ccc /startop/view_compiler/dex_builder_test
parent3092f99ae63f12f5c18d40f21616c98f2b6c62af (diff)
[viewcompiler] Add support for static field put to DexBuilder
Bug: 111895153 Change-Id: I12b38fa520790debec545d7d1f6b3522a65ce03b
Diffstat (limited to 'startop/view_compiler/dex_builder_test')
-rw-r--r--startop/view_compiler/dex_builder_test/src/android/startop/test/DexBuilderTest.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/startop/view_compiler/dex_builder_test/src/android/startop/test/DexBuilderTest.java b/startop/view_compiler/dex_builder_test/src/android/startop/test/DexBuilderTest.java
index df11bfafd357..3138e7183226 100644
--- a/startop/view_compiler/dex_builder_test/src/android/startop/test/DexBuilderTest.java
+++ b/startop/view_compiler/dex_builder_test/src/android/startop/test/DexBuilderTest.java
@@ -180,4 +180,14 @@ public final class DexBuilderTest {
TestClass.staticInteger = 5;
Assert.assertEquals(5, method.invoke(null));
}
+
+ @Test
+ public void setStaticField() throws Exception {
+ ClassLoader loader = loadDexFile("simple.dex");
+ Class clazz = loader.loadClass("android.startop.test.testcases.SimpleTests");
+ Method method = clazz.getMethod("setStaticField");
+ TestClass.staticInteger = 5;
+ method.invoke(null);
+ Assert.assertEquals(7, TestClass.staticInteger);
+ }
}