| 52 | } |
| 53 | |
| 54 | static void test1(void) { |
| 55 | log_info("test1: jvm=%p", g_jvm); |
| 56 | |
| 57 | // 先获得当前线程所绑定的 JNIEnv 对象 |
| 58 | JNIEnv* env = get_env(); |
| 59 | if (env == NULL) { |
| 60 | log_error("test1: get_env null"); |
| 61 | return; |
| 62 | } |
| 63 | |
| 64 | const char* name = "com/example/http/HttpFiberThread"; |
| 65 | jclass clazz = env->FindClass(name); |
| 66 | log_info("test1: env=%p, clazz=%p", env, clazz); |
| 67 | |
| 68 | if (env->ExceptionOccurred()) { |
| 69 | log_error("test1: %d: some exception happened!", __LINE__); |
| 70 | env->ExceptionDescribe(); |
| 71 | env->ExceptionClear(); |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | static void test2(void) { |
| 76 | log_info("test2: jvm=%p", g_jvm); |
no test coverage detected
searching dependent graphs…