Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit

Permalink
Fix unit and coverage tests
Browse files Browse the repository at this point in the history
  • Loading branch information
enwi committed Mar 24, 2021
1 parent 2780404 commit c404e66
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ if (1 AND APPLE)
set(CMAKE_MACOSX_RPATH 1)
endif()

add_subdirectory("lib/mbedtls")
add_subdirectory("lib/mbedtls" EXCLUDE_FROM_ALL)

add_subdirectory(src)

Expand Down
9 changes: 5 additions & 4 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ set(TEST_SOURCES
test_ColorUnits.cpp
test_ExtendedColorHueStrategy.cpp
test_ExtendedColorTemperatureStrategy.cpp
test_Group.cpp
test_Group.cpp
test_HueCommandAPI.cpp
test_Light.cpp
test_LightFactory.cpp
Expand Down Expand Up @@ -93,10 +93,11 @@ if(LCOV_PATH AND GCOV_PATH)
add_executable(testcov_HuePlusPlus ${TEST_SOURCES} ${hueplusplus_SOURCES})
target_include_directories(testcov_HuePlusPlus PUBLIC "${PROJECT_SOURCE_DIR}/include")
target_compile_features(testcov_HuePlusPlus PUBLIC cxx_std_14)
set_property(TARGET testcov_HuePlusPlus PROPERTY CXX_EXTENSIONS OFF)
set_property(TARGET testcov_HuePlusPlus PROPERTY CXX_EXTENSIONS OFF)

target_link_libraries(testcov_HuePlusPlus PUBLIC gtest gmock)
target_include_directories(testcov_HuePlusPlus PUBLIC ${GTest_INCLUDE_DIRS})
target_link_libraries(testcov_HuePlusPlus PRIVATE mbedtls)
target_link_libraries(testcov_HuePlusPlus PUBLIC gtest gmock)
target_include_directories(testcov_HuePlusPlus PUBLIC ${GTest_INCLUDE_DIRS})
# this will be already done by APPEND_COVERAGE_COMPILER_FLAGS()
#set_target_properties(
# testcov_HuePlusPlus PROPERTIES
Expand Down
6 changes: 3 additions & 3 deletions test/test_Rule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,18 +240,18 @@ TEST_F(RuleTest, setActions)
TEST(CreateRule, setName)
{
const std::string name = "New rule";
const nlohmann::json request = {{"conditions", {}}, {"actions", {}}, {"name", name}};
const nlohmann::json request = {{"conditions", nullptr}, {"actions", nullptr}, {"name", name}};
EXPECT_EQ(request, CreateRule({}, {}).setName(name).getRequest());
}

TEST(CreateRule, setStatus)
{
{
const nlohmann::json request = {{"conditions", {}}, {"actions", {}}, {"status", "enabled"}};
const nlohmann::json request = {{"conditions", nullptr}, {"actions", nullptr}, {"status", "enabled"}};
EXPECT_EQ(request, CreateRule({}, {}).setStatus(true).getRequest());
}
{
const nlohmann::json request = {{"conditions", {}}, {"actions", {}}, {"status", "disabled"}};
const nlohmann::json request = {{"conditions", nullptr}, {"actions", nullptr}, {"status", "disabled"}};
EXPECT_EQ(request, CreateRule({}, {}).setStatus(false).getRequest());
}
}
Expand Down

0 comments on commit c404e66

Please sign in to comment.