Skip to content

Commit b829483

Browse files
committed
do not create new instance
1 parent 17030fa commit b829483

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

drivers/CoreDAC/tests/CoreDAC_test.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,9 @@ class CoreDACTest : public ::testing::Test
6464

6565
TEST_F(CoreDACTest, initializationDefault)
6666
{
67-
auto new_dac = CoreDAC {halmock, haltimermock};
68-
EXPECT_NE(&new_dac, nullptr);
67+
EXPECT_NE(&dac, nullptr);
6968

70-
auto handle = new_dac.getHandle();
69+
auto handle = dac.getHandle();
7170
EXPECT_NE(&handle, nullptr);
7271
EXPECT_EQ(handle.Instance, DAC);
7372
}

drivers/CoreDAC/tests/CoreSTM32HalBasicTimer_test.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,9 @@ class CoreSTM32HalBasicTimerTest : public ::testing::Test
5555

5656
TEST_F(CoreSTM32HalBasicTimerTest, initializationDefault)
5757
{
58-
auto new_basic_timer = CoreSTM32HalBasicTimer {halmock};
59-
EXPECT_NE(&new_basic_timer, nullptr);
58+
EXPECT_NE(&basic_timer, nullptr);
6059

61-
auto handle = new_basic_timer.getHandle();
60+
auto handle = basic_timer.getHandle();
6261
EXPECT_NE(&handle, nullptr);
6362
auto allowed_instance = handle.Instance == TIM6 || handle.Instance == TIM7;
6463
EXPECT_TRUE(allowed_instance);

0 commit comments

Comments
 (0)