我是靠谱客的博主 怕孤单香水,最近开发中收集的这篇文章主要介绍Android中使用JUnit4测试发生fatal error,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

在一个Android的项目中写了一个类,如下:
201209221852412947.png 
然后新建一个test文件夹,里面放入要测试的类方法,如下:
201209221852452504.png 
 
运行testConvertToGroup方法后发生错误为:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (classFileParser.cpp:3494), pid=10872, tid=11016
# Error: ShouldNotReachHere()
#
# JRE version: 6.0_31-b05
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20.6-b01 mixed mode windows-amd64 compressed oops)
# An error report file with more information is saved as:
# D:workspaceAndroidCalculatorhs_err_pid10872.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
 
截图如下:
201209221852495376.png 
 
log文件的内容为:
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (classFileParser.cpp:3494), pid=9956, tid=9252
#  Error: ShouldNotReachHere()
#
# JRE version: 6.0_31-b05
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20.6-b01 mixed mode windows-amd64 compressed oops)
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#
 
---------------  T H R E A D  ---------------
 
Current thread (0x000000000051c000):  JavaThread "Unknown thread" [_thread_in_vm, id=9252, stack(0x0000000002900000,0x0000000002a00000)]
 
Stack: [0x0000000002900000,0x0000000002a00000]
[error occurred during error reporting (printing stack bounds), id 0xc0000005]
 
 
---------------  P R O C E S S  ---------------
 
Java Threads: ( => current thread )
 
Other Threads:
 
=>0x000000000051c000 (exited) JavaThread "Unknown thread" [_thread_in_vm, id=9252, stack(0x0000000002900000,0x0000000002a00000)]
 
VM state:not at safepoint (not fully initialized)
 
VM Mutex/Monitor currently owned by a thread: None
 
Dynamic libraries:
0x0000000000400000 - 0x000000000042f000     C:Program FilesJavajdk1.6.0_31binjavaw.exe
0x0000000077530000 - 0x00000000776dc000     C:WindowsSYSTEM32ntdll.dll
0x0000000077310000 - 0x000000007742f000     C:Windowssystem32kernel32.dll
0x000007fefd380000 - 0x000007fefd3ec000     C:Windowssystem32KERNELBASE.dll
0x000007fefe6b0000 - 0x000007fefe78b000     C:Windowssystem32ADVAPI32.dll
0x000007feff410000 - 0x000007feff4af000     C:Windowssystem32msvcrt.dll
0x000007fefed30000 - 0x000007fefed4f000     C:WindowsSYSTEM32sechost.dll
0x000007feff710000 - 0x000007feff83e000     C:Windowssystem32RPCRT4.dll
0x0000000077430000 - 0x000000007752a000     C:Windowssystem32USER32.dll
0x000007feff3a0000 - 0x000007feff407000     C:Windowssystem32GDI32.dll
0x000007feff390000 - 0x000007feff39e000     C:Windowssystem32LPK.dll
0x000007fefe7c0000 - 0x000007fefe88a000     C:Windowssystem32USP10.dll
0x000007fefe790000 - 0x000007fefe7be000     C:Windowssystem32IMM32.DLL
0x000007fefe580000 - 0x000007fefe689000     C:Windowssystem32MSCTF.dll
0x000007fefd210000 - 0x000007fefd254000     C:Windowssystem32nvinitx.dll
0x000000000f000000 - 0x000000000f006000     C:Program FilesNVIDIA CorporationCoProcManager_etoured.dll
0x000007fefa900000 - 0x000007fefa945000     C:Program FilesNVIDIA CorporationCoProcManagernvd3d9wrapx.dll
0x000007feff080000 - 0x000007feff257000     C:Windowssystem32SETUPAPI.dll
0x000007fefd560000 - 0x000007fefd596000     C:Windowssystem32CFGMGR32.dll
0x000007fefed50000 - 0x000007fefee27000     C:Windowssystem32OLEAUT32.dll
0x000007fefeaa0000 - 0x000007fefeca2000     C:Windowssystem32ole32.dll
0x000007fefd680000 - 0x000007fefd69a000     C:Windowssystem32DEVOBJ.dll
0x000007fefa510000 - 0x000007fefa547000     C:Program FilesNVIDIA CorporationCoProcManagernvdxgiwrapx.dll
0x000000006d8b0000 - 0x000000006e068000     C:Program FilesJavajdk1.6.0_31jrebinserverjvm.dll
0x000007fefd5a0000 - 0x000007fefd5db000     C:Windowssystem32WINMM.dll
0x000000006d820000 - 0x000000006d82e000     C:Program FilesJavajdk1.6.0_31jrebinverify.dll
0x000000006d450000 - 0x000000006d477000     C:Program FilesJavajdk1.6.0_31jrebinjava.dll
0x000000006d870000 - 0x000000006d882000     C:Program FilesJavajdk1.6.0_31jrebinzip.dll
0x0000000077700000 - 0x0000000077707000     C:Windowssystem32PSAPI.DLL
 
