Skip to content

Commit

Permalink
Add accumulator test to CMakeLists.txt (#144)
Browse files Browse the repository at this point in the history
* Add accumulator test to CMakeLists.txt

Also, use `gtest` instead of `gmock` headers in `test_accumulator`
because no mocking is used in said test.

Signed-off-by: Abrar Rahman Protyasha <[email protected]>
Co-authored-by: Chris Lalancette <[email protected]>
  • Loading branch information
aprotyas and clalancette authored Sep 2, 2021
1 parent d3c6f59 commit dd5fe5e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ if(BUILD_TESTING)
"_TEST_LIBRARY_DIR=$<TARGET_FILE_DIR:test_library>;_TEST_LIBRARY=$<TARGET_FILE:test_library>")

ament_add_gtest(test_clamp test/test_clamp.cpp)

ament_add_gtest(test_accumulator test/test_accumulator.cpp)
endif()

ament_package()
Expand Down
10 changes: 9 additions & 1 deletion test/test_accumulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// To get M_PI on Windows.

#ifdef _MSC_VER
#ifndef _USE_MATH_DEFINES
#define _USE_MATH_DEFINES
#endif
#endif

#include <rcppmath/rolling_mean_accumulator.hpp>

#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <cmath>
#include <memory>

Expand Down

0 comments on commit dd5fe5e

Please sign in to comment.