问题:我不确定这个 cts 测试在哪里比较什么 xml 文件。
当我运行这个特定的 CTS 测试用例时run cts -p android.tests.sigtest
它失败并抱怨如下:
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:
从打印的问题是
08-20 15:40:40.957 7195 7208 I TestRunner: mismatch_field: android.os.Build#BOARD(java.lang.String)
通过查看 Build.java 我看到它从"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)
在跟踪“ro.product.board”一段时间后,我看到它是在 make 文件中定义的。/device/abc_company/device_name.mk
这完全没问题。
但是查看测试用例本身,我发现它正在读取一个 xml 文件。看起来这个 xml 文件已经是二进制文件(例如 *.apk),所以我不知道它在哪里或它是什么。
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 )
最后,我想知道这个 xml 文件在哪里。
谢谢...