Problem: I am not sure where and what xml file this cts test is comparing against.
When I run this particular CTS test case run cts -p android.tests.sigtest
it fails and complains as follows:
08-20 15:40:40.957 7195 7208 I TestRunner: failed: testSignature(android.tests.sigtest.SimpleSignatureTest)
08-20 15:40:40.957 7195 7208 I TestRunner: ----- begin exception -----
08-20 15:40:40.957 7195 7208 I TestRunner:
08-20 15:40:40.957 7195 7208 I TestRunner: junit.framework.AssertionFailedError:
08-20 15:40:40.957 7195 7208 I TestRunner: mismatch_field: android.os.Build#BOARD(java.lang.String)
08-20 15:40:40.957 7195 7208 I TestRunner: at junit.framework.Assert.fail(Assert.java:50)
08-20 15:40:40.957 7195 7208 I TestRunner: at android.tests.sigtest.SimpleSignatureTest.testSignature(SimpleSignatureTest.java:118)
08-20 15:40:40.957 7195 7208 I TestRunner: at java.lang.reflect.Method.invokeNative(Native Method)
08-20 15:40:40.957 7195 7208 I TestRunner: at java.lang.reflect.Method.invoke(Method.java:511)
08-20 15:40:40.957 7195 7208 I TestRunner: at junit.framework.TestCase.runTest(TestCase.java:168)
08-20 15:40:40.957 7195 7208 I TestRunner: at junit.framework.TestCase.runBare(TestCase.java:134)
08-20 15:40:40.957 7195 7208 I TestRunner: at junit.framework.TestResult$1.protect(TestResult.java:115)
08-20 15:40:40.957 7195 7208 I TestRunner: at junit.framework.TestResult.runProtected(TestResult.java:133)
08-20 15:40:40.957 7195 7208 I TestRunner: at junit.framework.TestResult.run(TestResult.java:118)
08-20 15:40:40.957 7195 7208 I TestRunner: at junit.framework.TestCase.run(TestCase.java:124)
08-20 15:40:40.957 7195 7208 I TestRunner: at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:190)
08-20 15:40:40.957 7195 7208 I TestRunner: at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:175)
08-20 15:40:40.957 7195 7208 I TestRunner: at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555)
08-20 15:40:40.957 7195 7208 I TestRunner: at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1799)
08-20 15:40:40.957 7195 7208 I TestRunner: ----- end exception -----
08-20 15:40:40.967 7195 7208 I TestRunner: finished:
From the prints the problem is
08-20 15:40:40.957 7195 7208 I TestRunner: mismatch_field: android.os.Build#BOARD(java.lang.String)
And by looking at Build.java I see it reading from "ro.product.board"
public static final String BOARD = getString("ro.product.board");
( http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/1.5_r4/android/os/Build.java )
after tracing "ro.product.board" for a while I see it is defined in the make file. /device/abc_company/device_name.mk
This is totally fine.
But looking at the test case itself, I see it is reading an xml file. It looks this xml file is already in binary (eg. *.apk) so I don't know where it is or what it is.
start(r.getXml(f.getInt(rClass)));
( ftp://ftp.heanet.ie/mirrors/sourceforge/s/su/supernovaics/ics/cts/tests/SignatureTest/src/android/tests/sigtest/SimpleSignatureTest.java )
At the very end what I would like to know is where this xml file is.
Thanks...
o从文件frameworks / base / api / current.txt在api.xml文件中生成了预期的集合。o在路径out / target / common / obj / APPS / SignatureTest_intermediates / api中生成了api.xml文件。 XML文件
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.