Commit 742d3f18 authored by Aiden Benner's avatar Aiden Benner Committed by Commit Bot

jni_generator: Refactor/clean up tests

- Move golden/javap files to jni_generator/golden/
- Make method capitalization more consistent with jni_generator py files
- Split proxy native tests to a different test suite
- Decouple utility functions from TestGenerator into a base test class
- Fix bug where tests would fail if ran from a different directory
- Adds tests for enable/disable/require mock flags

Bug: 898261
Change-Id: Ieae930c73539b00653dfcf32c89d9a79a3ceecf6
Reviewed-on: https://chromium-review.googlesource.com/c/1345239
Commit-Queue: Aiden Benner <abenner@google.com>
Reviewed-by: default avatarEric Stevenson <estevenson@chromium.org>
Reviewed-by: default avataragrieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610266}
parent e930a441
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.base.natives;
// This file is autogenerated by
// base/android/jni_generator/jni_registration_generator.py
// Please do not change its content.
public class GEN_JNI {
public static final boolean TESTING_ENABLED = false;
public static final boolean REQUIRE_MOCK = false;
public static native void org_chromium_example_jni_1generator_SampleForAnnotationProcessor_foo();
public static native Object org_chromium_example_jni_1generator_SampleForAnnotationProcessor_bar(Object sample);
public static native String org_chromium_example_jni_1generator_SampleForAnnotationProcessor_revString(String stringToReverse);
public static native String[] org_chromium_example_jni_1generator_SampleForAnnotationProcessor_sendToNative(String[] strs);
public static native Object[] org_chromium_example_jni_1generator_SampleForAnnotationProcessor_sendSamplesToNative(Object[] strs);
public static native boolean org_chromium_example_jni_1generator_SampleForAnnotationProcessor_hasPhalange();
public static native int[] org_chromium_example_jni_1generator_SampleForAnnotationProcessor_testAllPrimitives(int zint, int[] ints, long zlong, long[] longs, short zshort, short[] shorts, char zchar, char[] chars, byte zbyte, byte[] bytes, double zdouble, double[] doubles, float zfloat, float[] floats, boolean zbool, boolean[] bools);
public static native void org_chromium_example_jni_1generator_SampleForAnnotationProcessor_testSpecialTypes(Class clazz, Class[] classes, Throwable throwable, Throwable[] throwables, String string, String[] strings, Object tStruct, Object[] structs, Object obj, Object[] objects);
public static native Throwable org_chromium_example_jni_1generator_SampleForAnnotationProcessor_returnThrowable();
public static native Throwable[] org_chromium_example_jni_1generator_SampleForAnnotationProcessor_returnThrowables();
public static native Class org_chromium_example_jni_1generator_SampleForAnnotationProcessor_returnClass();
public static native Class[] org_chromium_example_jni_1generator_SampleForAnnotationProcessor_returnClasses();
public static native String org_chromium_example_jni_1generator_SampleForAnnotationProcessor_returnString();
public static native String[] org_chromium_example_jni_1generator_SampleForAnnotationProcessor_returnStrings();
public static native Object org_chromium_example_jni_1generator_SampleForAnnotationProcessor_returnStruct();
public static native Object[] org_chromium_example_jni_1generator_SampleForAnnotationProcessor_returnStructs();
public static native Object org_chromium_example_jni_1generator_SampleForAnnotationProcessor_returnObject();
public static native Object[] org_chromium_example_jni_1generator_SampleForAnnotationProcessor_returnObjects();
}
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.base.natives;
// This file is autogenerated by
// base/android/jni_generator/jni_registration_generator.py
// Please do not change its content.
public class GEN_JNI {
public static final boolean TESTING_ENABLED = true;
public static final boolean REQUIRE_MOCK = false;
public static native void org_chromium_example_jni_1generator_SampleForAnnotationProcessor_foo();
public static native Object org_chromium_example_jni_1generator_SampleForAnnotationProcessor_bar(Object sample);
public static native String org_chromium_example_jni_1generator_SampleForAnnotationProcessor_revString(String stringToReverse);
public static native String[] org_chromium_example_jni_1generator_SampleForAnnotationProcessor_sendToNative(String[] strs);
public static native Object[] org_chromium_example_jni_1generator_SampleForAnnotationProcessor_sendSamplesToNative(Object[] strs);
public static native boolean org_chromium_example_jni_1generator_SampleForAnnotationProcessor_hasPhalange();
public static native int[] org_chromium_example_jni_1generator_SampleForAnnotationProcessor_testAllPrimitives(int zint, int[] ints, long zlong, long[] longs, short zshort, short[] shorts, char zchar, char[] chars, byte zbyte, byte[] bytes, double zdouble, double[] doubles, float zfloat, float[] floats, boolean zbool, boolean[] bools);
public static native void org_chromium_example_jni_1generator_SampleForAnnotationProcessor_testSpecialTypes(Class clazz, Class[] classes, Throwable throwable, Throwable[] throwables, String string, String[] strings, Object tStruct, Object[] structs, Object obj, Object[] objects);
public static native Throwable org_chromium_example_jni_1generator_SampleForAnnotationProcessor_returnThrowable();
public static native Throwable[] org_chromium_example_jni_1generator_SampleForAnnotationProcessor_returnThrowables();
public static native Class org_chromium_example_jni_1generator_SampleForAnnotationProcessor_returnClass();
public static native Class[] org_chromium_example_jni_1generator_SampleForAnnotationProcessor_returnClasses();
public static native String org_chromium_example_jni_1generator_SampleForAnnotationProcessor_returnString();
public static native String[] org_chromium_example_jni_1generator_SampleForAnnotationProcessor_returnStrings();
public static native Object org_chromium_example_jni_1generator_SampleForAnnotationProcessor_returnStruct();
public static native Object[] org_chromium_example_jni_1generator_SampleForAnnotationProcessor_returnStructs();
public static native Object org_chromium_example_jni_1generator_SampleForAnnotationProcessor_returnObject();
public static native Object[] org_chromium_example_jni_1generator_SampleForAnnotationProcessor_returnObjects();
}
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.base.natives;
// This file is autogenerated by
// base/android/jni_generator/jni_registration_generator.py
// Please do not change its content.
public class GEN_JNI {
public static final boolean TESTING_ENABLED = true;
public static final boolean REQUIRE_MOCK = true;
public static native void org_chromium_example_jni_1generator_SampleForAnnotationProcessor_foo();
public static native Object org_chromium_example_jni_1generator_SampleForAnnotationProcessor_bar(Object sample);
public static native String org_chromium_example_jni_1generator_SampleForAnnotationProcessor_revString(String stringToReverse);
public static native String[] org_chromium_example_jni_1generator_SampleForAnnotationProcessor_sendToNative(String[] strs);
public static native Object[] org_chromium_example_jni_1generator_SampleForAnnotationProcessor_sendSamplesToNative(Object[] strs);
public static native boolean org_chromium_example_jni_1generator_SampleForAnnotationProcessor_hasPhalange();
public static native int[] org_chromium_example_jni_1generator_SampleForAnnotationProcessor_testAllPrimitives(int zint, int[] ints, long zlong, long[] longs, short zshort, short[] shorts, char zchar, char[] chars, byte zbyte, byte[] bytes, double zdouble, double[] doubles, float zfloat, float[] floats, boolean zbool, boolean[] bools);
public static native void org_chromium_example_jni_1generator_SampleForAnnotationProcessor_testSpecialTypes(Class clazz, Class[] classes, Throwable throwable, Throwable[] throwables, String string, String[] strings, Object tStruct, Object[] structs, Object obj, Object[] objects);
public static native Throwable org_chromium_example_jni_1generator_SampleForAnnotationProcessor_returnThrowable();
public static native Throwable[] org_chromium_example_jni_1generator_SampleForAnnotationProcessor_returnThrowables();
public static native Class org_chromium_example_jni_1generator_SampleForAnnotationProcessor_returnClass();
public static native Class[] org_chromium_example_jni_1generator_SampleForAnnotationProcessor_returnClasses();
public static native String org_chromium_example_jni_1generator_SampleForAnnotationProcessor_returnString();
public static native String[] org_chromium_example_jni_1generator_SampleForAnnotationProcessor_returnStrings();
public static native Object org_chromium_example_jni_1generator_SampleForAnnotationProcessor_returnStruct();
public static native Object[] org_chromium_example_jni_1generator_SampleForAnnotationProcessor_returnStructs();
public static native Object org_chromium_example_jni_1generator_SampleForAnnotationProcessor_returnObject();
public static native Object[] org_chromium_example_jni_1generator_SampleForAnnotationProcessor_returnObjects();
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment