blob: 8cef72e52d429404242c7a68543158470998e95e [file] [log] [blame]
The Android Open Source Projectadc854b2009-03-03 19:28:47 -08001/*
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 Carlstrom44e0e562010-05-06 23:44:16 -070024static void emptyJniStaticMethod0(JNIEnv* env __attribute__ ((unused)), jclass clazz __attribute__ ((unused)))
The Android Open Source Projectadc854b2009-03-03 19:28:47 -080025{
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 Carlstrom44e0e562010-05-06 23:44:16 -070035static 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 Projectadc854b2009-03-03 19:28:47 -080037{
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 Carlstrom44e0e562010-05-06 23:44:16 -070047static 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 Projectadc854b2009-03-03 19:28:47 -080049{
50 // This space intentionally left blank.
51}
52
The Android Open Source Projectadc854b2009-03-03 19:28:47 -080053static JNINativeMethod gMethods[] = {
The Android Open Source Projectadc854b2009-03-03 19:28:47 -080054 { "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 Hughesc08f9fb2010-04-16 17:44:12 -070061int register_org_apache_harmony_dalvik_NativeTestTarget(JNIEnv* env) {
The Android Open Source Projectadc854b2009-03-03 19:28:47 -080062 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}