The Android Open Source Project | adc854b | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2007 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #include "JNIHelp.h" |
| 18 | |
| 19 | /* |
| 20 | * public static void emptyJniStaticMethod0() |
| 21 | * |
| 22 | * For benchmarks, a do-nothing JNI method with no arguments. |
| 23 | */ |
Brian Carlstrom | 44e0e56 | 2010-05-06 23:44:16 -0700 | [diff] [blame^] | 24 | static void emptyJniStaticMethod0(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused))) |
The Android Open Source Project | adc854b | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 25 | { |
| 26 | // This space intentionally left blank. |
| 27 | } |
| 28 | |
| 29 | /* |
| 30 | * public static void emptyJniStaticMethod6(int a, int b, int c, |
| 31 | * int d, int e, int f) |
| 32 | * |
| 33 | * For benchmarks, a do-nothing JNI method with six arguments. |
| 34 | */ |
Brian Carlstrom | 44e0e56 | 2010-05-06 23:44:16 -0700 | [diff] [blame^] | 35 | static void emptyJniStaticMethod6(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), |
| 36 | int a __attribute__ ((unused)), int b __attribute__ ((unused)), int c __attribute__ ((unused)), int d __attribute__ ((unused)), int e __attribute__ ((unused)), int f __attribute__ ((unused))) |
The Android Open Source Project | adc854b | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 37 | { |
| 38 | // This space intentionally left blank. |
| 39 | } |
| 40 | |
| 41 | /* |
| 42 | * public static void emptyJniStaticMethod6L(String a, String[] b, |
| 43 | * int[][] c, Object d, Object[] e, Object[][][][] f) |
| 44 | * |
| 45 | * For benchmarks, a do-nothing JNI method with six arguments. |
| 46 | */ |
Brian Carlstrom | 44e0e56 | 2010-05-06 23:44:16 -0700 | [diff] [blame^] | 47 | static void emptyJniStaticMethod6L(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)), |
| 48 | jobject a __attribute__ ((unused)), jarray b __attribute__ ((unused)), jarray c __attribute__ ((unused)), jobject d __attribute__ ((unused)), jarray e __attribute__ ((unused)), jarray f __attribute__ ((unused))) |
The Android Open Source Project | adc854b | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 49 | { |
| 50 | // This space intentionally left blank. |
| 51 | } |
| 52 | |
The Android Open Source Project | adc854b | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 53 | static JNINativeMethod gMethods[] = { |
The Android Open Source Project | adc854b | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 54 | { "emptyJniStaticMethod0", "()V", emptyJniStaticMethod0 }, |
| 55 | { "emptyJniStaticMethod6", "(IIIIII)V", emptyJniStaticMethod6 }, |
| 56 | { "emptyJniStaticMethod6L", |
| 57 | "(Ljava/lang/String;[Ljava/lang/String;[[I" |
| 58 | "Ljava/lang/Object;[Ljava/lang/Object;[[[[Ljava/lang/Object;)V", |
| 59 | emptyJniStaticMethod6L }, |
| 60 | }; |
Elliott Hughes | c08f9fb | 2010-04-16 17:44:12 -0700 | [diff] [blame] | 61 | int register_org_apache_harmony_dalvik_NativeTestTarget(JNIEnv* env) { |
The Android Open Source Project | adc854b | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 62 | int result = jniRegisterNativeMethods(env, |
| 63 | "org/apache/harmony/dalvik/NativeTestTarget", |
| 64 | gMethods, NELEM(gMethods)); |
| 65 | if (result != 0) { |
| 66 | /* print warning, but allow to continue */ |
| 67 | LOGW("WARNING: NativeTestTarget not registered\n"); |
| 68 | (*env)->ExceptionClear(env); |
| 69 | } |
| 70 | return 0; |
| 71 | } |