-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add from json tests. Signed-off-by: Melg Eight <public.melg8@gmail.com>
- Loading branch information
Showing
14 changed files
with
565 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Start testing: Apr 22 11:50 UTC | ||
Start testing: May 10 00:39 UTC | ||
---------------------------------------------------------- | ||
End testing: Apr 22 11:50 UTC | ||
End testing: May 10 00:39 UTC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,5 @@ | |
# SPDX-License-Identifier: MIT | ||
|
||
add_subdirectory(application) | ||
add_subdirectory(library) | ||
add_subdirectory(tests) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 0 additions & 42 deletions
42
sources/coal/application/sources/servers_and_characters_response_parser.h
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# SPDX-FileCopyrightText: © 2024 Melg Eight <public.melg8@gmail.com> | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
|
||
file(GLOB_RECURSE ALL_COAL_LIB_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/*.h") | ||
file(GLOB_RECURSE ALL_COAL_LIB_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") | ||
|
||
add_library(coal STATIC "${ALL_COAL_LIB_HEADERS}" | ||
"${ALL_COAL_LIB_SOURCES}") | ||
|
||
header_directories(ALL_LIB_INCLUDE_DIRECTORIES) | ||
|
||
target_include_directories(coal PUBLIC "${ALL_LIB_INCLUDE_DIRECTORIES}") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
sources/coal/library/sources/json/servers_and_characters_response_from_json.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// SPDX-FileCopyrightText: © 2024 Melg Eight <public.melg8@gmail.com> | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
#ifndef SERVERS_AND_CHARACTERS_RESPONSE_FROM_JSON_H | ||
#define SERVERS_AND_CHARACTERS_RESPONSE_FROM_JSON_H | ||
|
||
#include <cstdint> | ||
#include <string> | ||
#include <unordered_map> | ||
#include <variant> | ||
#include <vector> | ||
|
||
namespace coal { | ||
|
||
struct Character { | ||
std::string id = {}; | ||
std::string name = {}; | ||
size_t level = {}; | ||
std::string type = {}; | ||
int online = {}; | ||
std::string skin = {}; | ||
std::unordered_map<std::string, std::string> cx = {}; | ||
std::string in = {}; | ||
std::string map = {}; | ||
double x = 0.0; | ||
double y = 0.0; | ||
std::string home = {}; | ||
}; | ||
|
||
using Characters = std::vector<Character>; | ||
|
||
struct Server { | ||
std::string name = {}; | ||
std::string region = {}; | ||
size_t players = 0u; | ||
std::string key = {}; | ||
std::string addr = {}; | ||
int port = {}; | ||
}; | ||
using Servers = std::vector<Server>; | ||
|
||
struct TutorialStatus { | ||
size_t step = 0u; | ||
std::vector<std::string> completed = {}; | ||
bool finished = false; | ||
bool task = false; | ||
size_t progress = 0; | ||
}; | ||
|
||
using CodeElement = std::vector<std::variant<std::string, size_t>>; | ||
|
||
using CodeMap = std::unordered_map<std::string, CodeElement>; | ||
|
||
struct Reward { | ||
std::string something; | ||
}; | ||
|
||
using Rewards = std::vector<Reward>; | ||
|
||
struct ServersAndCharactersResponse { | ||
std::string type = {}; | ||
Servers servers = {}; | ||
Characters characters = {}; | ||
TutorialStatus tutorial = {}; | ||
CodeMap code_list = {}; | ||
int mail = 0; | ||
Rewards rewards = {}; | ||
}; | ||
|
||
} // namespace coal | ||
|
||
#endif // SERVERS_AND_CHARACTERS_RESPONSE_FROM_JSON_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# SPDX-FileCopyrightText: © 2024 Melg Eight <public.melg8@gmail.com> | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
add_subdirectory(unit_tests) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# SPDX-FileCopyrightText: © 2024 Melg Eight <public.melg8@gmail.com> | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
find_package(glaze REQUIRED) | ||
|
||
file(GLOB_RECURSE ALL_COAL_TESTS_APPLICATION_HEADERS | ||
"${CMAKE_CURRENT_SOURCE_DIR}/*.h") | ||
|
||
file(GLOB_RECURSE ALL_COAL_TESTS_APPLICATION_SOURCES | ||
"${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") | ||
|
||
add_executable(coal_tests "${ALL_COAL_TESTS_APPLICATION_HEADERS}" | ||
"${ALL_COAL_TESTS_APPLICATION_SOURCES}") | ||
|
||
target_link_libraries( | ||
coal_tests PUBLIC coal testing_framework glaze::glaze) | ||
|
||
add_test(coal_tests coal_tests) | ||
|
||
header_directories(ALL_COAL_TESTS_INCLUDE_DIRECTORIES) | ||
|
||
target_include_directories(coal_tests PUBLIC | ||
"${ALL_COAL_TESTS_INCLUDE_DIRECTORIES}") |
Oops, something went wrong.