Skip to content

Commit 94f998f

Browse files
committed
fix: simply make_note_log test parameters
1 parent b39d291 commit 94f998f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

test/NoteLog_Arduino.test.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ int test_make_note_log_instantiates_notelog_object()
1414

1515
// Arrange
1616
NoteLog * notelog = nullptr;
17+
Stream & serial_stream = Serial;
1718

1819
// Action
19-
notelog = make_note_log(*reinterpret_cast<Stream *>(&Serial));
20+
notelog = make_note_log(serial_stream);
2021

2122
// Assert
2223
if (nullptr != notelog)
@@ -42,10 +43,11 @@ int test_make_note_log_enforces_singleton_by_returning_same_notelog_object_for_a
4243
int result;
4344

4445
// Arrange
45-
NoteLog * const notelog_1 = make_note_log(*reinterpret_cast<Stream *>(&Serial));
46+
Stream & serial_stream = Serial;
47+
NoteLog * const notelog_1 = make_note_log(serial_stream);
4648

4749
// Action
48-
NoteLog * const notelog_2 = make_note_log(*reinterpret_cast<Stream *>(&Serial));
50+
NoteLog * const notelog_2 = make_note_log(serial_stream);
4951

5052
// Assert
5153
if (notelog_1 == notelog_2)
@@ -72,7 +74,8 @@ int test_make_note_log_deletes_singleton_when_nullptr_is_passed_as_parameter()
7274
int result;
7375

7476
// Arrange
75-
NoteLog * notelog = make_note_log(*reinterpret_cast<Stream *>(&Serial));
77+
Stream & serial_stream = Serial;
78+
NoteLog * notelog = make_note_log(serial_stream);
7679
assert(notelog);
7780

7881
// Action

0 commit comments

Comments
 (0)