Skip to content

Commit

Permalink
do not create new instance
Browse files Browse the repository at this point in the history
  • Loading branch information
YannLocatelli committed Mar 4, 2024
1 parent 17030fa commit b829483
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions drivers/CoreDAC/tests/CoreDAC_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,9 @@ class CoreDACTest : public ::testing::Test

TEST_F(CoreDACTest, initializationDefault)
{
auto new_dac = CoreDAC {halmock, haltimermock};
EXPECT_NE(&new_dac, nullptr);
EXPECT_NE(&dac, nullptr);

auto handle = new_dac.getHandle();
auto handle = dac.getHandle();
EXPECT_NE(&handle, nullptr);
EXPECT_EQ(handle.Instance, DAC);
}
Expand Down
5 changes: 2 additions & 3 deletions drivers/CoreDAC/tests/CoreSTM32HalBasicTimer_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,9 @@ class CoreSTM32HalBasicTimerTest : public ::testing::Test

TEST_F(CoreSTM32HalBasicTimerTest, initializationDefault)
{
auto new_basic_timer = CoreSTM32HalBasicTimer {halmock};
EXPECT_NE(&new_basic_timer, nullptr);
EXPECT_NE(&basic_timer, nullptr);

auto handle = new_basic_timer.getHandle();
auto handle = basic_timer.getHandle();
EXPECT_NE(&handle, nullptr);
auto allowed_instance = handle.Instance == TIM6 || handle.Instance == TIM7;
EXPECT_TRUE(allowed_instance);
Expand Down

0 comments on commit b829483

Please sign in to comment.