8000 Update integration.c · g-coder/midikit@a280ab4 · GitHub
[go: up one dir, main page]

Skip to content

Commit a280ab4

Browse files
committed
Update integration.c
In file test/integration.c at #157 Pointer 'driver' is dereferenced which can be NULL. Solution: ASSERT_NOT_EQUAL( driver, NULL, "Could not create driver." ); should come before driver->send = &_send;
1 parent 8e4d019 commit a280ab4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/integration.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ static int _send( void * implementation, struct MIDIMessage * message ) {
136136
* The messages that are received by the driver are given to the first device:
137137
*
138138
* [device 1] -(out)-----(in)-> [device 2] -(out)-------> [driver] (loopback)
139-
* ^-(in)--------------------------------------------´
139+
* ^-(in)--------------------------------------------´
140140
*
141141
* device 1 receives from driver
142142
* device 2 receives from device 1 out
@@ -154,11 +154,11 @@ int test001_integration( void ) {
154154
device_1 = MIDIDeviceCreate( &_test_device );
155155
device_2 = MIDIDeviceCreate( &_test_device );
156156
driver = MIDIDriverCreate( "test driver", MIDI_SAMPLING_RATE_DEFAULT );
157+
ASSERT_NOT_EQUAL( driver, NULL, "Could not create driver." );
157158
driver->send = &_send;
158159

159160
ASSERT_NOT_EQUAL( device_1, NULL, "Could not create device 1." );
160161
ASSERT_NOT_EQUAL( device_2, NULL, "Could not create device 2." );
161-
ASSERT_NOT_EQUAL( driver, NULL, "Could not create driver." );
162162

163163
ASSERT_NO_ERROR( MIDIDeviceGetOutputPort( device_1, &port ), "Could not get out port." );
164164
ASSERT_NO_ERROR( MIDIDeviceAttachIn( device_2, port ), "Could not attach port to device 2 in port." );

0 commit comments

Comments
 (0)
0