File: bitmatrix.cpp

package info (click to toggle)
terraphast 0.0%2Bgit20200413.8af2e4c%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 812 kB
  • sloc: cpp: 5,923; sh: 93; ansic: 55; makefile: 26
file content (23 lines) | stat: -rw-r--r-- 429 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <catch.hpp>

#include <terraces/bitmatrix.hpp>

namespace terraces {
namespace tests {

TEST_CASE("bitmatrix-construction", "[bitmatrix]") {
	auto mat = bitmatrix{10, 5};
	CHECK(mat.rows() == 10);
	CHECK(mat.cols() == 5);
}

TEST_CASE("bitmatrix set/get", "[bitmatrix]") {
	auto mat = bitmatrix{3, 4};

	CHECK(!mat.get(1, 2));
	mat.set(1, 2, true);
	CHECK(mat.get(1, 2));
}

} // namespace tests
} // namespace terraces