summaryrefslogtreecommitdiff
path: root/lib/core/tests/flatten.cpp
blob: 84b3fa429e5326d4f3a124e3073c3a7d20e1f4f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <forstio/test/suite.hpp>

#include "../c++/flatten.hpp"

namespace {
namespace sch {
using namespace saw::schema;
}

SAW_TEST("Flatten Index Stride"){
	using namespace kel;

	constexpr saw::data<sch::UInt64> zero = lbm::flatten_index<sch::UInt64,3u>::stride<0u>({{2u,4u,3u}});
	constexpr saw::data<sch::UInt64> one  = lbm::flatten_index<sch::UInt64,3u>::stride<1u>({{2u,4u,3u}});
	constexpr saw::data<sch::UInt64> two  = lbm::flatten_index<sch::UInt64,3u>::stride<2u>({{2u,4u,3u}});

	SAW_EXPECT(zero.get() == 1u, "Zero is correct");
	SAW_EXPECT(one.get() == 2u, "Zero is correct");
	SAW_EXPECT(two.get() == 8u, "Zero is correct");
}

}