mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-10 14:58:10 -05:00
Reformat code with clang format
This commit is contained in:
@ -1,13 +1,10 @@
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <catch2/generators/catch_generators.hpp>
|
||||
|
||||
#include "Parsing/Commands/Impl/CommandsLexer.h"
|
||||
#include "Parsing/Mock/MockParserLineStream.h"
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <catch2/generators/catch_generators.hpp>
|
||||
|
||||
namespace test::parsing::commands::impl::commands_lexer
|
||||
{
|
||||
TEST_CASE("CommandsLexer: ", "[parsing][commands]")
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
TEST_CASE("CommandsLexer: ", "[parsing][commands]") {}
|
||||
} // namespace test::parsing::commands::impl::commands_lexer
|
||||
|
@ -1,12 +1,12 @@
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <catch2/generators/catch_generators.hpp>
|
||||
|
||||
#include "Utils/ClassUtils.h"
|
||||
#include "Parsing/Commands/Sequence/SequenceAction.h"
|
||||
#include "Parsing/Mock/MockLexer.h"
|
||||
#include "Parsing/PostProcessing/CreateMemberInformationPostProcessor.h"
|
||||
#include "Parsing/PostProcessing/CreateStructureInformationPostProcessor.h"
|
||||
#include "Persistence/InMemory/InMemoryRepository.h"
|
||||
#include "Utils/ClassUtils.h"
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <catch2/generators/catch_generators.hpp>
|
||||
|
||||
namespace test::parsing::commands::sequence::sequence_action
|
||||
{
|
||||
@ -54,8 +54,7 @@ namespace test::parsing::commands::sequence::sequence_action
|
||||
auto createStructureInformation = std::make_unique<CreateStructureInformationPostProcessor>();
|
||||
auto createMemberInformation = std::make_unique<CreateMemberInformationPostProcessor>();
|
||||
|
||||
return createStructureInformation->PostProcess(m_repository.get())
|
||||
&& createMemberInformation->PostProcess(m_repository.get());
|
||||
return createStructureInformation->PostProcess(m_repository.get()) && createMemberInformation->PostProcess(m_repository.get());
|
||||
}
|
||||
|
||||
void AddSampleData()
|
||||
@ -89,7 +88,6 @@ namespace test::parsing::commands::sequence::sequence_action
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
CommandsSequenceTestsHelper()
|
||||
: m_repository(std::make_unique<InMemoryRepository>()),
|
||||
m_state(std::make_unique<CommandsParserState>(m_repository.get())),
|
||||
@ -127,16 +125,14 @@ namespace test::parsing::commands::sequence::sequence_action
|
||||
{
|
||||
CommandsSequenceTestsHelper helper;
|
||||
const TokenPos pos;
|
||||
helper.Tokens({
|
||||
CommandsParserValue::Identifier(pos, new std::string("set")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("action")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("test_struct_t")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("TestMethod")),
|
||||
CommandsParserValue::Character(pos, '('),
|
||||
CommandsParserValue::Character(pos, ')'),
|
||||
CommandsParserValue::Character(pos, ';'),
|
||||
CommandsParserValue::EndOfFile(pos)
|
||||
});
|
||||
helper.Tokens({CommandsParserValue::Identifier(pos, new std::string("set")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("action")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("test_struct_t")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("TestMethod")),
|
||||
CommandsParserValue::Character(pos, '('),
|
||||
CommandsParserValue::Character(pos, ')'),
|
||||
CommandsParserValue::Character(pos, ';'),
|
||||
CommandsParserValue::EndOfFile(pos)});
|
||||
|
||||
auto result = helper.PerformTest();
|
||||
|
||||
@ -151,17 +147,15 @@ namespace test::parsing::commands::sequence::sequence_action
|
||||
{
|
||||
CommandsSequenceTestsHelper helper;
|
||||
const TokenPos pos;
|
||||
helper.Tokens({
|
||||
CommandsParserValue::Identifier(pos, new std::string("set")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("action")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("test_struct_t")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("TestMethod")),
|
||||
CommandsParserValue::Character(pos, '('),
|
||||
CommandsParserValue::Identifier(pos, new std::string("arg_t")),
|
||||
CommandsParserValue::Character(pos, ')'),
|
||||
CommandsParserValue::Character(pos, ';'),
|
||||
CommandsParserValue::EndOfFile(pos)
|
||||
});
|
||||
helper.Tokens({CommandsParserValue::Identifier(pos, new std::string("set")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("action")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("test_struct_t")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("TestMethod")),
|
||||
CommandsParserValue::Character(pos, '('),
|
||||
CommandsParserValue::Identifier(pos, new std::string("arg_t")),
|
||||
CommandsParserValue::Character(pos, ')'),
|
||||
CommandsParserValue::Character(pos, ';'),
|
||||
CommandsParserValue::EndOfFile(pos)});
|
||||
|
||||
auto result = helper.PerformTest();
|
||||
|
||||
@ -177,19 +171,17 @@ namespace test::parsing::commands::sequence::sequence_action
|
||||
{
|
||||
CommandsSequenceTestsHelper helper;
|
||||
const TokenPos pos;
|
||||
helper.Tokens({
|
||||
CommandsParserValue::Identifier(pos, new std::string("set")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("action")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("test_struct_t")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("TestMethod")),
|
||||
CommandsParserValue::Character(pos, '('),
|
||||
CommandsParserValue::Identifier(pos, new std::string("arg_t")),
|
||||
CommandsParserValue::Character(pos, ','),
|
||||
CommandsParserValue::Identifier(pos, new std::string("another_arg_t")),
|
||||
CommandsParserValue::Character(pos, ')'),
|
||||
CommandsParserValue::Character(pos, ';'),
|
||||
CommandsParserValue::EndOfFile(pos)
|
||||
});
|
||||
helper.Tokens({CommandsParserValue::Identifier(pos, new std::string("set")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("action")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("test_struct_t")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("TestMethod")),
|
||||
CommandsParserValue::Character(pos, '('),
|
||||
CommandsParserValue::Identifier(pos, new std::string("arg_t")),
|
||||
CommandsParserValue::Character(pos, ','),
|
||||
CommandsParserValue::Identifier(pos, new std::string("another_arg_t")),
|
||||
CommandsParserValue::Character(pos, ')'),
|
||||
CommandsParserValue::Character(pos, ';'),
|
||||
CommandsParserValue::EndOfFile(pos)});
|
||||
|
||||
auto result = helper.PerformTest();
|
||||
|
||||
@ -206,21 +198,19 @@ namespace test::parsing::commands::sequence::sequence_action
|
||||
{
|
||||
CommandsSequenceTestsHelper helper;
|
||||
const TokenPos pos;
|
||||
helper.Tokens({
|
||||
CommandsParserValue::Identifier(pos, new std::string("set")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("action")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("test_struct_t")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("TestMethod")),
|
||||
CommandsParserValue::Character(pos, '('),
|
||||
CommandsParserValue::Identifier(pos, new std::string("arg_t")),
|
||||
CommandsParserValue::Character(pos, ','),
|
||||
CommandsParserValue::Identifier(pos, new std::string("another_arg_t")),
|
||||
CommandsParserValue::Character(pos, ','),
|
||||
CommandsParserValue::Identifier(pos, new std::string("yeet_t")),
|
||||
CommandsParserValue::Character(pos, ')'),
|
||||
CommandsParserValue::Character(pos, ';'),
|
||||
CommandsParserValue::EndOfFile(pos)
|
||||
});
|
||||
helper.Tokens({CommandsParserValue::Identifier(pos, new std::string("set")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("action")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("test_struct_t")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("TestMethod")),
|
||||
CommandsParserValue::Character(pos, '('),
|
||||
CommandsParserValue::Identifier(pos, new std::string("arg_t")),
|
||||
CommandsParserValue::Character(pos, ','),
|
||||
CommandsParserValue::Identifier(pos, new std::string("another_arg_t")),
|
||||
CommandsParserValue::Character(pos, ','),
|
||||
CommandsParserValue::Identifier(pos, new std::string("yeet_t")),
|
||||
CommandsParserValue::Character(pos, ')'),
|
||||
CommandsParserValue::Character(pos, ';'),
|
||||
CommandsParserValue::EndOfFile(pos)});
|
||||
|
||||
auto result = helper.PerformTest();
|
||||
|
||||
@ -238,16 +228,14 @@ namespace test::parsing::commands::sequence::sequence_action
|
||||
{
|
||||
CommandsSequenceTestsHelper helper;
|
||||
const TokenPos pos;
|
||||
helper.Tokens({
|
||||
CommandsParserValue::Identifier(pos, new std::string("set")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("action")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("unknown_struct_t")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("TestMethod")),
|
||||
CommandsParserValue::Character(pos, '('),
|
||||
CommandsParserValue::Character(pos, ')'),
|
||||
CommandsParserValue::Character(pos, ';'),
|
||||
CommandsParserValue::EndOfFile(pos)
|
||||
});
|
||||
helper.Tokens({CommandsParserValue::Identifier(pos, new std::string("set")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("action")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("unknown_struct_t")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("TestMethod")),
|
||||
CommandsParserValue::Character(pos, '('),
|
||||
CommandsParserValue::Character(pos, ')'),
|
||||
CommandsParserValue::Character(pos, ';'),
|
||||
CommandsParserValue::EndOfFile(pos)});
|
||||
|
||||
REQUIRE_THROWS_AS(helper.PerformTest(), ParsingException);
|
||||
REQUIRE(helper.m_test_struct->m_post_load_action == nullptr);
|
||||
@ -257,21 +245,19 @@ namespace test::parsing::commands::sequence::sequence_action
|
||||
{
|
||||
CommandsSequenceTestsHelper helper;
|
||||
const TokenPos pos;
|
||||
helper.Tokens({
|
||||
CommandsParserValue::Identifier(pos, new std::string("set")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("action")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("test_struct_t")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("TestMethod")),
|
||||
CommandsParserValue::Character(pos, '('),
|
||||
CommandsParserValue::Identifier(pos, new std::string("arg_t")),
|
||||
CommandsParserValue::Character(pos, ','),
|
||||
CommandsParserValue::Identifier(pos, new std::string("another_arg_t")),
|
||||
CommandsParserValue::Character(pos, ','),
|
||||
CommandsParserValue::Identifier(pos, new std::string("unknown_type_t")),
|
||||
CommandsParserValue::Character(pos, ')'),
|
||||
CommandsParserValue::Character(pos, ';'),
|
||||
CommandsParserValue::EndOfFile(pos)
|
||||
});
|
||||
helper.Tokens({CommandsParserValue::Identifier(pos, new std::string("set")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("action")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("test_struct_t")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("TestMethod")),
|
||||
CommandsParserValue::Character(pos, '('),
|
||||
CommandsParserValue::Identifier(pos, new std::string("arg_t")),
|
||||
CommandsParserValue::Character(pos, ','),
|
||||
CommandsParserValue::Identifier(pos, new std::string("another_arg_t")),
|
||||
CommandsParserValue::Character(pos, ','),
|
||||
CommandsParserValue::Identifier(pos, new std::string("unknown_type_t")),
|
||||
CommandsParserValue::Character(pos, ')'),
|
||||
CommandsParserValue::Character(pos, ';'),
|
||||
CommandsParserValue::EndOfFile(pos)});
|
||||
|
||||
REQUIRE_THROWS_AS(helper.PerformTest(), ParsingException);
|
||||
REQUIRE(helper.m_test_struct->m_post_load_action == nullptr);
|
||||
@ -281,15 +267,13 @@ namespace test::parsing::commands::sequence::sequence_action
|
||||
{
|
||||
CommandsSequenceTestsHelper helper;
|
||||
const TokenPos pos;
|
||||
helper.Tokens({
|
||||
CommandsParserValue::Identifier(pos, new std::string("set")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("action")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("TestMethod")),
|
||||
CommandsParserValue::Character(pos, '('),
|
||||
CommandsParserValue::Character(pos, ')'),
|
||||
CommandsParserValue::Character(pos, ';'),
|
||||
CommandsParserValue::EndOfFile(pos)
|
||||
});
|
||||
helper.Tokens({CommandsParserValue::Identifier(pos, new std::string("set")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("action")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("TestMethod")),
|
||||
CommandsParserValue::Character(pos, '('),
|
||||
CommandsParserValue::Character(pos, ')'),
|
||||
CommandsParserValue::Character(pos, ';'),
|
||||
CommandsParserValue::EndOfFile(pos)});
|
||||
|
||||
REQUIRE_THROWS_AS(helper.PerformTest(), ParsingException);
|
||||
REQUIRE(helper.m_test_struct->m_post_load_action == nullptr);
|
||||
@ -299,15 +283,13 @@ namespace test::parsing::commands::sequence::sequence_action
|
||||
{
|
||||
CommandsSequenceTestsHelper helper;
|
||||
const TokenPos pos;
|
||||
helper.Tokens({
|
||||
CommandsParserValue::Identifier(pos, new std::string("set")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("action")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("TestMethod")),
|
||||
CommandsParserValue::Character(pos, '('),
|
||||
CommandsParserValue::Character(pos, ')'),
|
||||
CommandsParserValue::Character(pos, ';'),
|
||||
CommandsParserValue::EndOfFile(pos)
|
||||
});
|
||||
helper.Tokens({CommandsParserValue::Identifier(pos, new std::string("set")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("action")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("TestMethod")),
|
||||
CommandsParserValue::Character(pos, '('),
|
||||
CommandsParserValue::Character(pos, ')'),
|
||||
CommandsParserValue::Character(pos, ';'),
|
||||
CommandsParserValue::EndOfFile(pos)});
|
||||
helper.m_state->SetInUse(helper.m_test_struct);
|
||||
|
||||
auto result = helper.PerformTest();
|
||||
@ -323,19 +305,17 @@ namespace test::parsing::commands::sequence::sequence_action
|
||||
{
|
||||
CommandsSequenceTestsHelper helper;
|
||||
const TokenPos pos;
|
||||
helper.Tokens({
|
||||
CommandsParserValue::Identifier(pos, new std::string("set")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("action")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("container_struct_t")),
|
||||
CommandsParserValue::Character(pos, ':'),
|
||||
CommandsParserValue::Character(pos, ':'),
|
||||
CommandsParserValue::Identifier(pos, new std::string("m_child")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("TestMethod")),
|
||||
CommandsParserValue::Character(pos, '('),
|
||||
CommandsParserValue::Character(pos, ')'),
|
||||
CommandsParserValue::Character(pos, ';'),
|
||||
CommandsParserValue::EndOfFile(pos)
|
||||
});
|
||||
helper.Tokens({CommandsParserValue::Identifier(pos, new std::string("set")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("action")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("container_struct_t")),
|
||||
CommandsParserValue::Character(pos, ':'),
|
||||
CommandsParserValue::Character(pos, ':'),
|
||||
CommandsParserValue::Identifier(pos, new std::string("m_child")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("TestMethod")),
|
||||
CommandsParserValue::Character(pos, '('),
|
||||
CommandsParserValue::Character(pos, ')'),
|
||||
CommandsParserValue::Character(pos, ';'),
|
||||
CommandsParserValue::EndOfFile(pos)});
|
||||
|
||||
auto result = helper.PerformTest();
|
||||
|
||||
@ -350,16 +330,14 @@ namespace test::parsing::commands::sequence::sequence_action
|
||||
{
|
||||
CommandsSequenceTestsHelper helper;
|
||||
const TokenPos pos;
|
||||
helper.Tokens({
|
||||
CommandsParserValue::Identifier(pos, new std::string("set")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("action")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("m_child")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("TestMethod")),
|
||||
CommandsParserValue::Character(pos, '('),
|
||||
CommandsParserValue::Character(pos, ')'),
|
||||
CommandsParserValue::Character(pos, ';'),
|
||||
CommandsParserValue::EndOfFile(pos)
|
||||
});
|
||||
helper.Tokens({CommandsParserValue::Identifier(pos, new std::string("set")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("action")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("m_child")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("TestMethod")),
|
||||
CommandsParserValue::Character(pos, '('),
|
||||
CommandsParserValue::Character(pos, ')'),
|
||||
CommandsParserValue::Character(pos, ';'),
|
||||
CommandsParserValue::EndOfFile(pos)});
|
||||
helper.m_state->SetInUse(helper.m_test_struct2);
|
||||
|
||||
auto result = helper.PerformTest();
|
||||
@ -375,19 +353,17 @@ namespace test::parsing::commands::sequence::sequence_action
|
||||
{
|
||||
CommandsSequenceTestsHelper helper;
|
||||
const TokenPos pos;
|
||||
helper.Tokens({
|
||||
CommandsParserValue::Identifier(pos, new std::string("set")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("action")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("container_struct_t")),
|
||||
CommandsParserValue::Character(pos, ':'),
|
||||
CommandsParserValue::Character(pos, ':'),
|
||||
CommandsParserValue::Identifier(pos, new std::string("m_child")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("TestMethod")),
|
||||
CommandsParserValue::Character(pos, '('),
|
||||
CommandsParserValue::Character(pos, ')'),
|
||||
CommandsParserValue::Character(pos, ';'),
|
||||
CommandsParserValue::EndOfFile(pos)
|
||||
});
|
||||
helper.Tokens({CommandsParserValue::Identifier(pos, new std::string("set")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("action")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("container_struct_t")),
|
||||
CommandsParserValue::Character(pos, ':'),
|
||||
CommandsParserValue::Character(pos, ':'),
|
||||
CommandsParserValue::Identifier(pos, new std::string("m_child")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("TestMethod")),
|
||||
CommandsParserValue::Character(pos, '('),
|
||||
CommandsParserValue::Character(pos, ')'),
|
||||
CommandsParserValue::Character(pos, ';'),
|
||||
CommandsParserValue::EndOfFile(pos)});
|
||||
helper.m_state->SetInUse(helper.m_arg_struct2);
|
||||
|
||||
auto result = helper.PerformTest();
|
||||
@ -403,21 +379,19 @@ namespace test::parsing::commands::sequence::sequence_action
|
||||
{
|
||||
CommandsSequenceTestsHelper helper;
|
||||
const TokenPos pos;
|
||||
helper.Tokens({
|
||||
CommandsParserValue::Identifier(pos, new std::string("set")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("action")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("test_struct_t")),
|
||||
CommandsParserValue::Character(pos, ':'),
|
||||
CommandsParserValue::Character(pos, ':'),
|
||||
CommandsParserValue::Identifier(pos, new std::string("m_test")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("TestMethod")),
|
||||
CommandsParserValue::Character(pos, '('),
|
||||
CommandsParserValue::Character(pos, ')'),
|
||||
CommandsParserValue::Character(pos, ';'),
|
||||
CommandsParserValue::EndOfFile(pos)
|
||||
});
|
||||
helper.Tokens({CommandsParserValue::Identifier(pos, new std::string("set")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("action")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("test_struct_t")),
|
||||
CommandsParserValue::Character(pos, ':'),
|
||||
CommandsParserValue::Character(pos, ':'),
|
||||
CommandsParserValue::Identifier(pos, new std::string("m_test")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("TestMethod")),
|
||||
CommandsParserValue::Character(pos, '('),
|
||||
CommandsParserValue::Character(pos, ')'),
|
||||
CommandsParserValue::Character(pos, ';'),
|
||||
CommandsParserValue::EndOfFile(pos)});
|
||||
|
||||
REQUIRE_THROWS_AS(helper.PerformTest(), ParsingException);
|
||||
REQUIRE(helper.m_test_struct->m_post_load_action == nullptr);
|
||||
}
|
||||
}
|
||||
} // namespace test::parsing::commands::sequence::sequence_action
|
||||
|
@ -1,10 +1,10 @@
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <catch2/generators/catch_generators.hpp>
|
||||
|
||||
#include "Utils/ClassUtils.h"
|
||||
#include "Parsing/Commands/Sequence/SequenceArchitecture.h"
|
||||
#include "Parsing/Mock/MockLexer.h"
|
||||
#include "Persistence/InMemory/InMemoryRepository.h"
|
||||
#include "Utils/ClassUtils.h"
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <catch2/generators/catch_generators.hpp>
|
||||
|
||||
namespace test::parsing::commands::sequence::sequence_architecture
|
||||
{
|
||||
@ -16,7 +16,7 @@ namespace test::parsing::commands::sequence::sequence_architecture
|
||||
std::unique_ptr<ILexer<CommandsParserValue>> m_lexer;
|
||||
|
||||
unsigned m_consumed_token_count;
|
||||
|
||||
|
||||
CommandsSequenceTestsHelper()
|
||||
: m_repository(std::make_unique<InMemoryRepository>()),
|
||||
m_state(std::make_unique<CommandsParserState>(m_repository.get())),
|
||||
@ -41,12 +41,10 @@ namespace test::parsing::commands::sequence::sequence_architecture
|
||||
{
|
||||
CommandsSequenceTestsHelper helper;
|
||||
const TokenPos pos;
|
||||
helper.Tokens({
|
||||
CommandsParserValue::Identifier(pos, new std::string("architecture")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("x86")),
|
||||
CommandsParserValue::Character(pos, ';'),
|
||||
CommandsParserValue::EndOfFile(pos)
|
||||
});
|
||||
helper.Tokens({CommandsParserValue::Identifier(pos, new std::string("architecture")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("x86")),
|
||||
CommandsParserValue::Character(pos, ';'),
|
||||
CommandsParserValue::EndOfFile(pos)});
|
||||
|
||||
auto result = helper.PerformTest();
|
||||
|
||||
@ -59,12 +57,10 @@ namespace test::parsing::commands::sequence::sequence_architecture
|
||||
{
|
||||
CommandsSequenceTestsHelper helper;
|
||||
const TokenPos pos;
|
||||
helper.Tokens({
|
||||
CommandsParserValue::Identifier(pos, new std::string("architecture")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("x86")),
|
||||
CommandsParserValue::Character(pos, ';'),
|
||||
CommandsParserValue::EndOfFile(pos)
|
||||
});
|
||||
helper.Tokens({CommandsParserValue::Identifier(pos, new std::string("architecture")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("x86")),
|
||||
CommandsParserValue::Character(pos, ';'),
|
||||
CommandsParserValue::EndOfFile(pos)});
|
||||
|
||||
auto result = helper.PerformTest();
|
||||
|
||||
@ -77,14 +73,12 @@ namespace test::parsing::commands::sequence::sequence_architecture
|
||||
{
|
||||
CommandsSequenceTestsHelper helper;
|
||||
const TokenPos pos;
|
||||
helper.Tokens({
|
||||
CommandsParserValue::Identifier(pos, new std::string("architecture")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("x1337")),
|
||||
CommandsParserValue::Character(pos, ';'),
|
||||
CommandsParserValue::EndOfFile(pos)
|
||||
});
|
||||
|
||||
helper.Tokens({CommandsParserValue::Identifier(pos, new std::string("architecture")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("x1337")),
|
||||
CommandsParserValue::Character(pos, ';'),
|
||||
CommandsParserValue::EndOfFile(pos)});
|
||||
|
||||
REQUIRE_THROWS_AS(helper.PerformTest(), ParsingException);
|
||||
REQUIRE(helper.m_repository->GetArchitecture() == Architecture::UNKNOWN);
|
||||
}
|
||||
}
|
||||
} // namespace test::parsing::commands::sequence::sequence_architecture
|
||||
|
@ -1,10 +1,10 @@
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <catch2/generators/catch_generators.hpp>
|
||||
|
||||
#include "Utils/ClassUtils.h"
|
||||
#include "Parsing/Commands/Sequence/SequenceGame.h"
|
||||
#include "Parsing/Mock/MockLexer.h"
|
||||
#include "Persistence/InMemory/InMemoryRepository.h"
|
||||
#include "Utils/ClassUtils.h"
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <catch2/generators/catch_generators.hpp>
|
||||
|
||||
namespace test::parsing::commands::sequence::sequence_game
|
||||
{
|
||||
@ -41,12 +41,10 @@ namespace test::parsing::commands::sequence::sequence_game
|
||||
{
|
||||
CommandsSequenceTestsHelper helper;
|
||||
const TokenPos pos;
|
||||
helper.Tokens({
|
||||
CommandsParserValue::Identifier(pos, new std::string("game")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("very_cool_game")),
|
||||
CommandsParserValue::Character(pos, ';'),
|
||||
CommandsParserValue::EndOfFile(pos)
|
||||
});
|
||||
helper.Tokens({CommandsParserValue::Identifier(pos, new std::string("game")),
|
||||
CommandsParserValue::Identifier(pos, new std::string("very_cool_game")),
|
||||
CommandsParserValue::Character(pos, ';'),
|
||||
CommandsParserValue::EndOfFile(pos)});
|
||||
|
||||
auto result = helper.PerformTest();
|
||||
|
||||
@ -54,4 +52,4 @@ namespace test::parsing::commands::sequence::sequence_game
|
||||
REQUIRE(helper.m_consumed_token_count == 3);
|
||||
REQUIRE(helper.m_repository->GetGameName() == "very_cool_game");
|
||||
}
|
||||
}
|
||||
} // namespace test::parsing::commands::sequence::sequence_game
|
||||
|
Reference in New Issue
Block a user