From ed7e81b9aefaa47e61983d14c2447bbd1f5c95c5 Mon Sep 17 00:00:00 2001 From: Oliver Reiche Date: Thu, 27 Jun 2024 17:22:32 +0200 Subject: Use (un)expected for Git repo --- test/buildtool/file_system/git_repo.test.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'test/buildtool/file_system/git_repo.test.cpp') diff --git a/test/buildtool/file_system/git_repo.test.cpp b/test/buildtool/file_system/git_repo.test.cpp index 67ad19cd..c5265aaf 100644 --- a/test/buildtool/file_system/git_repo.test.cpp +++ b/test/buildtool/file_system/git_repo.test.cpp @@ -19,7 +19,6 @@ #include #include #include -#include #include #include "catch2/catch_test_macros.hpp" @@ -468,15 +467,15 @@ TEST_CASE("Single-threaded fake repository operations -- batch 2", SECTION("Get base tree id") { auto entry_root_c = repo->GetSubtreeFromCommit(kRootCommit, ".", logger); - REQUIRE(std::holds_alternative(entry_root_c)); - CHECK(std::get(entry_root_c) == kRootId); + REQUIRE(entry_root_c); + CHECK(*entry_root_c == kRootId); } SECTION("Get inner tree id") { auto entry_baz_c = repo->GetSubtreeFromCommit(kRootCommit, "baz", logger); - REQUIRE(std::holds_alternative(entry_baz_c)); - CHECK(std::get(entry_baz_c) == kBazId); + REQUIRE(entry_baz_c); + CHECK(*entry_baz_c == kBazId); } } @@ -621,9 +620,8 @@ TEST_CASE("Multi-threaded fake repository operations", "[git_repo]") { auto entry_baz_c = remote_repo->GetSubtreeFromCommit( kRootCommit, "baz", logger); - REQUIRE(std::holds_alternative( - entry_baz_c)); - CHECK(std::get(entry_baz_c) == kBazId); + REQUIRE(entry_baz_c); + CHECK(*entry_baz_c == kBazId); } break; case 1: { auto remote_repo = GitRepo::Open(remote_cas); -- cgit v1.2.3