src/hotspot/share/utilities/internalVMTests.cpp
author coleenp
Mon, 29 Oct 2018 10:21:34 -0400
changeset 52311 274ba8fbd96d
parent 52290 db83eceba962
child 52321 52d3bb5ba2f7
permissions -rw-r--r--
8212958: Allow Klass::_subklass and _next_sibling to have unloaded classes Summary: Don't return unloaded klasses. Make sure access is protected by Compile_lock. Reviewed-by: eosterlund, dlong
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35519
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
     1
/*
51258
2ce72467c4e8 8171157: Convert ObjectMonitor_test to GTest
dcubed
parents: 50208
diff changeset
     2
 * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
35519
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
     4
 *
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
     7
 * published by the Free Software Foundation.
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
     8
 *
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    13
 * accompanied this code).
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    14
 *
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    18
 *
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    21
 * questions.
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    22
 *
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    23
 */
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    24
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    25
#include "precompiled.hpp"
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    26
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    27
#ifndef PRODUCT
50208
a20f2b3c321f 8202848: -XX:+ExecuteInternalVMTests asserts with "assert(cd.valid() == true) failed: failed on a valid DirectivesParser string"
thartmann
parents: 49389
diff changeset
    28
#include <locale.h>
35519
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    29
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    30
#include "utilities/internalVMTests.hpp"
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    31
#include "utilities/macros.hpp"
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    32
#include "utilities/ostream.hpp"
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    33
35932
511dd7b5313b 8148844: Update run_unit_test macro for InternalVMTests
ehelin
parents: 35852
diff changeset
    34
#define run_unit_test(unit_test_function_call)                \
511dd7b5313b 8148844: Update run_unit_test macro for InternalVMTests
ehelin
parents: 35852
diff changeset
    35
  void unit_test_function_call();                             \
511dd7b5313b 8148844: Update run_unit_test macro for InternalVMTests
ehelin
parents: 35852
diff changeset
    36
  run_test(#unit_test_function_call, unit_test_function_call);
35519
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    37
35932
511dd7b5313b 8148844: Update run_unit_test macro for InternalVMTests
ehelin
parents: 35852
diff changeset
    38
void InternalVMTests::run_test(const char* name, void (*test)()) {
511dd7b5313b 8148844: Update run_unit_test macro for InternalVMTests
ehelin
parents: 35852
diff changeset
    39
  tty->print_cr("Running test: %s", name);
511dd7b5313b 8148844: Update run_unit_test macro for InternalVMTests
ehelin
parents: 35852
diff changeset
    40
  test();
511dd7b5313b 8148844: Update run_unit_test macro for InternalVMTests
ehelin
parents: 35852
diff changeset
    41
}
35519
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    42
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    43
void InternalVMTests::run() {
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    44
  tty->print_cr("Running internal VM tests");
35932
511dd7b5313b 8148844: Update run_unit_test macro for InternalVMTests
ehelin
parents: 35852
diff changeset
    45
  run_unit_test(TestReserveMemorySpecial_test);
49389
9ef2eee8ca7c 8199430: Rename MetaspaceAux to something more meaningful
stuefe
parents: 49365
diff changeset
    46
  run_unit_test(TestMetaspaceUtils_test);
35932
511dd7b5313b 8148844: Update run_unit_test macro for InternalVMTests
ehelin
parents: 35852
diff changeset
    47
  run_unit_test(GCTimer_test);
35519
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    48
  tty->print_cr("All internal VM tests passed");
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    49
}
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    50
9200162499f7 8146994: Move internal vm tests to a separate file
ehelin
parents:
diff changeset
    51
#endif