VM Arguments:
jvm_args: -Dfile.encoding=UTF-8 -Xbootclasspath:D:DevelopToolsSDKandroid-sdk-windowsplatformsandroid-10android.jar
java_command: org.eclipse.jdt.internal.junit.runner.RemoteTestRunner -version 3 -port 52766 -testLoaderClass org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader -loaderpluginname org.eclipse.jdt.junit.runtime -test org.fra.utils.NumberUtilsTest:convertToGroupTest
Launcher Type: SUN_STANDARD
 
Environment Variables:
JAVA_HOME=C:Program FilesJavajdk1.6.0_31
CLASSPATH=.;C:Program FilesJavajdk1.6.0_31lib
PATH=C:Program Files (x86)InteliCLS Client;C:Program FilesInteliCLS Client;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;C:Program FilesIntelIntel(R) Management Engine ComponentsDAL;C:Program FilesIntelIntel(R) Management Engine ComponentsIPT;C:Program Files (x86)IntelIntel(R) Management Engine ComponentsDAL;C:Program Files (x86)IntelIntel(R) Management Engine ComponentsIPT;C:Program FilesIntelWiFibin;C:Program FilesCommon FilesIntelWirelessCommon;C:Program Files (x86)IntelOpenCL SDK2.0binx86;C:Program Files (x86)IntelOpenCL SDK2.0binx64;C:Program FilesJavajdk1.6.0_31bin;D:Program Files (x86)KingsoftWPS Office Personaloffice6;C:Program FilesTortoiseSVNbin;D:DevelopToolsSDKAndroid_SDKplantform-tools;D:Program FilesMySQLMySQL Server 5.1bin;D:Program Files (x86)EditPlus;D:Program Files (x86)SSH Communications SecuritySSH Secure Shell
USERNAME=Francis
OS=Windows_NT
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 58 Stepping 9, GenuineIntel
 
 
 
---------------  S Y S T E M  ---------------
 
OS: Windows 7 , 64 bit Build 7600
 
CPU:total 8 (4 cores per cpu, 2 threads per core) family 6 model 58 stepping 9, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, ht
 
Memory: 4k page, physical 8285500k(5521920k free), swap 8283600k(5105872k free)
 
vm_info: Java HotSpot(TM) 64-Bit Server VM (20.6-b01) for windows-amd64 JRE (1.6.0_31-b05), built on Feb  3 2012 18:34:57 by "java_re" with MS VC++ 8.0 (VS2005)
 
time: Sat Sep 22 18:22:37 2012
elapsed time: 0 seconds
 
 
但是这个方法在非Android项目中时可以运行,而且是成功的,如下:
201209221852542872.png 
运行结果:
201209221852566517.png 
真是奇怪了。

转载于:https://www.cnblogs.com/kakafra/archive/2012/09/22/2698311.html

最后

以上就是怕孤单香水为你收集整理的Android中使用JUnit4测试发生fatal error的全部内容,希望文章能够帮你解决Android中使用JUnit4测试发生fatal error所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(37)

评论列表共有 0 条评论

立即
投稿
返回
顶部