Skip to content

Commit f20d12f

Browse files
committed
Added toUpper; updated wsjcpp.yml (unit-tests)
1 parent 93c1861 commit f20d12f

17 files changed

+103
-43
lines changed

src.wsjcpp/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Automaticly generated by wsjcpp@v0.0.1
22
cmake_minimum_required(VERSION 3.0)
33

4-
add_definitions(-DWSJCPP_VERSION="v0.0.3")
5-
add_definitions(-DWSJCPP_NAME="wsjcpp/wsjcpp-core")
4+
add_definitions(-DWSJCPP_VERSION="v0.0.4")
5+
add_definitions(-DWSJCPP_NAME="wsjcpp-core")
66

77
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
88
set(MACOSX TRUE)

src/wsjcpp_core.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,14 @@ std::string& WSJCppCore::to_lower(std::string& str) {
389389
return str;
390390
}
391391

392+
// ---------------------------------------------------------------------
393+
// will worked only with latin
394+
395+
std::string WSJCppCore::toUpper(const std::string& str) {
396+
std::string sRet = str;
397+
std::transform(sRet.begin(), sRet.end(), sRet.begin(), ::toupper);
398+
return sRet;
399+
}
392400

393401
// ---------------------------------------------------------------------
394402

src/wsjcpp_core.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class WSJCppCore {
4545
static std::string& rtrim(std::string& str, const std::string& chars = "\t\n\v\f\r ");
4646
static std::string& trim(std::string& str, const std::string& chars = "\t\n\v\f\r ");
4747
static std::string& to_lower(std::string& str);
48+
static std::string toUpper(const std::string& str);
4849

4950
static void initRandom();
5051
static std::string createUuid();
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "unit_tests.h"
1+
#include "wsjcpp_unit_tests.h"
22

33
UnitTestBase::UnitTestBase(const std::string &sTestName) {
44
m_sTestName = sTestName;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include <string>
22
#include <wsjcpp_core.h>
3-
#include <unit_tests.h>
3+
#include <wsjcpp_unit_tests.h>
44

55
int main(int argc, char** argv) {
66
WSJCppCore::initRandom();

unit-tests.wsjcpp/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
tmp/*
22
logs/*
33
unit-tests
4+

unit-tests.wsjcpp/CMakeLists.txt

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,46 @@
1+
# Automaticly generated by wsjcpp@v0.0.1
12
cmake_minimum_required(VERSION 3.0)
23

34
project(unit-tests)
45

6+
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
7+
set(MACOSX TRUE)
8+
endif()
9+
510
set(CMAKE_CXX_STANDARD 11)
611
set(EXECUTABLE_OUTPUT_PATH ${unit-tests_SOURCE_DIR})
712

813
set (WSJCPP_LIBRARIES "")
914
set (WSJCPP_INCLUDE_DIRS "")
1015
set (WSJCPP_SOURCES "")
1116

12-
# Sources
13-
14-
# wsjcpp-core
15-
list (APPEND WSJCPP_SOURCES "../src/wsjcpp_core.h")
17+
# wsjcpp-core:v0.0.4
18+
list (APPEND WSJCPP_INCLUDE_DIRS "../src")
1619
list (APPEND WSJCPP_SOURCES "../src/wsjcpp_core.cpp")
20+
list (APPEND WSJCPP_SOURCES "../src/wsjcpp_core.h")
21+
list (APPEND WSJCPP_SOURCES "../src/wsjcpp_unit_tests.cpp")
22+
list (APPEND WSJCPP_SOURCES "../src/wsjcpp_unit_tests.h")
23+
list (APPEND WSJCPP_SOURCES "../src/wsjcpp_unit_tests_main.cpp")
1724

18-
# include header dirs
19-
list (APPEND WSJCPP_INCLUDE_DIRS "../src")
25+
# unit-tests
2026
list (APPEND WSJCPP_INCLUDE_DIRS "src")
27+
list (APPEND WSJCPP_SOURCES "../unit-tests.wsjcpp/src/unit_test_core_normalize_path.h")
28+
list (APPEND WSJCPP_SOURCES "../unit-tests.wsjcpp/src/unit_test_core_normalize_path.cpp")
29+
list (APPEND WSJCPP_SOURCES "../unit-tests.wsjcpp/src/unit_test_core_uuid.h")
30+
list (APPEND WSJCPP_SOURCES "../unit-tests.wsjcpp/src/unit_test_core_uuid.cpp")
31+
list (APPEND WSJCPP_SOURCES "../unit-tests.wsjcpp/src/unit_test_core_extract_filename.h")
32+
list (APPEND WSJCPP_SOURCES "../unit-tests.wsjcpp/src/unit_test_core_extract_filename.cpp")
33+
list (APPEND WSJCPP_SOURCES "../unit-tests.wsjcpp/src/unit_test_ip_v4.h")
34+
list (APPEND WSJCPP_SOURCES "../unit-tests.wsjcpp/src/unit_test_ip_v4.cpp")
35+
list (APPEND WSJCPP_SOURCES "../unit-tests.wsjcpp/src/unit_test_ip_v6.h")
36+
list (APPEND WSJCPP_SOURCES "../unit-tests.wsjcpp/src/unit_test_ip_v6.cpp")
37+
list (APPEND WSJCPP_SOURCES "../unit-tests.wsjcpp/src/unit_test_to_upper.h")
38+
list (APPEND WSJCPP_SOURCES "../unit-tests.wsjcpp/src/unit_test_to_upper.cpp")
39+
40+
# required-libraries
41+
list (APPEND WSJCPP_LIBRARIES "-lpthread")
2142

2243

23-
list (APPEND WSJCPP_SOURCES "../src/unit_tests_main.cpp")
24-
list (APPEND WSJCPP_SOURCES "../src/unit_tests.h")
25-
list (APPEND WSJCPP_SOURCES "../src/unit_tests.cpp")
26-
list (APPEND WSJCPP_SOURCES "./src/unit_test_core_extract_filename.h")
27-
list (APPEND WSJCPP_SOURCES "./src/unit_test_core_extract_filename.cpp")
28-
list (APPEND WSJCPP_SOURCES "./src/unit_test_core_normalize_path.h")
29-
list (APPEND WSJCPP_SOURCES "./src/unit_test_core_normalize_path.cpp")
30-
list (APPEND WSJCPP_SOURCES "./src/unit_test_core_uuid.h")
31-
list (APPEND WSJCPP_SOURCES "./src/unit_test_core_uuid.cpp")
32-
list (APPEND WSJCPP_SOURCES "./src/unit_test_ip_v4.h")
33-
list (APPEND WSJCPP_SOURCES "./src/unit_test_ip_v4.cpp")
34-
list (APPEND WSJCPP_SOURCES "./src/unit_test_ip_v6.h")
35-
list (APPEND WSJCPP_SOURCES "./src/unit_test_ip_v6.cpp")
36-
3744
include_directories(${WSJCPP_INCLUDE_DIRS})
3845

3946
add_executable ("unit-tests" ${WSJCPP_SOURCES})
@@ -45,4 +52,5 @@ install(
4552
"unit-tests"
4653
RUNTIME DESTINATION
4754
/usr/bin
48-
)
55+
)
56+

unit-tests.wsjcpp/build_simple.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ fi
77
cd tmp
88
cmake ..
99
make
10+

unit-tests.wsjcpp/src/unit_test_core_extract_filename.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef UNIT_TEST_CORE_EXCTRACT_FILENAME_H
22
#define UNIT_TEST_CORE_EXCTRACT_FILENAME_H
33

4-
#include <unit_tests.h>
4+
#include <wsjcpp_unit_tests.h>
55

66
class UnitTestCoreExtractFilename : public UnitTestBase {
77
public:

0 commit comments

Comments
 (0)