8371343: ZGC: Remove dependency on test execution order for gtests

Reviewed-by: stefank, eosterlund
This commit is contained in:
Axel Boldt-Christmas 2025-11-10 05:53:36 +00:00
parent 4a14c81a06
commit 66e5a68a33
3 changed files with 7 additions and 11 deletions

View File

@ -309,8 +309,6 @@ public:
};
class ZGlobalsPointers : public AllStatic {
friend class ZAddressTest;
private:
static void set_good_masks();
static void pd_set_good_masks();

View File

@ -23,9 +23,9 @@
#include "gc/z/zAddress.inline.hpp"
#include "gc/z/zGlobals.hpp"
#include "unittest.hpp"
#include "zunittest.hpp"
class ZAddressTest : public ::testing::Test {
class ZAddressTest : public ZTest {
protected:
static zpointer color(uintptr_t value, uintptr_t color) {
return ZAddress::color(zaddress(value | ZAddressHeapBase), color);
@ -374,8 +374,7 @@ protected:
static void is_checks() {
int young_phase = 0;
int old_phase = 0;
// Setup
ZGlobalsPointers::initialize();
test_is_checks_on_all();
advance_and_test_old_phase(old_phase, 4);
@ -431,6 +430,6 @@ protected:
}
};
TEST_F(ZAddressTest, is_checks) {
TEST_VM_F(ZAddressTest, is_checks) {
is_checks();
}

View File

@ -24,9 +24,9 @@
#include "gc/z/zGenerationId.hpp"
#include "gc/z/zGlobals.hpp"
#include "gc/z/zLiveMap.inline.hpp"
#include "unittest.hpp"
#include "zunittest.hpp"
class ZLiveMapTest : public ::testing::Test {
class ZLiveMapTest : public ZTest {
private:
// Setup and tear down
ZHeap* _old_heap;
@ -36,7 +36,6 @@ private:
public:
virtual void SetUp() {
ZGlobalsPointers::initialize();
_old_heap = ZHeap::_heap;
ZHeap::_heap = (ZHeap*)os::malloc(sizeof(ZHeap), mtTest);
@ -84,6 +83,6 @@ protected:
}
};
TEST_F(ZLiveMapTest, strongly_live_for_large_zpage) {
TEST_VM_F(ZLiveMapTest, strongly_live_for_large_zpage) {
strongly_live_for_large_zpage();
}