8172098: A lot of gtests uses TEST instead of TEST_VM
authorkzhaldyb
Wed, 28 Dec 2016 19:13:34 +0300
changeset 43431 5ffa076f526d
parent 43430 a815cfd97cd1
child 43432 bab7ab077676
8172098: A lot of gtests uses TEST instead of TEST_VM Reviewed-by: iignatyev
hotspot/test/native/code/test_dependencyContext.cpp
hotspot/test/native/gc/g1/test_workerDataArray.cpp
hotspot/test/native/logging/test_log.cpp
hotspot/test/native/logging/test_logConfiguration.cpp
hotspot/test/native/logging/test_logMessageTest.cpp
hotspot/test/native/logging/test_logTagSetDescriptions.cpp
--- a/hotspot/test/native/code/test_dependencyContext.cpp	Sun Jan 08 10:39:42 2017 -0800
+++ b/hotspot/test/native/code/test_dependencyContext.cpp	Wed Dec 28 19:13:34 2016 +0300
@@ -86,7 +86,7 @@
   NOT_PRODUCT(ASSERT_FALSE(depContext.is_dependent_nmethod(nm)));
 }
 
-TEST(code, dependency_context) {
+TEST_VM(code, dependency_context) {
   test_remove_dependent_nmethod(0, false);
   test_remove_dependent_nmethod(1, false);
   test_remove_dependent_nmethod(2, false);
--- a/hotspot/test/native/gc/g1/test_workerDataArray.cpp	Sun Jan 08 10:39:42 2017 -0800
+++ b/hotspot/test/native/gc/g1/test_workerDataArray.cpp	Wed Dec 28 19:13:34 2016 +0300
@@ -123,19 +123,19 @@
   }
 };
 
