Update catch2 version

This commit is contained in:
Jan
2023-06-18 13:39:40 +02:00
parent 34cdd46b42
commit 6c164eee61
31 changed files with 128 additions and 46 deletions

View File

@ -48,5 +48,6 @@ function ObjCommonTests:project()
catch2:include(includes)
links:linkto(ObjCommon)
links:linkto(catch2)
links:linkall()
end

View File

@ -1,4 +1,5 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators.hpp>
#include <type_traits>

View File

@ -1,4 +1,5 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators.hpp>
#include <sstream>

View File

@ -1,2 +0,0 @@
#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>

View File

@ -49,5 +49,6 @@ function ObjLoadingTests:project()
links:linkto(ParserTestUtils)
links:linkto(ObjLoading)
links:linkto(catch2)
links:linkall()
end

View File

@ -1,4 +1,6 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/matchers/catch_matchers_floating_point.hpp>
#include <catch2/generators/catch_generators.hpp>
#include <string>
@ -12,6 +14,7 @@
using namespace menu;
using namespace IW4;
using namespace std::literals;
using namespace Catch::Matchers;
namespace test::game::iw4::menu::parsing::it
{
@ -184,10 +187,10 @@ namespace test::game::iw4::menu::parsing::it
REQUIRE(menu->fullScreen > 0);
REQUIRE(menu->window.staticFlags & WINDOW_FLAG_SCREEN_SPACE);
REQUIRE(menu->window.staticFlags & WINDOW_FLAG_DECORATION);
REQUIRE(menu->window.rect.x == Approx(420));
REQUIRE(menu->window.rect.y == Approx(1337));
REQUIRE(menu->window.rect.w == Approx(12));
REQUIRE(menu->window.rect.h == Approx(64));
REQUIRE_THAT(menu->window.rect.x, WithinRel(420.0f));
REQUIRE_THAT(menu->window.rect.y, WithinRel(1337.0f));
REQUIRE_THAT(menu->window.rect.w, WithinRel(12.0f));
REQUIRE_THAT(menu->window.rect.h, WithinRel(64.0f));
REQUIRE(menu->window.rect.horzAlign == 1);
REQUIRE(menu->window.rect.vertAlign == 2);
REQUIRE(menu->window.style == 5);
@ -250,16 +253,16 @@ namespace test::game::iw4::menu::parsing::it
REQUIRE(menu->onESC->eventHandlers[0]->eventData.unconditionalScript == R"("setColor" "1" "0.5" "0.1" "1" ; )"s);
REQUIRE(menu->window.border == 1);
REQUIRE(menu->window.borderSize == Approx(1.25));
REQUIRE(menu->window.borderSize == Approx(1.25));
REQUIRE(menu->window.backColor[0] == Approx(1));
REQUIRE(menu->window.backColor[1] == Approx(0.8));
REQUIRE(menu->window.backColor[2] == Approx(0.4));
REQUIRE(menu->window.backColor[3] == Approx(0.95));
REQUIRE(menu->window.foreColor[0] == Approx(0.7));
REQUIRE(menu->window.foreColor[1] == Approx(0));
REQUIRE(menu->window.foreColor[2] == Approx(0));
REQUIRE(menu->window.foreColor[3] == Approx(0));
REQUIRE_THAT(menu->window.borderSize, WithinRel(1.25f));
REQUIRE_THAT(menu->window.borderSize, WithinRel(1.25));
REQUIRE_THAT(menu->window.backColor[0], WithinRel(1.0f));
REQUIRE_THAT(menu->window.backColor[1], WithinRel(0.8f));
REQUIRE_THAT(menu->window.backColor[2], WithinRel(0.4f));
REQUIRE_THAT(menu->window.backColor[3], WithinRel(0.95f));
REQUIRE_THAT(menu->window.foreColor[0], WithinRel(0.7f));
REQUIRE_THAT(menu->window.foreColor[1], WithinRel(0.0f));
REQUIRE_THAT(menu->window.foreColor[2], WithinRel(0.0f));
REQUIRE_THAT(menu->window.foreColor[3], WithinRel(0.0f));
REQUIRE(menu->window.background == funnyDogMaterial);
REQUIRE(menu->onKey != nullptr);

View File

@ -1,4 +1,5 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators.hpp>
#include "Parsing/Menu/Domain/EventHandler/CommonEventHandlerScript.h"
#include "Parsing/Menu/Domain/EventHandler/CommonEventHandlerSetLocalVar.h"

View File

@ -1,4 +1,5 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators.hpp>
#include "Utils/ClassUtils.h"
#include "Parsing/Menu/Sequence/ItemScopeSequences.h"

View File

@ -1,2 +0,0 @@
#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>

View File

@ -48,5 +48,6 @@ function ParserTestUtils:project()
catch2:include(includes)
links:linkto(Parser)
links:linkto(catch2)
links:linkall()
end

View File

@ -49,5 +49,6 @@ function ParserTests:project()
links:linkto(ParserTestUtils)
links:linkto(Parser)
links:linkto(catch2)
links:linkall()
end

View File

@ -1,4 +1,5 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators.hpp>
#include "Parsing/Impl/CommentRemovingStreamProxy.h"
#include "Parsing/Mock/MockParserLineStream.h"

View File

@ -1,4 +1,5 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators.hpp>
#include "Parsing/Impl/DefinesStreamProxy.h"
#include "Parsing/Mock/MockParserLineStream.h"

View File

@ -1,4 +1,5 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators.hpp>
#include "Parsing/Impl/IncludingStreamProxy.h"
#include "Parsing/Mock/MockParserLineStream.h"

View File

@ -1,4 +1,5 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators.hpp>
#include "Parsing/Impl/PackDefinitionStreamProxy.h"
#include "Parsing/Mock/MockParserLineStream.h"

View File

@ -1,4 +1,5 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators.hpp>
#include <sstream>

View File

@ -1,2 +0,0 @@
#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>

View File

@ -49,5 +49,6 @@ function ZoneCodeGeneratorLibTests:project()
links:linkto(ZoneCodeGeneratorLib)
links:linkto(ParserTestUtils)
links:linkto(catch2)
links:linkall()
end

View File

@ -1,4 +1,5 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators.hpp>
#include "Parsing/Commands/Impl/CommandsLexer.h"
#include "Parsing/Mock/MockParserLineStream.h"

View File

@ -1,4 +1,5 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators.hpp>
#include "Utils/ClassUtils.h"
#include "Parsing/Commands/Sequence/SequenceAction.h"

View File

@ -1,4 +1,5 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators.hpp>
#include "Utils/ClassUtils.h"
#include "Parsing/Commands/Sequence/SequenceArchitecture.h"

View File

@ -1,4 +1,5 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators.hpp>
#include "Utils/ClassUtils.h"
#include "Parsing/Commands/Sequence/SequenceGame.h"

View File

@ -1,8 +1,12 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/matchers/catch_matchers_floating_point.hpp>
#include <catch2/generators/catch_generators.hpp>
#include "Parsing/Header/Impl/HeaderLexer.h"
#include "Parsing/Mock/MockParserLineStream.h"
using namespace Catch::Matchers;
namespace test::parsing::header::impl::header_lexer
{
void ExpectCharacterToken(HeaderLexer& lexer, char c)
@ -22,7 +26,8 @@ namespace test::parsing::header::impl::header_lexer
void ExpectFloatingPointToken(HeaderLexer& lexer, double number)
{
REQUIRE(lexer.GetToken(0).m_type == HeaderParserValueType::FLOATING_POINT);
REQUIRE(lexer.GetToken(0).FloatingPointValue() == Approx(number));
const auto a = lexer.GetToken(0).FloatingPointValue();
REQUIRE_THAT(lexer.GetToken(0).FloatingPointValue(), WithinRel(number));
lexer.PopTokens(1);
}

View File

@ -1,4 +1,5 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators.hpp>
#include "Parsing/Header/Sequence/SequenceNamespace.h"
#include "Parsing/Mock/MockLexer.h"

View File

@ -1,5 +1,7 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators.hpp>
#include <algorithm>
#include <sstream>
#include "Utils/ClassUtils.h"

View File

@ -1,2 +0,0 @@
#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>

View File

@ -49,6 +49,7 @@ function ZoneCommonTests:project()
catch2:include(includes)
links:linkto(ZoneCommon)
links:linkto(catch2)
links:linkall()
ZoneCode:use()

View File

@ -1,2 +0,0 @@
#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>