7 #include <gtest/gtest.h>
9 namespace etrobocon2018_test {
10 TEST(AIAnswerArrayTest, construct)
15 TEST(AIAnswerArrayTest, constructSpecifiedSize)
20 TEST(AIAnswerArrayTest, constructSpecifiedType)
26 TEST(AIAnswerArrayTest, sizeTest)
29 ASSERT_EQ(6, array.
size());
32 ASSERT_EQ(1, list.size());
35 TEST(AIAnswerArrayTest, positionTest)
47 TEST(AIAnswerArrayTest, atTest)
50 ASSERT_EQ(0, array.
at(0));
53 ASSERT_EQ(100, array.
at(0));
56 ASSERT_EQ(200, array.
at(1));
59 TEST(AIAnswerArrayTest, atTestDouble)
62 ASSERT_DOUBLE_EQ(0.0, array.
at(0));
65 ASSERT_DOUBLE_EQ(1.2, array.
at(0));
68 TEST(AIAnswerArrayTest, operatorTest)
71 ASSERT_EQ(0, array[0]);
74 ASSERT_EQ(100, array[0]);
77 ASSERT_EQ(200, array[1]);
80 TEST(AIAnswerArrayTest, castTest)
83 ASSERT_EQ(0, array.
cast(0));
86 TEST(AIAnswerArrayTest, probsTest)
92 ASSERT_EQ(1.0, array.
probs[2]);
96 TEST(AIAnswerArrayTest, handwritingTest)
105 ASSERT_EQ(1, array1.handwriting());
109 ASSERT_EQ(2, array2.handwriting());
113 ASSERT_EQ(3, array3.handwriting());
117 ASSERT_EQ(4, array4.handwriting());
121 ASSERT_EQ(5, array5.handwriting());
125 ASSERT_EQ(6, array6.handwriting());
129 ASSERT_EQ(7, array7.handwriting());
constexpr T at(const std::uint8_t i) noexcept
std::array< float, 8 > probs
std::int8_t handwriting() noexcept
TEST(AIAnswerArrayTest, construct)
constexpr std::uint8_t position() noexcept
配列の要素を指し示すポインタを返す
constexpr std::uint8_t size() noexcept
配列のサイズを返す
void push_back(const T &value) noexcept
配列の要素を入れる