39 const char* name;
40 const char* value;
41 } PropertyDesc;
42
43 static PropertyDesc propDescList[PROPERTIES_COUNT] = {
44 {"nsk.jvmti.test.property", "new value of nsk.jvmti.test.property"},
45 {"nsk.jvmti.test.property.empty.old", "new value of nsk.jvmti.test.property.emply.old"},
46 {"nsk.jvmti.test.property.empty.new", ""}
47 };
48
49 /* ============================================================================= */
50
51 static int setProperties(jvmtiEnv* jvmti) {
52 int success = NSK_TRUE;
53 int i;
54
55 for (i = 0; i < PROPERTIES_COUNT; i++) {
56 NSK_DISPLAY1(" property: %s\n", propDescList[i].name);
57 NSK_DISPLAY1(" value: \"%s\"\n", propDescList[i].value);
58 if (!NSK_JVMTI_VERIFY(
59 NSK_CPP_STUB3(SetSystemProperty, jvmti,
60 propDescList[i].name, propDescList[i].value))) {
61 success = NSK_FALSE;
62 }
63 }
64
65 return success;
66 }
67
68 /* ============================================================================= */
69
70 /** Agent library initialization. */
71 #ifdef STATIC_BUILD
72 JNIEXPORT jint JNICALL Agent_OnLoad_setsysprop003(JavaVM *jvm, char *options, void *reserved) {
73 return Agent_Initialize(jvm, options, reserved);
74 }
75 JNIEXPORT jint JNICALL Agent_OnAttach_setsysprop003(JavaVM *jvm, char *options, void *reserved) {
76 return Agent_Initialize(jvm, options, reserved);
77 }
78 JNIEXPORT jint JNI_OnLoad_setsysprop003(JavaVM *jvm, char *options, void *reserved) {
79 return JNI_VERSION_1_8;
80 }
|
39 const char* name;
40 const char* value;
41 } PropertyDesc;
42
43 static PropertyDesc propDescList[PROPERTIES_COUNT] = {
44 {"nsk.jvmti.test.property", "new value of nsk.jvmti.test.property"},
45 {"nsk.jvmti.test.property.empty.old", "new value of nsk.jvmti.test.property.emply.old"},
46 {"nsk.jvmti.test.property.empty.new", ""}
47 };
48
49 /* ============================================================================= */
50
51 static int setProperties(jvmtiEnv* jvmti) {
52 int success = NSK_TRUE;
53 int i;
54
55 for (i = 0; i < PROPERTIES_COUNT; i++) {
56 NSK_DISPLAY1(" property: %s\n", propDescList[i].name);
57 NSK_DISPLAY1(" value: \"%s\"\n", propDescList[i].value);
58 if (!NSK_JVMTI_VERIFY(
59 jvmti->SetSystemProperty(propDescList[i].name, propDescList[i].value))) {
60 success = NSK_FALSE;
61 }
62 }
63
64 return success;
65 }
66
67 /* ============================================================================= */
68
69 /** Agent library initialization. */
70 #ifdef STATIC_BUILD
71 JNIEXPORT jint JNICALL Agent_OnLoad_setsysprop003(JavaVM *jvm, char *options, void *reserved) {
72 return Agent_Initialize(jvm, options, reserved);
73 }
74 JNIEXPORT jint JNICALL Agent_OnAttach_setsysprop003(JavaVM *jvm, char *options, void *reserved) {
75 return Agent_Initialize(jvm, options, reserved);
76 }
77 JNIEXPORT jint JNI_OnLoad_setsysprop003(JavaVM *jvm, char *options, void *reserved) {
78 return JNI_VERSION_1_8;
79 }
|