diff options
author | Dominick Allen <djallen@librehumanitas.org> | 2024-10-27 21:50:16 -0500 |
---|---|---|
committer | Dominick Allen <djallen@librehumanitas.org> | 2024-10-27 21:50:16 -0500 |
commit | c3cf6df863828798ed8230b0f0966bcf3b2d08dd (patch) | |
tree | c03f94128e4892d503532f7fb886dcd86fafdf72 /test | |
parent | 7174a2741a6f7aa93c9d077dee384f8aa76d7a02 (diff) |
Excise std::optional.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_directory.cpp | 4 | ||||
-rw-r--r-- | test/test_utf8.cpp | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/test/test_directory.cpp b/test/test_directory.cpp index e30dafb..58efc13 100644 --- a/test/test_directory.cpp +++ b/test/test_directory.cpp @@ -83,7 +83,7 @@ TEST(FudDirectory, Basic) auto dirEntryResult = directory.getNextEntry(); EXPECT_TRUE(dirEntryResult.isOkay()); auto dirEntryOpt = dirEntryResult.takeOkay(); - if (dirEntryOpt == std::nullopt) { + if (dirEntryOpt.isNone()) { break; } auto dirEntry{std::move(dirEntryOpt.value())}; @@ -99,7 +99,7 @@ TEST(FudDirectory, Basic) auto finalDirEntryResult = directory.getNextEntry(); EXPECT_TRUE(finalDirEntryResult.isOkay()); - EXPECT_EQ(finalDirEntryResult.getOkay(), std::nullopt); + EXPECT_TRUE(finalDirEntryResult.takeOkay().isNone()); // ASSERT_EQ(removeRecursive(testDirName), FudStatus::Success); } diff --git a/test/test_utf8.cpp b/test/test_utf8.cpp index 4b57b64..759c826 100644 --- a/test/test_utf8.cpp +++ b/test/test_utf8.cpp @@ -173,7 +173,7 @@ TEST(Utf8Test, Utf8MultiByte) Utf8Iterator utf8Iter{stringBuffer}; auto characterOpt = utf8Iter.next(); - ASSERT_TRUE(characterOpt.has_value()); + ASSERT_TRUE(characterOpt.hasValue()); // MULTI_BYTE_LITERAL "test今日素敵はですねƩ®😀z" const Array<FudUtf8, 16> multiByteCharacters{ @@ -196,8 +196,8 @@ TEST(Utf8Test, Utf8MultiByte) }; size_t idx = 0; - while (characterOpt.has_value()) { - auto character = *characterOpt; + while (characterOpt.hasValue()) { + auto character = characterOpt.value(); if (character != FudUtf8{Utf8Variant{Ascii{'\0'}}}) { EXPECT_TRUE(character.size() >= 1); ASSERT_LT(idx, multiByteCharacters.size()); @@ -212,7 +212,7 @@ TEST(Utf8Test, Utf8MultiByte) characterOpt = utf8Iter.next(); } utf8Iter.reset(); - ASSERT_TRUE(utf8Iter.next().has_value()); + ASSERT_TRUE(utf8Iter.next().hasValue()); FudUtf8 invalid = FudUtf8::invalidAscii(); ASSERT_FALSE(invalid.valid()); |