Skip to content

Commit

Permalink
iox-eclipse-iceoryx#433 fix tests in c-binding
Browse files Browse the repository at this point in the history
Signed-off-by: Dietrich Krönke <[email protected]>
  • Loading branch information
dkroenke committed Dec 21, 2020
1 parent b66a04c commit a7603ac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
11 changes: 6 additions & 5 deletions cmake/cyclonedds/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@ function(fetch_and_install name)
endforeach()
string( REPLACE ";" " " ADDITIONAL_CMAKE_FLAGS "${ADDITIONAL_CMAKE_FLAGS}")

if(APPLE)
set(ADDITIONAL_CMAKE_FLAGS ${ADDITIONAL_CMAKE_FLAGS} -DCMAKE_CXX_STANDARD=11)
endif()

execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}" "${ADDITIONAL_CMAKE_FLAGS}" "${SOURCE_DIR}"
RESULT_VARIABLE result
WORKING_DIRECTORY ${BUILD_DIR} )
Expand All @@ -93,4 +89,9 @@ endfunction()

fetch_and_install(idlpp-cxx)
fetch_and_install(cyclonedds)
fetch_and_install(cyclonedds-cxx -DBUILD_TESTING=OFF)

if(APPLE)
fetch_and_install(cyclonedds-cxx -DBUILD_TESTING=OFF -DCMAKE_CXX_STANDARD=11)
else()
fetch_and_install(cyclonedds-cxx -DBUILD_TESTING=OFF)
endif()
8 changes: 4 additions & 4 deletions iceoryx_binding_c/test/moduletests/test_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,24 @@ using namespace ::testing;

TEST(iox_types_test, WaitSetStorageSizeFits)
{
EXPECT_THAT(sizeof(WaitSet<>), Eq(sizeof(iox_ws_storage_t)));
EXPECT_THAT(sizeof(WaitSet<>), Le(sizeof(iox_ws_storage_t)));
EXPECT_THAT(alignof(WaitSet<>), Le(alignof(iox_ws_storage_t)));
}

TEST(iox_types_test, UserTriggerStorageSizeFits)
{
EXPECT_THAT(sizeof(UserTrigger), Eq(sizeof(iox_user_trigger_storage_t)));
EXPECT_THAT(sizeof(UserTrigger), Le(sizeof(iox_user_trigger_storage_t)));
EXPECT_THAT(alignof(UserTrigger), Le(alignof(iox_user_trigger_storage_t)));
}

TEST(iox_types_test, cpp2c_SubscriberStorageSizeFits)
{
EXPECT_THAT(sizeof(cpp2c_Subscriber), Eq(sizeof(iox_sub_storage_t)));
EXPECT_THAT(sizeof(cpp2c_Subscriber), Le(sizeof(iox_sub_storage_t)));
EXPECT_THAT(alignof(cpp2c_Subscriber), Le(alignof(iox_sub_storage_t)));
}

TEST(iox_types_test, cpp2c_PublisherStorageSizeFits)
{
EXPECT_THAT(sizeof(cpp2c_Publisher), Eq(sizeof(iox_pub_storage_t)));
EXPECT_THAT(sizeof(cpp2c_Publisher), Le(sizeof(iox_pub_storage_t)));
EXPECT_THAT(alignof(cpp2c_Publisher), Le(alignof(iox_pub_storage_t)));
}

0 comments on commit a7603ac

Please sign in to comment.