MCPcopy Create free account
hub / github.com/NetSys/bess / SetUp

Method SetUp

core/memory_test.cc:33–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31class HugepageTest : public ::testing::TestWithParam<HugepageSize> {
32 public:
33 virtual void SetUp() override {
34 HugepageSize type = GetParam();
35 size_ = static_cast<size_t>(type);
36 ptr_ = AllocHugepage(type);
37
38 if (ptr_ == nullptr) {
39 std::cerr << "Hugepage (" << size_ << " bytes) not available."
40 << " Skipping test..." << std::endl;
41 } else {
42 ASSERT_LE(kVirtualAddressStart, reinterpret_cast<uintptr_t>(ptr_));
43 ASSERT_GT(kVirtualAddressEnd, reinterpret_cast<uintptr_t>(ptr_));
44 }
45 }
46
47 virtual void TearDown() override { FreeHugepage(ptr_); }
48

Callers

nothing calls this directly

Calls 1

AllocHugepageFunction · 0.85

Tested by

no test coverage detected