Skip to content

Commit 706d1cf

Browse files
committed
Fixed #1 add unit tests for parsing json for image info
1 parent 1a84f6a commit 706d1cf

6 files changed

+520
-4
lines changed

src/main.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
int main(int argc, const char* argv[]) {
88
std::string TAG = "MAIN";
9-
std::string appName = std::string(WSJCPP_NAME);
10-
std::string appVersion = std::string(WSJCPP_VERSION);
9+
std::string appName = std::string(WSJCPP_APP_NAME);
10+
std::string appVersion = std::string(WSJCPP_APP_VERSION);
1111
if (!WsjcppCore::dirExists(".logs")) {
1212
WsjcppCore::makeDir(".logs");
1313
}
@@ -34,7 +34,7 @@ int main(int argc, const char* argv[]) {
3434
sOutput +=
3535
"\n"
3636
" ID: " + img.getId() + "\n"
37-
" SIZE: " + std::to_string(img.getSize()) + "\n";
37+
" SIZE: " + std::to_string(img.getSize()) + " Bytes, " + WsjcppCore::getHumanSizeBytes(img.getSize()) + "\n";
3838
if (img.getParentId().length() > 0) {
3939
sOutput += " PARENT-ID: " + img.getParentId() + "\n";
4040
}

src/wsjcpp_docker_api.h

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ class WsjcppDockerImage {
4343
long m_nSize;
4444
long m_nVirtualSize;
4545
long m_nContainers;
46-
4746
};
4847

4948
// ---------------------------------------------------------------------

unit-tests.wsjcpp/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ list (APPEND WSJCPP_SOURCES "../src/wsjcpp_docker_api.cpp")
4040

4141
# unit-tests
4242
list (APPEND WSJCPP_INCLUDE_DIRS "src")
43+
list (APPEND WSJCPP_SOURCES "../unit-tests.wsjcpp/src/unit_test_parse_wsjcpp_docker_image.h")
44+
list (APPEND WSJCPP_SOURCES "../unit-tests.wsjcpp/src/unit_test_parse_wsjcpp_docker_image.cpp")
4345

4446
# required-pkg-config
4547
############################

0 commit comments

Comments
 (0)