I am working on fixing a JNI call that is currently crashing. Aiming to be a good TDD practitioner, I created a JUnit test to reproduce the problem, which makes it excellent.
However, failure, the JNI call never returns. Can I write a JUnit test that reports an error when a JNI crashes?
Oh, if your JNI is crashing into the JVM, then of course it will be difficult to check from junit. For example, you cannot connect a signal handler for SIGSEGV, the JVM will just die.
, Java- Main, , junit Java, - Runtime # exec.
- , .
: http://junit.sourceforge.net/javadoc/org/junit/Test.html, junit 4, - : http://netbeans.org/kb/docs/java/junit-intro.html#Exercise_243