mirror of
https://github.com/nodejs/node.git
synced 2025-05-16 03:17:26 +00:00

PR-URL: https://github.com/nodejs/node/pull/32831 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
40 lines
956 B
C++
40 lines
956 B
C++
// Copyright 2020 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef V8_UNITTESTS_HEAP_CPPGC_TESTS_H_
|
|
#define V8_UNITTESTS_HEAP_CPPGC_TESTS_H_
|
|
|
|
#include "include/cppgc/heap.h"
|
|
#include "include/cppgc/platform.h"
|
|
#include "src/base/page-allocator.h"
|
|
#include "testing/gtest/include/gtest/gtest.h"
|
|
|
|
namespace cppgc {
|
|
namespace testing {
|
|
|
|
class TestWithPlatform : public ::testing::Test {
|
|
protected:
|
|
static void SetUpTestSuite();
|
|
static void TearDownTestSuite();
|
|
|
|
private:
|
|
static std::unique_ptr<cppgc::PageAllocator> page_allocator_;
|
|
};
|
|
|
|
class TestWithHeap : public TestWithPlatform {
|
|
protected:
|
|
void SetUp() override;
|
|
void TearDown() override;
|
|
|
|
Heap* GetHeap() const { return heap_.get(); }
|
|
|
|
private:
|
|
std::unique_ptr<cppgc::Heap> heap_;
|
|
};
|
|
|
|
} // namespace testing
|
|
} // namespace cppgc
|
|
|
|
#endif // V8_UNITTESTS_HEAP_CPPGC_TESTS_H_
|