test/hotspot/jtreg/serviceability/jvmti/GetLocalVariable/libGetLocalVars.cpp

Print this page




  72   j##type val; \
  73   jvmtiError err = jvmti->GetLocal##Type(thr, depth, slot, &val); \
  74   \
  75   printf(" GetLocal%s: %s (%d)\n", #Type, TranslateError(err), err); \
  76   if (err != JVMTI_ERROR_TYPE_MISMATCH) { \
  77     printf(" FAIL: GetLocal%s failed to return JVMTI_ERROR_TYPE_MISMATCH for local %s\n", #Type, exp_type); \
  78     result = STATUS_FAILED; \
  79   } else { \
  80     printf(" GetLocal%s returned JVMTI_ERROR_TYPE_MISMATCH for local %s as expected\n", #Type, exp_type); \
  81   } \
  82 }
  83 
  84 DECL_TEST_FUNC(int, Int);
  85 DECL_TEST_FUNC(float, Float);
  86 DECL_TEST_FUNC(long, Long);
  87 DECL_TEST_FUNC(double, Double);
  88 DECL_TEST_FUNC(object, Object);
  89 
  90 DECL_TEST_INV_SLOT_FUNC(int, Int);
  91 DECL_TEST_INV_SLOT_FUNC(float, Float);



  92 
  93 DECL_TEST_TYPE_MISMATCH_FUNC(int, Int);
  94 DECL_TEST_TYPE_MISMATCH_FUNC(float, Float);
  95 DECL_TEST_TYPE_MISMATCH_FUNC(long, Long);
  96 DECL_TEST_TYPE_MISMATCH_FUNC(double, Double);
  97 DECL_TEST_TYPE_MISMATCH_FUNC(object, Object);
  98 
  99 static void
 100 test_local_byte(jthread thr, int depth, int slot) {
 101   printf("\n test_local_byte: BEGIN\n\n");
 102 
 103   test_int(thr, depth, slot, "byte");
 104   test_long_inv_slot(thr, depth, slot, "byte");
 105   test_float(thr, depth, slot, "byte");
 106   test_double_inv_slot(thr, depth, slot, "byte");
 107   test_object_type_mismatch(thr, depth, slot, "byte");
 108 
 109   printf("\n test_local_byte: END\n\n");
 110 }
 111 




  72   j##type val; \
  73   jvmtiError err = jvmti->GetLocal##Type(thr, depth, slot, &val); \
  74   \
  75   printf(" GetLocal%s: %s (%d)\n", #Type, TranslateError(err), err); \
  76   if (err != JVMTI_ERROR_TYPE_MISMATCH) { \
  77     printf(" FAIL: GetLocal%s failed to return JVMTI_ERROR_TYPE_MISMATCH for local %s\n", #Type, exp_type); \
  78     result = STATUS_FAILED; \
  79   } else { \
  80     printf(" GetLocal%s returned JVMTI_ERROR_TYPE_MISMATCH for local %s as expected\n", #Type, exp_type); \
  81   } \
  82 }
  83 
  84 DECL_TEST_FUNC(int, Int);
  85 DECL_TEST_FUNC(float, Float);
  86 DECL_TEST_FUNC(long, Long);
  87 DECL_TEST_FUNC(double, Double);
  88 DECL_TEST_FUNC(object, Object);
  89 
  90 DECL_TEST_INV_SLOT_FUNC(int, Int);
  91 DECL_TEST_INV_SLOT_FUNC(float, Float);
  92 DECL_TEST_INV_SLOT_FUNC(long, Long);
  93 DECL_TEST_INV_SLOT_FUNC(double, Double);
  94 DECL_TEST_INV_SLOT_FUNC(object, Object);
  95 
  96 DECL_TEST_TYPE_MISMATCH_FUNC(int, Int);
  97 DECL_TEST_TYPE_MISMATCH_FUNC(float, Float);
  98 DECL_TEST_TYPE_MISMATCH_FUNC(long, Long);
  99 DECL_TEST_TYPE_MISMATCH_FUNC(double, Double);
 100 DECL_TEST_TYPE_MISMATCH_FUNC(object, Object);
 101 
 102 static void
 103 test_local_byte(jthread thr, int depth, int slot) {
 104   printf("\n test_local_byte: BEGIN\n\n");
 105 
 106   test_int(thr, depth, slot, "byte");
 107   test_long_inv_slot(thr, depth, slot, "byte");
 108   test_float(thr, depth, slot, "byte");
 109   test_double_inv_slot(thr, depth, slot, "byte");
 110   test_object_type_mismatch(thr, depth, slot, "byte");
 111 
 112   printf("\n test_local_byte: END\n\n");
 113 }
 114