1 #include "../../src/piece.h"
2 #include "gtest/gtest.h"
4 TEST(PieceTest
, Constructor
)
6 for (const Color
&c
: COLORS
) {
7 for (const PieceType
&t
: PIECE_TYPES
) {
8 for (int i
= 0; i
< 9; ++i
) {
12 EXPECT_EQ(c
, p
.color());
13 EXPECT_NE(!c
, p
.color());
14 EXPECT_EQ(t
, p
.type());
15 EXPECT_EQ(i
, p
.index());
18 EXPECT_FALSE(p
.is(!c
));
20 EXPECT_TRUE(p
.is(c
, t
));
21 EXPECT_FALSE(p
.is(!c
, t
));
23 // Test comparison operators
24 for (const Color
&c2
: COLORS
) {
25 for (const PieceType
&t2
: PIECE_TYPES
) {
26 for (int j
= 0; j
< 9; ++j
) {
28 if (c
== c2
&& t
== t2
&& i
== j
) {
43 EXPECT_EQ(sizeof(unsigned char), sizeof(Piece
));