From b5b478d8054d4db90248c1d54195fa137e25e70a Mon Sep 17 00:00:00 2001 From: Piotr Kosek Date: Fri, 31 Aug 2018 17:49:54 +0200 Subject: [PATCH] Fixed non-passed tests --- test/cxxtest/general.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/test/cxxtest/general.h b/test/cxxtest/general.h index 48dafb0..a756adf 100644 --- a/test/cxxtest/general.h +++ b/test/cxxtest/general.h @@ -330,9 +330,9 @@ class EnumTests : public CxxTest::TestSuite { void test_from_index() { - TS_ASSERT_EQUALS((+Channel::Red), Depth::_from_index(0)); - TS_ASSERT_EQUALS((+Channel::Green), Depth::_from_index(1)); - TS_ASSERT_EQUALS((+Channel::Blue), Depth::_from_index(1)); + TS_ASSERT_EQUALS((+Channel::Red), Channel::_from_index(0)); + TS_ASSERT_EQUALS((+Channel::Green), Channel::_from_index(1)); + TS_ASSERT_EQUALS((+Channel::Blue), Channel::_from_index(2)); TS_ASSERT_THROWS(Channel::_from_index(42), std::runtime_error); TS_ASSERT_EQUALS((+Depth::HighColor), Depth::_from_index(0)); @@ -358,7 +358,9 @@ class EnumTests : public CxxTest::TestSuite { maybe_channel = Channel::_from_index(2); TS_ASSERT(maybe_channel); TS_ASSERT_EQUALS(*maybe_channel, +Channel::Blue); - TS_ASSERT(!Channel::_from_index(45)); + + maybe_channel = Channel::_from_index(45); + TS_ASSERT(!maybe_channel); better_enums::optional maybe_depth = Depth::_from_index(0); TS_ASSERT(maybe_depth); @@ -367,7 +369,9 @@ class EnumTests : public CxxTest::TestSuite { maybe_depth = Depth::_from_index(1); TS_ASSERT(maybe_depth); TS_ASSERT_EQUALS(*maybe_depth, +Depth::TrueColor); - TS_ASSERT(!Channel::_from_index(45)); + + maybe_depth = Depth::_from_index(45); + TS_ASSERT(!maybe_depth); better_enums::optional maybe_compression = Compression::_from_index(0); TS_ASSERT(maybe_compression); @@ -380,7 +384,9 @@ class EnumTests : public CxxTest::TestSuite { maybe_compression = Compression::_from_index(2); TS_ASSERT(maybe_compression); TS_ASSERT_EQUALS(*maybe_compression, +Compression::Default); - TS_ASSERT(!Compression::_from_index(45)); + + maybe_compression = Compression::_from_index(45); + TS_ASSERT(!maybe_compression); } void test_from_index_unchecked()