-TEST_F(BasicWorkerDataArrayTest, sum_test) {
+TEST_VM_F(BasicWorkerDataArrayTest, sum_test) {
   ASSERT_EQ(15u, array.sum());
 }
 
-TEST_F(BasicWorkerDataArrayTest, average_test) {
+TEST_VM_F(BasicWorkerDataArrayTest, average_test) {
   ASSERT_NEAR(5.0, array.average(), epsilon);
 }
 
-TEST_F(BasicWorkerDataArrayTest, print_summary_on_test) {
+TEST_VM_F(BasicWorkerDataArrayTest, print_summary_on_test) {
   ASSERT_STREQ(print_expected_summary(), print_summary());
 }
 
-TEST_F(BasicWorkerDataArrayTest, print_details_on_test) {
+TEST_VM_F(BasicWorkerDataArrayTest, print_details_on_test) {
   ASSERT_STREQ(print_expected_details(), print_details());
 }
 
@@ -161,19 +161,19 @@
   }
 };
 
-TEST_F(AddWorkerDataArrayTest, sum_test) {
+TEST_VM_F(AddWorkerDataArrayTest, sum_test) {
   ASSERT_EQ(18u, array.sum());
 }
 
-TEST_F(AddWorkerDataArrayTest, average_test) {
+TEST_VM_F(AddWorkerDataArrayTest, average_test) {
   ASSERT_NEAR(6.0, array.average(), epsilon);
 }
 
-TEST_F(AddWorkerDataArrayTest, print_summary_on_test) {
+TEST_VM_F(AddWorkerDataArrayTest, print_summary_on_test) {
   ASSERT_STREQ(print_expected_summary(), print_summary());
 }
 
-TEST_F(AddWorkerDataArrayTest, print_details_on_test) {
+TEST_VM_F(AddWorkerDataArrayTest, print_details_on_test) {
   ASSERT_STREQ(print_expected_details(), print_details());
 }
 
@@ -195,19 +195,19 @@
   }
 };
 
-TEST_F(UninitializedElementWorkerDataArrayTest, sum_test) {
+TEST_VM_F(UninitializedElementWorkerDataArrayTest, sum_test) {
   ASSERT_EQ(12u, array.sum());
 }
 
-TEST_F(UninitializedElementWorkerDataArrayTest, average_test) {
+TEST_VM_F(UninitializedElementWorkerDataArrayTest, average_test) {
   ASSERT_NEAR(6.0, array.average(), epsilon);
 }
 
-TEST_F(UninitializedElementWorkerDataArrayTest, print_summary_on_test) {
+TEST_VM_F(UninitializedElementWorkerDataArrayTest, print_summary_on_test) {
   ASSERT_STREQ(print_expected_summary(), print_summary());
 }
 
-TEST_F(UninitializedElementWorkerDataArrayTest, print_details_on_test) {
+TEST_VM_F(UninitializedElementWorkerDataArrayTest, print_details_on_test) {
   ASSERT_STREQ(print_expected_details(), print_details());
 }
 
@@ -229,19 +229,19 @@
   }
 };
 
-TEST_F(UninitializedWorkerDataArrayTest, sum_test) {
+TEST_VM_F(UninitializedWorkerDataArrayTest, sum_test) {
   ASSERT_EQ(0u, array.sum());
 }
 
-TEST_F(UninitializedWorkerDataArrayTest, average_test) {
+TEST_VM_F(UninitializedWorkerDataArrayTest, average_test) {
   ASSERT_NEAR(0.0, array.average(), epsilon);
 }
 
-TEST_F(UninitializedWorkerDataArrayTest, print_summary_on_test) {
+TEST_VM_F(UninitializedWorkerDataArrayTest, print_summary_on_test) {
   ASSERT_STREQ(print_expected_summary(), print_summary());
 }
 
-TEST_F(UninitializedWorkerDataArrayTest, print_details_on_test) {
+TEST_VM_F(UninitializedWorkerDataArrayTest, print_details_on_test) {
   ASSERT_STREQ(print_expected_details(), print_details());
 }
 
@@ -265,18 +265,18 @@
   }
 };
 
-TEST_F(UninitializedDoubleElementWorkerDataArrayTest, sum_test) {
+TEST_VM_F(UninitializedDoubleElementWorkerDataArrayTest, sum_test) {
   ASSERT_NEAR(12.3 / MILLIUNITS, array.sum(), epsilon);
 }
 
-TEST_F(UninitializedDoubleElementWorkerDataArrayTest, average_test) {
+TEST_VM_F(UninitializedDoubleElementWorkerDataArrayTest, average_test) {
   ASSERT_NEAR(6.15 / MILLIUNITS, array.average(), epsilon);
 }
 
-TEST_F(UninitializedDoubleElementWorkerDataArrayTest, print_summary_on_test) {
+TEST_VM_F(UninitializedDoubleElementWorkerDataArrayTest, print_summary_on_test) {
   ASSERT_STREQ(print_expected_summary(), print_summary());
 }
 
-TEST_F(UninitializedDoubleElementWorkerDataArrayTest, print_details_on_test) {
+TEST_VM_F(UninitializedDoubleElementWorkerDataArrayTest, print_details_on_test) {
   ASSERT_STREQ(print_expected_details(), print_details());
 }
--- a/hotspot/test/native/logging/test_log.cpp	Sun Jan 08 10:39:42 2017 -0800
+++ b/hotspot/test/native/logging/test_log.cpp	Wed Dec 28 19:13:34 2016 +0300
@@ -41,14 +41,14 @@
 }
 
 #ifdef ASSERT // 'test' tag is debug only
-TEST_F(LogTest, prefix) {
+TEST_VM_F(LogTest, prefix) {
   set_log_config(TestLogFileName, "logging+test=trace");
   log_trace(logging, test)(LOG_LINE_STR);
   EXPECT_TRUE(file_contains_substring(TestLogFileName, LOG_PREFIX_STR LOG_LINE_STR));
 }
 #endif
 
-TEST_F(LogTest, large_message) {
+TEST_VM_F(LogTest, large_message) {
   char big_msg[4096] = {0};
   char Xchar = '~';
 
@@ -68,7 +68,7 @@
   EXPECT_EQ(sizeof(big_msg) - 1, count);
 }
 
-TEST_F(LogTest, enabled_logtarget) {
+TEST_VM_F(LogTest, enabled_logtarget) {
   set_log_config(TestLogFileName, "gc=debug");
 
   LogTarget(Debug, gc) log;
@@ -80,7 +80,7 @@
   EXPECT_TRUE(file_contains_substring(TestLogFileName, LOG_TEST_STRING_LITERAL));
 }
 
-TEST_F(LogTest, disabled_logtarget) {
+TEST_VM_F(LogTest, disabled_logtarget) {
   set_log_config(TestLogFileName, "gc=info");
 
   LogTarget(Debug, gc) log;
@@ -95,7 +95,7 @@
   EXPECT_FALSE(file_contains_substring(TestLogFileName, LOG_TEST_STRING_LITERAL));
 }
 
-TEST_F(LogTest, enabled_loghandle) {
+TEST_VM_F(LogTest, enabled_loghandle) {
   set_log_config(TestLogFileName, "gc=debug");
 
   Log(gc) log;
@@ -109,7 +109,7 @@
   EXPECT_TRUE(file_contains_substring(TestLogFileName, "3 workers"));
 }
 
-TEST_F(LogTest, disabled_loghandle) {
+TEST_VM_F(LogTest, disabled_loghandle) {
   set_log_config(TestLogFileName, "gc=info");
 
   Log(gc) log;
@@ -126,7 +126,7 @@
   EXPECT_FALSE(file_contains_substring(TestLogFileName, "3 workers"));
 }
 
-TEST_F(LogTest, enabled_logtargethandle) {
+TEST_VM_F(LogTest, enabled_logtargethandle) {
   set_log_config(TestLogFileName, "gc=debug");
 
   LogTarget(Debug, gc) log;
@@ -140,7 +140,7 @@
   EXPECT_TRUE(file_contains_substring(TestLogFileName, "3 workers"));
 }
 
-TEST_F(LogTest, disabled_logtargethandle) {
+TEST_VM_F(LogTest, disabled_logtargethandle) {
   set_log_config(TestLogFileName, "gc=info");
 
   LogTarget(Debug, gc) log;
--- a/hotspot/test/native/logging/test_logConfiguration.cpp	Sun Jan 08 10:39:42 2017 -0800
+++ b/hotspot/test/native/logging/test_logConfiguration.cpp	Wed Dec 28 19:13:34 2016 +0300
@@ -297,7 +297,7 @@
   }
 }
 
-TEST_F(LogConfigurationTest, configure_stdout) {
+TEST_VM_F(LogConfigurationTest, configure_stdout) {
   // Start out with all logging disabled
   LogConfiguration::disable_logging();
 
@@ -355,7 +355,7 @@
   Test_logconfiguration_subscribe_triggered++;
 }
 
-TEST_F(LogConfigurationTest, subscribe) {
+TEST_VM_F(LogConfigurationTest, subscribe) {
   ResourceMark rm;
   Log(logging) log;
   set_log_config("stdout", "logging*=trace");
--- a/hotspot/test/native/logging/test_logMessageTest.cpp	Sun Jan 08 10:39:42 2017 -0800
+++ b/hotspot/test/native/logging/test_logMessageTest.cpp	Wed Dec 28 19:13:34 2016 +0300
@@ -65,7 +65,7 @@
 
 // Verify that messages with multiple levels are written
 // to outputs configured for all the corresponding levels
-TEST_F(LogMessageTest, level_inclusion) {
+TEST_VM_F(LogMessageTest, level_inclusion) {
   const size_t message_count = 10;
   LogMessageBuffer msg[message_count];
 
@@ -119,7 +119,7 @@
 }
 
 // Verify that messages are logged in the order they are added to the log message
-TEST_F(LogMessageTest, line_order) {
+TEST_VM_F(LogMessageTest, line_order) {
   LogMessageBuffer msg;
   msg.info("info line").error("error line").trace("trace line")
       .error("another error").warning("warning line").debug("debug line");
@@ -131,7 +131,7 @@
     << "output missing or in incorrect order";
 }
 
-TEST_F(LogMessageTest, long_message) {
+TEST_VM_F(LogMessageTest, long_message) {
   // Write 10K bytes worth of log data
   LogMessageBuffer msg;
   const size_t size = 10 * K;
@@ -155,7 +155,7 @@
   FREE_C_HEAP_ARRAY(char, data);
 }
 
-TEST_F(LogMessageTest, message_with_many_lines) {
+TEST_VM_F(LogMessageTest, message_with_many_lines) {
   const size_t lines = 100;
   const size_t line_length = 16;
 
@@ -188,7 +188,7 @@
   return prefix_len;
 }
 
-TEST_F(LogMessageTest, prefixing) {
+TEST_VM_F(LogMessageTest, prefixing) {
   LogMessageBuffer msg;
   msg.set_prefix(dummy_prefixer);
   for (int i = 0; i < 3; i++) {
@@ -209,7 +209,7 @@
     << "error in prefixed output";
 }
 
-TEST_F(LogMessageTest, scoped_messages) {
+TEST_VM_F(LogMessageTest, scoped_messages) {
   {
     LogMessage(logging) msg;
     msg.info("scoped info");
@@ -223,7 +223,7 @@
     << "missing output from scoped log message";
 }
 
-TEST_F(LogMessageTest, scoped_flushing) {
+TEST_VM_F(LogMessageTest, scoped_flushing) {
   {
     LogMessage(logging) msg;
     msg.info("manual flush info");
@@ -236,7 +236,7 @@
     << "log file contains duplicate lines from single scoped log message";
 }
 
-TEST_F(LogMessageTest, scoped_reset) {
+TEST_VM_F(LogMessageTest, scoped_reset) {
   {
     LogMessage(logging) msg, partial;
     msg.info("%s", "info reset msg");
--- a/hotspot/test/native/logging/test_logTagSetDescriptions.cpp	Sun Jan 08 10:39:42 2017 -0800
+++ b/hotspot/test/native/logging/test_logTagSetDescriptions.cpp	Wed Dec 28 19:13:34 2016 +0300
@@ -30,7 +30,7 @@
 #include "unittest.hpp"
 #include "utilities/ostream.hpp"
 
-TEST(LogTagSetDescriptions, describe) {
+TEST_VM(LogTagSetDescriptions, describe) {
   for (LogTagSetDescription* d = tagset_descriptions; d->tagset != NULL; d++) {
     char expected[1 * K];
     d->tagset->label(expected, sizeof(expected), "+");
@@ -46,7 +46,7 @@
   }
 }
 
-TEST(LogTagSetDescriptions, command_line_help) {
+TEST_VM(LogTagSetDescriptions, command_line_help) {
   const char* filename = "logtagset_descriptions";
   FILE* fp = fopen(filename, "w+");
   ASSERT_NE((void*)NULL, fp);