test/hotspot/gtest/runtime/test_perfdata.cpp
author dfuchs
Fri, 06 Sep 2019 14:04:44 +0100
changeset 58031 5aaf53d4fe63
parent 47669 e362049c1cb8
permissions -rw-r--r--
8230694: http.keepAlive system property is inconsistently/incorrectly documented Summary: trivially fixed the net-properties.html file Reviewed-by: alanb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
47669
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
     1
/*
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
     2
 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
     4
 *
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
     7
 * published by the Free Software Foundation.
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
     8
 *
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    13
 * accompanied this code).
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    14
 *
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    18
 *
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    21
 * questions.
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    22
 */
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    23
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    24
#include "precompiled.hpp"
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    25
#include "runtime/perfMemory.hpp"
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    26
#include "unittest.hpp"
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    27
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    28
class PerfMemoryTest : public ::testing::Test {
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    29
  public:
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    30
    static char* top() { return PerfMemory::_top; }
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    31
    static PerfDataPrologue* prologue() { return PerfMemory::_prologue; }
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    32
};
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    33
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    34
TEST_VM_F(PerfMemoryTest, destroy) {
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    35
  PerfMemory::destroy();
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    36
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    37
  ASSERT_NE(PerfMemory::start(), (char*)NULL) << "PerfMemory::_start should not be NULL";
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    38
  ASSERT_NE(PerfMemory::end(), (char*)NULL) << "PerfMemory::_end should not be NULL";
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    39
  ASSERT_NE(PerfMemoryTest::top(), (char*)NULL) << "PerfMemory::_top should not be NULL";
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    40
  ASSERT_NE(PerfMemoryTest::prologue(), (PerfDataPrologue*)NULL) << "PerfMemory::_prologue should not be NULL";
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    41
  ASSERT_NE(PerfMemory::capacity(), (size_t)0) << "PerfMemory::_capacity should not be 0";
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    42
}
e362049c1cb8 8151815: Could not parse core image with JSnap.
ysuenaga
parents:
diff changeset
    43