aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/memoryview.cpp
blob: 1f6a6996c11dd91a9fe7ebeda56ae2ffde710683 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright Epic Games, Inc. All Rights Reserved.

#include <zencore/except.h>
#include <zencore/fmtutils.h>
#include <zencore/intmath.h>
#include <zencore/memory/memory.h>
#include <zencore/memoryview.h>
#include <zencore/testing.h>
#include <zencore/zencore.h>

#include <cstdlib>

namespace zen {

//
// Unit tests
//

#if ZEN_WITH_TESTS

TEST_CASE("MemoryView")
{
	{
		uint8_t	   Array1[16] = {};
		MemoryView View1	  = MakeMemoryView(Array1);
		CHECK(View1.GetSize() == 16);
	}

	{
		uint32_t   Array2[16] = {};
		MemoryView View2	  = MakeMemoryView(Array2);
		CHECK(View2.GetSize() == 64);
	}

	CHECK(MakeMemoryView<float>({1.0f, 1.2f}).GetSize() == 8);
}

void
memory_forcelink()
{
}

#endif

}  // namespace zen