aboutsummaryrefslogtreecommitdiff
path: root/lib/tst/allocator.hh
blob: 3bc1715ceac9df5a9e53261523e9fbfa58618e3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#pragma once

class TestAllocator : public ::testing::Test {
protected:
  void
  SetUp() override
  {
    memory = malloc(memory_size);
    libk::alloc_init(memory, memory_size);
    ASSERT_EQ(libk::begin, memory);
  }

  void
  TearDown() override
  {
    free(memory);
    libk::begin = nullptr;
  }

  const size_t memory_size = 4096;
  void *memory = nullptr;
};