Skip to content

Commit a45f212

Browse files
committed
Added new unit-test: ReadWsjcppHoldYml
1 parent f35b122 commit a45f212

File tree

4 files changed

+144
-0
lines changed

4 files changed

+144
-0
lines changed

unit-tests.wsjcpp/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ list (APPEND WSJCPP_SOURCES "../unit-tests.wsjcpp/src/unit_test_cursor.cpp")
5151
list (APPEND WSJCPP_SOURCES "../unit-tests.wsjcpp/src/unit_test_tag_names.cpp")
5252
list (APPEND WSJCPP_SOURCES "../unit-tests.wsjcpp/src/unit_test_cleanup.cpp")
5353
list (APPEND WSJCPP_SOURCES "../unit-tests.wsjcpp/src/unit_test_append_elements.cpp")
54+
list (APPEND WSJCPP_SOURCES "../unit-tests.wsjcpp/src/unit_test_read_wsjcpp_hold_yaml.cpp")
55+
5456

5557
include(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.user-custom.txt)
5658

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
wsjcpp_version: v0.0.1
2+
cmake_cxx_standard: 11
3+
cmake_minimum_required: 3.0
4+
5+
name: wsjcpp-core
6+
version: v0.2.1
7+
description: Basic Utils for wsjcpp
8+
issues: https://github.com/wsjcpp/wsjcpp-core/issues
9+
repositories:
10+
- type: main
11+
url: "https://github.com/wsjcpp/wsjcpp-core"
12+
keywords:
13+
- c++
14+
- wsjcpp
15+
16+
authors:
17+
- name: Evgenii Sopov
18+
email: mrseakg@gmail.com
19+
20+
distribution:
21+
- source-file: src/wsjcpp_core.cpp
22+
target-file: wsjcpp_core.cpp
23+
type: "source-code"
24+
sha1: "09ef821bbc090fc1cd8a15bc4a57a9a2ce8ae00d"
25+
- source-file: src/wsjcpp_core.h
26+
target-file: wsjcpp_core.h
27+
type: "source-code" # todo must be header-file
28+
sha1: "e6e4ab2067d3c942db08e3b79862486eaf851e4b"
29+
- source-file: "src/wsjcpp_unit_tests.cpp"
30+
target-file: "wsjcpp_unit_tests.cpp"
31+
type: "unit-tests"
32+
sha1: "fd5989d1a83c8b90bdc4d5e9bc9c3051eaa1e6d2"
33+
- source-file: "src/wsjcpp_unit_tests.h"
34+
target-file: "wsjcpp_unit_tests.h"
35+
type: "unit-tests"
36+
sha1: "83d4b6e046b6b58c42882ccae4be413e03c401c1"
37+
- source-file: "src/wsjcpp_unit_tests_main.cpp"
38+
target-file: "wsjcpp_unit_tests_main.cpp"
39+
type: "unit-tests"
40+
sha1: "388ae269b325c5e161f6c3a5c598575714a4bffc"
41+
- source-file: "scripts.wsjcpp/generate.WsjcppUnitTest.wsjcpp-script"
42+
target-file: "generate.WsjcppUnitTest.wsjcpp-script"
43+
type: "safe-scripting-generate"
44+
sha1: "a7c9c2d19bf81c5b00e659384b0b92a99319a4c1"
45+
- source-file: "scripts.wsjcpp/generate.Class.wsjcpp-script"
46+
target-file: "generate.Class.wsjcpp-script"
47+
type: "safe-scripting-generate"
48+
sha1: "de1799907c685d606b93e08b821b540c2faa2db1"
49+
50+
unit-tests:
51+
cases:
52+
- name: CoreNormalizePath
53+
description: Check function normalizePath
54+
- name: CoreExtractFilename
55+
description: Check function extract filenane from path
56+
- name: "ToUpper"
57+
description: "String to upper"
58+
- name: "CreateUuid"
59+
description: "Test generation uuids"
60+
- name: "GetEnv"
61+
description: "Test getEnv function"
62+
- name: "ToLower"
63+
description: "Test toLower"
64+
- name: "ReplaceAll"
65+
description: "Test replace all"
66+
- name: "DecodeUriComponent"
67+
description: "Check decoding"
68+
- name: "EncodeUriComponent"
69+
description: "Check encoding"
70+
- name: "Uint2HexString"
71+
description: "Test convert unsigned int to hex string"
72+
- name: "Split"
73+
description: "Test split function"
74+
- name: "CreateEmptyFile"
75+
description: "Test create empty file"
76+
- name: "ReadFileToBuffer"
77+
description: "test for readFileToBuffer"
78+
- name: "Join"
79+
description: "Test join function"
80+
- name: "getHumanSizeBytes"
81+
description: "Test function get human size in bytes"
82+
- name: "TestResources"
83+
description: "Test basic resources"
84+
- name: "ListOfDirs"
85+
description: "Check list of directories"
86+
- name: "FilePermissions"
87+
description: ""
88+
- name: "StringPadding"
89+
description: ""
90+
- name: "DateTimeFormat"
91+
description: ""
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
2+
#include <wsjcpp_core.h>
3+
#include <wsjcpp_unit_tests.h>
4+
#include <wsjcpp_yaml.h>
5+
6+
// ---------------------------------------------------------------------
7+
// UnitTestReadWsjcppHoldYml
8+
9+
class UnitTestReadWsjcppHoldYml : public WsjcppUnitTestBase {
10+
public:
11+
UnitTestReadWsjcppHoldYml();
12+
virtual bool doBeforeTest() override;
13+
virtual void executeTest() override;
14+
virtual bool doAfterTest() override;
15+
};
16+
17+
REGISTRY_WSJCPP_UNIT_TEST(UnitTestReadWsjcppHoldYml)
18+
19+
UnitTestReadWsjcppHoldYml::UnitTestReadWsjcppHoldYml()
20+
: WsjcppUnitTestBase("UnitTestReadWsjcppHoldYml") {
21+
}
22+
23+
// ---------------------------------------------------------------------
24+
25+
bool UnitTestReadWsjcppHoldYml::doBeforeTest() {
26+
// do something before test
27+
return true;
28+
}
29+
30+
// ---------------------------------------------------------------------
31+
32+
void UnitTestReadWsjcppHoldYml::executeTest() {
33+
WsjcppYaml yaml;
34+
std::string sFilepath = "./data-tests/read-wsjcpp-hold-yml/wsjcpp.hold.yml";
35+
std::string sError;
36+
if (!compare("Error parsing", yaml.loadFromFile(sFilepath, sError), true)) {
37+
WsjcppLog::err(TAG, sError);
38+
return;
39+
}
40+
}
41+
42+
// ---------------------------------------------------------------------
43+
44+
bool UnitTestReadWsjcppHoldYml::doAfterTest() {
45+
// do somethig after test
46+
return true;
47+
}
48+
49+

wsjcpp.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,5 @@ unit-tests:
6969
description: ""
7070
- name: "AppendElements"
7171
description: ""
72+
- name: "ReadWsjcppHoldYml"
73+
description: ""

0 commit comments

Comments
 (0)