Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
trying with gmock to find matches
Browse files Browse the repository at this point in the history
  • Loading branch information
prince-chrismc authored Sep 29, 2023
1 parent b96d278 commit 2a98d8e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ find_package(GTest REQUIRED CONFIG)
include(GoogleTest)

add_executable(${PROJECT_NAME}Tests criterions.cpp functions.cpp operations.cpp subscripts.cpp)
target_link_libraries(${PROJECT_NAME}Tests PRIVATE ${PROJECT_NAME} GTest::gtest GTest::gtest_main)
target_link_libraries(${PROJECT_NAME}Tests PRIVATE ${PROJECT_NAME} GTest::gtest GTest::gtest_main GTest::gmock)
target_compile_features(${PROJECT_NAME}Tests PRIVATE cxx_std_20)
gtest_add_tests(TARGET ${PROJECT_NAME}Tests)
5 changes: 4 additions & 1 deletion tests/functions.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#include "CaberNet.h"
#include <gtest/gtest.h>
#include <gtest/gmock.h>

using ::testing::ElementsAre;

TEST(functions, gradient) {
/*
Expand Down Expand Up @@ -45,7 +48,7 @@ TEST(functions, gradient) {
ASSERT_TRUE(diff_x.empty());


ASSERT_THAT(x, testing::ElementsAre(0, 34, 0, 0, 0, 79, 17, 27));
EXPECT_THAT(x, ElementsAre(0, 34, 0, 0, 0, 79, 17, 27));
// ASSERT_EQ([0, 0, 0, 5, 7, 9, 4, 5, 6, 4, 5, 6], w.gradient());
// ASSERT_EQ([0, 2, 1, 1], b.gradient());
}

0 comments on commit 2a98d8e

Please sign in to comment.