diff options
29 files changed, 26 insertions, 655 deletions
diff --git a/test/903-hello-tagging/tagging.cc b/test/903-hello-tagging/tagging.cc index 60a31bdd2d..f74c1fc2ea 100644 --- a/test/903-hello-tagging/tagging.cc +++ b/test/903-hello-tagging/tagging.cc @@ -14,8 +14,6 @@ * limitations under the License. */ -#include "tagging.h" - #include <iostream> #include <pthread.h> #include <stdio.h> @@ -141,18 +139,6 @@ extern "C" JNIEXPORT jobjectArray JNICALL Java_Main_getTaggedObjects(JNIEnv* env return resultArray; } -// Don't do anything -jint OnLoad(JavaVM* vm, - char* options ATTRIBUTE_UNUSED, - void* reserved ATTRIBUTE_UNUSED) { - if (vm->GetEnv(reinterpret_cast<void**>(&jvmti_env), JVMTI_VERSION_1_0)) { - printf("Unable to get jvmti env!\n"); - return 1; - } - SetAllCapabilities(jvmti_env); - return 0; -} - } // namespace Test903HelloTagging } // namespace art diff --git a/test/903-hello-tagging/tagging.h b/test/903-hello-tagging/tagging.h deleted file mode 100644 index f062d44880..0000000000 --- a/test/903-hello-tagging/tagging.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef ART_TEST_903_HELLO_TAGGING_TAGGING_H_ -#define ART_TEST_903_HELLO_TAGGING_TAGGING_H_ - -#include <jni.h> - -namespace art { -namespace Test903HelloTagging { - -jint OnLoad(JavaVM* vm, char* options, void* reserved); - -} // namespace Test903HelloTagging -} // namespace art - -#endif // ART_TEST_903_HELLO_TAGGING_TAGGING_H_ diff --git a/test/904-object-allocation/tracking.cc b/test/904-object-allocation/tracking.cc index f993606b42..95eab0c6cc 100644 --- a/test/904-object-allocation/tracking.cc +++ b/test/904-object-allocation/tracking.cc @@ -14,8 +14,6 @@ * limitations under the License. */ -#include "tracking.h" - #include <iostream> #include <pthread.h> #include <stdio.h> @@ -89,19 +87,6 @@ extern "C" JNIEXPORT void JNICALL Java_Main_enableAllocationTracking(JNIEnv* env } } -// Don't do anything -jint OnLoad(JavaVM* vm, - char* options ATTRIBUTE_UNUSED, - void* reserved ATTRIBUTE_UNUSED) { - if (vm->GetEnv(reinterpret_cast<void**>(&jvmti_env), JVMTI_VERSION_1_0)) { - printf("Unable to get jvmti env!\n"); - return 1; - } - jvmti_env->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_VM_OBJECT_ALLOC, nullptr); - SetAllCapabilities(jvmti_env); - return 0; -} - } // namespace Test904ObjectAllocation } // namespace art diff --git a/test/904-object-allocation/tracking.h b/test/904-object-allocation/tracking.h deleted file mode 100644 index 21c1837523..0000000000 --- a/test/904-object-allocation/tracking.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef ART_TEST_904_OBJECT_ALLOCATION_TRACKING_H_ -#define ART_TEST_904_OBJECT_ALLOCATION_TRACKING_H_ - -#include <jni.h> - -namespace art { -namespace Test904ObjectAllocation { - -jint OnLoad(JavaVM* vm, char* options, void* reserved); - -} // namespace Test904ObjectAllocation -} // namespace art - -#endif // ART_TEST_904_OBJECT_ALLOCATION_TRACKING_H_ diff --git a/test/905-object-free/tracking_free.cc b/test/905-object-free/tracking_free.cc index 7f295accb2..7b26d79edb 100644 --- a/test/905-object-free/tracking_free.cc +++ b/test/905-object-free/tracking_free.cc @@ -14,8 +14,6 @@ * limitations under the License. */ -#include "tracking_free.h" - #include <iostream> #include <pthread.h> #include <stdio.h> @@ -82,17 +80,5 @@ extern "C" JNIEXPORT jlongArray JNICALL Java_Main_getCollectedTags(JNIEnv* env, return ret; } -// Don't do anything -jint OnLoad(JavaVM* vm, - char* options ATTRIBUTE_UNUSED, - void* reserved ATTRIBUTE_UNUSED) { - if (vm->GetEnv(reinterpret_cast<void**>(&jvmti_env), JVMTI_VERSION_1_0)) { - printf("Unable to get jvmti env!\n"); - return 1; - } - SetAllCapabilities(jvmti_env); - return 0; -} - } // namespace Test905ObjectFree } // namespace art diff --git a/test/905-object-free/tracking_free.h b/test/905-object-free/tracking_free.h deleted file mode 100644 index ba4aa43ffe..0000000000 --- a/test/905-object-free/tracking_free.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef ART_TEST_905_OBJECT_FREE_TRACKING_FREE_H_ -#define ART_TEST_905_OBJECT_FREE_TRACKING_FREE_H_ - -#include <jni.h> - -namespace art { -namespace Test905ObjectFree { - -jint OnLoad(JavaVM* vm, char* options, void* reserved); - -} // namespace Test905ObjectFree -} // namespace art - -#endif // ART_TEST_905_OBJECT_FREE_TRACKING_FREE_H_ diff --git a/test/906-iterate-heap/iterate_heap.cc b/test/906-iterate-heap/iterate_heap.cc index a2fd59128f..1362d470e6 100644 --- a/test/906-iterate-heap/iterate_heap.cc +++ b/test/906-iterate-heap/iterate_heap.cc @@ -14,8 +14,6 @@ * limitations under the License. */ -#include "iterate_heap.h" - #include <iostream> #include <pthread.h> #include <stdio.h> @@ -174,17 +172,5 @@ extern "C" JNIEXPORT void JNICALL Java_Main_iterateThroughHeapAdd(JNIEnv* env AT Run(heap_filter, klass_filter, &config); } -// Don't do anything -jint OnLoad(JavaVM* vm, - char* options ATTRIBUTE_UNUSED, - void* reserved ATTRIBUTE_UNUSED) { - if (vm->GetEnv(reinterpret_cast<void**>(&jvmti_env), JVMTI_VERSION_1_0)) { - printf("Unable to get jvmti env!\n"); - return 1; - } - SetAllCapabilities(jvmti_env); - return 0; -} - } // namespace Test906IterateHeap } // namespace art diff --git a/test/906-iterate-heap/iterate_heap.h b/test/906-iterate-heap/iterate_heap.h deleted file mode 100644 index f25cdbaf49..0000000000 --- a/test/906-iterate-heap/iterate_heap.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef ART_TEST_906_ITERATE_HEAP_ITERATE_HEAP_H_ -#define ART_TEST_906_ITERATE_HEAP_ITERATE_HEAP_H_ - -#include <jni.h> - -namespace art { -namespace Test906IterateHeap { - -jint OnLoad(JavaVM* vm, char* options, void* reserved); - -} // namespace Test906IterateHeap -} // namespace art - -#endif // ART_TEST_906_ITERATE_HEAP_ITERATE_HEAP_H_ diff --git a/test/907-get-loaded-classes/get_loaded_classes.cc b/test/907-get-loaded-classes/get_loaded_classes.cc index 36d33b63cc..5bda7ebac8 100644 --- a/test/907-get-loaded-classes/get_loaded_classes.cc +++ b/test/907-get-loaded-classes/get_loaded_classes.cc @@ -14,8 +14,6 @@ * limitations under the License. */ -#include "get_loaded_classes.h" - #include <iostream> #include <pthread.h> #include <stdio.h> @@ -65,17 +63,5 @@ extern "C" JNIEXPORT jobjectArray JNICALL Java_Main_getLoadedClasses( return ret; } -// Don't do anything -jint OnLoad(JavaVM* vm, - char* options ATTRIBUTE_UNUSED, - void* reserved ATTRIBUTE_UNUSED) { - if (vm->GetEnv(reinterpret_cast<void**>(&jvmti_env), JVMTI_VERSION_1_0)) { - printf("Unable to get jvmti env!\n"); - return 1; - } - SetAllCapabilities(jvmti_env); - return 0; -} - } // namespace Test907GetLoadedClasses } // namespace art diff --git a/test/907-get-loaded-classes/get_loaded_classes.h b/test/907-get-loaded-classes/get_loaded_classes.h deleted file mode 100644 index 4d27f898cc..0000000000 --- a/test/907-get-loaded-classes/get_loaded_classes.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef ART_TEST_907_GET_LOADED_CLASSES_GET_LOADED_CLASSES_H_ -#define ART_TEST_907_GET_LOADED_CLASSES_GET_LOADED_CLASSES_H_ - -#include <jni.h> - -namespace art { -namespace Test907GetLoadedClasses { - -jint OnLoad(JavaVM* vm, char* options, void* reserved); - -} // namespace Test907GetLoadedClasses -} // namespace art - -#endif // ART_TEST_907_GET_LOADED_CLASSES_GET_LOADED_CLASSES_H_ diff --git a/test/908-gc-start-finish/gc_callbacks.cc b/test/908-gc-start-finish/gc_callbacks.cc index 1fab79dcb1..59801ff648 100644 --- a/test/908-gc-start-finish/gc_callbacks.cc +++ b/test/908-gc-start-finish/gc_callbacks.cc @@ -14,8 +14,6 @@ * limitations under the License. */ -#include "gc_callbacks.h" - #include <stdio.h> #include <string.h> @@ -94,17 +92,5 @@ extern "C" JNIEXPORT jint JNICALL Java_Main_getGcFinishes(JNIEnv* env ATTRIBUTE_ return result; } -// Don't do anything -jint OnLoad(JavaVM* vm, - char* options ATTRIBUTE_UNUSED, - void* reserved ATTRIBUTE_UNUSED) { - if (vm->GetEnv(reinterpret_cast<void**>(&jvmti_env), JVMTI_VERSION_1_0)) { - printf("Unable to get jvmti env!\n"); - return 1; - } - SetAllCapabilities(jvmti_env); - return 0; -} - } // namespace Test908GcStartFinish } // namespace art diff --git a/test/908-gc-start-finish/gc_callbacks.h b/test/908-gc-start-finish/gc_callbacks.h deleted file mode 100644 index 177a4eb7b2..0000000000 --- a/test/908-gc-start-finish/gc_callbacks.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef ART_TEST_908_GC_START_FINISH_GC_CALLBACKS_H_ -#define ART_TEST_908_GC_START_FINISH_GC_CALLBACKS_H_ - -#include <jni.h> - -namespace art { -namespace Test908GcStartFinish { - -jint OnLoad(JavaVM* vm, char* options, void* reserved); - -} // namespace Test908GcStartFinish -} // namespace art - -#endif // ART_TEST_908_GC_START_FINISH_GC_CALLBACKS_H_ diff --git a/test/910-methods/methods.cc b/test/910-methods/methods.cc index fa9679db4b..f60fabb1df 100644 --- a/test/910-methods/methods.cc +++ b/test/910-methods/methods.cc @@ -14,8 +14,6 @@ * limitations under the License. */ -#include "methods.h" - #include <stdio.h> #include "base/macros.h" @@ -207,17 +205,5 @@ extern "C" JNIEXPORT jboolean JNICALL Java_Main_isMethodSynthetic( return is_synthetic; } -// Don't do anything -jint OnLoad(JavaVM* vm, - char* options ATTRIBUTE_UNUSED, - void* reserved ATTRIBUTE_UNUSED) { - if (vm->GetEnv(reinterpret_cast<void**>(&jvmti_env), JVMTI_VERSION_1_0)) { - printf("Unable to get jvmti env!\n"); - return 1; - } - SetAllCapabilities(jvmti_env); - return 0; -} - } // namespace Test910Methods } // namespace art diff --git a/test/910-methods/methods.h b/test/910-methods/methods.h deleted file mode 100644 index 93d18741ed..0000000000 --- a/test/910-methods/methods.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef ART_TEST_910_METHODS_METHODS_H_ -#define ART_TEST_910_METHODS_METHODS_H_ - -#include <jni.h> - -namespace art { -namespace Test910Methods { - -jint OnLoad(JavaVM* vm, char* options, void* reserved); - -} // namespace Test910Methods -} // namespace art - -#endif // ART_TEST_910_METHODS_METHODS_H_ diff --git a/test/911-get-stack-trace/stack_trace.cc b/test/911-get-stack-trace/stack_trace.cc index b3e8bc3b1f..cca163b79b 100644 --- a/test/911-get-stack-trace/stack_trace.cc +++ b/test/911-get-stack-trace/stack_trace.cc @@ -14,8 +14,6 @@ * limitations under the License. */ -#include "stack_trace.h" - #include <inttypes.h> #include <memory> #include <stdio.h> @@ -142,17 +140,5 @@ extern "C" JNIEXPORT jobjectArray JNICALL Java_Main_getStackTrace( return CreateObjectArray(env, count, "[Ljava/lang/String;", callback); } -// Don't do anything -jint OnLoad(JavaVM* vm, - char* options ATTRIBUTE_UNUSED, - void* reserved ATTRIBUTE_UNUSED) { - if (vm->GetEnv(reinterpret_cast<void**>(&jvmti_env), JVMTI_VERSION_1_0)) { - printf("Unable to get jvmti env!\n"); - return 1; - } - SetAllCapabilities(jvmti_env); - return 0; -} - } // namespace Test911GetStackTrace } // namespace art diff --git a/test/911-get-stack-trace/stack_trace.h b/test/911-get-stack-trace/stack_trace.h deleted file mode 100644 index eba2a91da1..0000000000 --- a/test/911-get-stack-trace/stack_trace.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef ART_TEST_911_GET_STACK_TRACE_STACK_TRACE_H_ -#define ART_TEST_911_GET_STACK_TRACE_STACK_TRACE_H_ - -#include <jni.h> - -namespace art { -namespace Test911GetStackTrace { - -jint OnLoad(JavaVM* vm, char* options, void* reserved); - -} // namespace Test911GetStackTrace -} // namespace art - -#endif // ART_TEST_911_GET_STACK_TRACE_STACK_TRACE_H_ diff --git a/test/912-classes/classes.cc b/test/912-classes/classes.cc index 38a4f0e337..69301c7925 100644 --- a/test/912-classes/classes.cc +++ b/test/912-classes/classes.cc @@ -14,8 +14,6 @@ * limitations under the License. */ -#include "classes.h" - #include <stdio.h> #include "base/macros.h" @@ -224,17 +222,5 @@ extern "C" JNIEXPORT jobject JNICALL Java_Main_getClassLoader( return classloader; } -// Don't do anything -jint OnLoad(JavaVM* vm, - char* options ATTRIBUTE_UNUSED, - void* reserved ATTRIBUTE_UNUSED) { - if (vm->GetEnv(reinterpret_cast<void**>(&jvmti_env), JVMTI_VERSION_1_0)) { - printf("Unable to get jvmti env!\n"); - return 1; - } - SetAllCapabilities(jvmti_env); - return 0; -} - } // namespace Test912Classes } // namespace art diff --git a/test/912-classes/classes.h b/test/912-classes/classes.h deleted file mode 100644 index 62fb203356..0000000000 --- a/test/912-classes/classes.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef ART_TEST_912_CLASSES_CLASSES_H_ -#define ART_TEST_912_CLASSES_CLASSES_H_ - -#include <jni.h> - -namespace art { -namespace Test912Classes { - -jint OnLoad(JavaVM* vm, char* options, void* reserved); - -} // namespace Test912Classes -} // namespace art - -#endif // ART_TEST_912_CLASSES_CLASSES_H_ diff --git a/test/913-heaps/heaps.cc b/test/913-heaps/heaps.cc index 0b232af0df..67599192cf 100644 --- a/test/913-heaps/heaps.cc +++ b/test/913-heaps/heaps.cc @@ -14,8 +14,6 @@ * limitations under the License. */ -#include "heaps.h" - #include <inttypes.h> #include <stdio.h> #include <string.h> @@ -495,17 +493,5 @@ extern "C" JNIEXPORT jobjectArray JNICALL Java_Main_followReferences(JNIEnv* env return ret; } -// Don't do anything -jint OnLoad(JavaVM* vm, - char* options ATTRIBUTE_UNUSED, - void* reserved ATTRIBUTE_UNUSED) { - if (vm->GetEnv(reinterpret_cast<void**>(&jvmti_env), JVMTI_VERSION_1_0)) { - printf("Unable to get jvmti env!\n"); - return 1; - } - SetAllCapabilities(jvmti_env); - return 0; -} - } // namespace Test913Heaps } // namespace art diff --git a/test/913-heaps/heaps.h b/test/913-heaps/heaps.h deleted file mode 100644 index bd828aca33..0000000000 --- a/test/913-heaps/heaps.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef ART_TEST_913_HEAPS_HEAPS_H_ -#define ART_TEST_913_HEAPS_HEAPS_H_ - -#include <jni.h> - -namespace art { -namespace Test913Heaps { - -jint OnLoad(JavaVM* vm, char* options, void* reserved); - -} // namespace Test913Heaps -} // namespace art - -#endif // ART_TEST_913_HEAPS_HEAPS_H_ diff --git a/test/918-fields/fields.cc b/test/918-fields/fields.cc index 4d2b34b94e..7d29912f47 100644 --- a/test/918-fields/fields.cc +++ b/test/918-fields/fields.cc @@ -14,8 +14,6 @@ * limitations under the License. */ -#include "fields.h" - #include <stdio.h> #include "base/macros.h" @@ -132,17 +130,5 @@ extern "C" JNIEXPORT jboolean JNICALL Java_Main_isFieldSynthetic( return synth; } -// Don't do anything -jint OnLoad(JavaVM* vm, - char* options ATTRIBUTE_UNUSED, - void* reserved ATTRIBUTE_UNUSED) { - if (vm->GetEnv(reinterpret_cast<void**>(&jvmti_env), JVMTI_VERSION_1_0)) { - printf("Unable to get jvmti env!\n"); - return 1; - } - SetAllCapabilities(jvmti_env); - return 0; -} - } // namespace Test918Fields } // namespace art diff --git a/test/918-fields/fields.h b/test/918-fields/fields.h deleted file mode 100644 index 89bd1614d5..0000000000 --- a/test/918-fields/fields.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef ART_TEST_918_FIELDS_FIELDS_H_ -#define ART_TEST_918_FIELDS_FIELDS_H_ - -#include <jni.h> - -namespace art { -namespace Test918Fields { - -jint OnLoad(JavaVM* vm, char* options, void* reserved); - -} // namespace Test918Fields -} // namespace art - -#endif // ART_TEST_918_FIELDS_FIELDS_H_ diff --git a/test/920-objects/objects.cc b/test/920-objects/objects.cc index 886dd0e673..0553a9d007 100644 --- a/test/920-objects/objects.cc +++ b/test/920-objects/objects.cc @@ -14,8 +14,6 @@ * limitations under the License. */ -#include "objects.h" - #include <stdio.h> #include "base/macros.h" @@ -61,17 +59,5 @@ extern "C" JNIEXPORT jint JNICALL Java_Main_getObjectHashCode( return hash; } -// Don't do anything -jint OnLoad(JavaVM* vm, - char* options ATTRIBUTE_UNUSED, - void* reserved ATTRIBUTE_UNUSED) { - if (vm->GetEnv(reinterpret_cast<void**>(&jvmti_env), JVMTI_VERSION_1_0)) { - printf("Unable to get jvmti env!\n"); - return 1; - } - SetAllCapabilities(jvmti_env); - return 0; -} - } // namespace Test920Objects } // namespace art diff --git a/test/920-objects/objects.h b/test/920-objects/objects.h deleted file mode 100644 index 5f21e7b7cb..0000000000 --- a/test/920-objects/objects.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef ART_TEST_920_OBJECTS_OBJECTS_H_ -#define ART_TEST_920_OBJECTS_OBJECTS_H_ - -#include <jni.h> - -namespace art { -namespace Test920Objects { - -jint OnLoad(JavaVM* vm, char* options, void* reserved); - -} // namespace Test920Objects -} // namespace art - -#endif // ART_TEST_920_OBJECTS_OBJECTS_H_ diff --git a/test/922-properties/properties.cc b/test/922-properties/properties.cc index b1e7fce3b5..cb732c74f1 100644 --- a/test/922-properties/properties.cc +++ b/test/922-properties/properties.cc @@ -14,8 +14,6 @@ * limitations under the License. */ -#include "properties.h" - #include <stdio.h> #include "base/macros.h" @@ -91,17 +89,5 @@ extern "C" JNIEXPORT void JNICALL Java_Main_setSystemProperty( } } -// Don't do anything -jint OnLoad(JavaVM* vm, - char* options ATTRIBUTE_UNUSED, - void* reserved ATTRIBUTE_UNUSED) { - if (vm->GetEnv(reinterpret_cast<void**>(&jvmti_env), JVMTI_VERSION_1_0)) { - printf("Unable to get jvmti env!\n"); - return 1; - } - SetAllCapabilities(jvmti_env); - return 0; -} - } // namespace Test922Properties } // namespace art diff --git a/test/922-properties/properties.h b/test/922-properties/properties.h deleted file mode 100644 index 84feb10758..0000000000 --- a/test/922-properties/properties.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef ART_TEST_922_PROPERTIES_PROPERTIES_H_ -#define ART_TEST_922_PROPERTIES_PROPERTIES_H_ - -#include <jni.h> - -namespace art { -namespace Test922Properties { - -jint OnLoad(JavaVM* vm, char* options, void* reserved); - -} // namespace Test922Properties -} // namespace art - -#endif // ART_TEST_922_PROPERTIES_PROPERTIES_H_ diff --git a/test/923-monitors/monitors.cc b/test/923-monitors/monitors.cc index 2aa36cbdba..4baa530ec2 100644 --- a/test/923-monitors/monitors.cc +++ b/test/923-monitors/monitors.cc @@ -14,8 +14,6 @@ * limitations under the License. */ -#include "monitors.h" - #include <stdio.h> #include "base/macros.h" @@ -84,17 +82,5 @@ extern "C" JNIEXPORT void JNICALL Java_Main_rawMonitorNotifyAll( JvmtiErrorToException(env, result); } -// Don't do anything -jint OnLoad(JavaVM* vm, - char* options ATTRIBUTE_UNUSED, - void* reserved ATTRIBUTE_UNUSED) { - if (vm->GetEnv(reinterpret_cast<void**>(&jvmti_env), JVMTI_VERSION_1_0)) { - printf("Unable to get jvmti env!\n"); - return 1; - } - SetAllCapabilities(jvmti_env); - return 0; -} - } // namespace Test923Monitors } // namespace art diff --git a/test/923-monitors/monitors.h b/test/923-monitors/monitors.h deleted file mode 100644 index 14cd5cd633..0000000000 --- a/test/923-monitors/monitors.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef ART_TEST_923_MONITORS_MONITORS_H_ -#define ART_TEST_923_MONITORS_MONITORS_H_ - -#include <jni.h> - -namespace art { -namespace Test923Monitors { - -jint OnLoad(JavaVM* vm, char* options, void* reserved); - -} // namespace Test923Monitors -} // namespace art - -#endif // ART_TEST_923_MONITORS_MONITORS_H_ diff --git a/test/ti-agent/common_load.cc b/test/ti-agent/common_load.cc index 33e132103e..8abd063a01 100644 --- a/test/ti-agent/common_load.cc +++ b/test/ti-agent/common_load.cc @@ -26,21 +26,7 @@ #include "common_helper.h" #include "901-hello-ti-agent/basics.h" -#include "903-hello-tagging/tagging.h" -#include "904-object-allocation/tracking.h" -#include "905-object-free/tracking_free.h" -#include "906-iterate-heap/iterate_heap.h" -#include "907-get-loaded-classes/get_loaded_classes.h" -#include "908-gc-start-finish/gc_callbacks.h" #include "909-attach-agent/attach.h" -#include "910-methods/methods.h" -#include "911-get-stack-trace/stack_trace.h" -#include "912-classes/classes.h" -#include "913-heaps/heaps.h" -#include "918-fields/fields.h" -#include "920-objects/objects.h" -#include "922-properties/properties.h" -#include "923-monitors/monitors.h" namespace art { @@ -55,31 +41,30 @@ struct AgentLib { OnAttach attach; }; -// A list of all the agents we have for testing. +// A trivial OnLoad implementation that only initializes the global jvmti_env. +static jint MinimalOnLoad(JavaVM* vm, + char* options ATTRIBUTE_UNUSED, + void* reserved ATTRIBUTE_UNUSED) { + if (vm->GetEnv(reinterpret_cast<void**>(&jvmti_env), JVMTI_VERSION_1_0)) { + printf("Unable to get jvmti env!\n"); + return 1; + } + SetAllCapabilities(jvmti_env); + return 0; +} + +// A list of all non-standard the agents we have for testing. All other agents will use +// MinimalOnLoad. AgentLib agents[] = { { "901-hello-ti-agent", Test901HelloTi::OnLoad, nullptr }, { "902-hello-transformation", common_redefine::OnLoad, nullptr }, - { "903-hello-tagging", Test903HelloTagging::OnLoad, nullptr }, - { "904-object-allocation", Test904ObjectAllocation::OnLoad, nullptr }, - { "905-object-free", Test905ObjectFree::OnLoad, nullptr }, - { "906-iterate-heap", Test906IterateHeap::OnLoad, nullptr }, - { "907-get-loaded-classes", Test907GetLoadedClasses::OnLoad, nullptr }, - { "908-gc-start-finish", Test908GcStartFinish::OnLoad, nullptr }, { "909-attach-agent", nullptr, Test909AttachAgent::OnAttach }, - { "910-methods", Test910Methods::OnLoad, nullptr }, - { "911-get-stack-trace", Test911GetStackTrace::OnLoad, nullptr }, - { "912-classes", Test912Classes::OnLoad, nullptr }, - { "913-heaps", Test913Heaps::OnLoad, nullptr }, { "914-hello-obsolescence", common_redefine::OnLoad, nullptr }, { "915-obsolete-2", common_redefine::OnLoad, nullptr }, { "916-obsolete-jit", common_redefine::OnLoad, nullptr }, { "917-fields-transformation", common_redefine::OnLoad, nullptr }, - { "918-fields", Test918Fields::OnLoad, nullptr }, { "919-obsolete-fields", common_redefine::OnLoad, nullptr }, - { "920-objects", Test920Objects::OnLoad, nullptr }, { "921-hello-failure", common_redefine::OnLoad, nullptr }, - { "922-properties", Test922Properties::OnLoad, nullptr }, - { "923-monitors", Test923Monitors::OnLoad, nullptr }, }; static AgentLib* FindAgent(char* name) { @@ -120,18 +105,21 @@ extern "C" JNIEXPORT jint JNICALL Agent_OnLoad(JavaVM* vm, char* options, void* printf("Unable to find agent name in options: %s\n", options); return -1; } + + SetIsJVM(remaining_options); + AgentLib* lib = FindAgent(name_option); + OnLoad fn = nullptr; if (lib == nullptr) { - printf("Unable to find agent named: %s, add it to the list in test/ti-agent/common_load.cc\n", - name_option); - return -2; - } - if (lib->load == nullptr) { - printf("agent: %s does not include an OnLoad method.\n", name_option); - return -3; + fn = &MinimalOnLoad; + } else { + if (lib->load == nullptr) { + printf("agent: %s does not include an OnLoad method.\n", name_option); + return -3; + } + fn = lib->load; } - SetIsJVM(remaining_options); - return lib->load(vm, remaining_options, reserved); + return fn(vm, remaining_options, reserved); } extern "C" JNIEXPORT jint JNICALL Agent_OnAttach(JavaVM* vm, char* options, void* reserved) { |