Skip to content

Commit b4138d1

Browse files
usb_device-msd test: OS type detection fix
1 parent 60ef4a0 commit b4138d1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

TESTS/usb_device/msd/main.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ void mount_unmount_test(BlockDevice *bd, FileSystem *fs)
327327
#ifdef DISABLE_HOST_SIDE_UMOUNT
328328
greentea_send_kv("get_os_type", 0);
329329
greentea_parse_kv(_key, _value, sizeof(_key), sizeof(_value));
330-
int32_t os_type = atoi(_key);
330+
int32_t os_type = atoi(_value);
331331
if (os_type != OS_WINDOWS) {
332332
#endif
333333
// unmount msd device on host side
@@ -340,13 +340,14 @@ void mount_unmount_test(BlockDevice *bd, FileSystem *fs)
340340
if (!usb.media_removed()) {
341341
TEST_ASSERT_EQUAL_LOOP(true, usb.media_removed(), i);
342342
}
343-
#ifdef DISABLE_HOST_SIDE_UMOUNT
343+
344344
// unmount since media_removed doesn't disconnects device side
345345
usb.disconnect();
346-
}
347-
#else
346+
#ifdef DISABLE_HOST_SIDE_UMOUNT
347+
} else {
348348
// unmount
349349
usb.disconnect();
350+
}
350351
#endif
351352
// check if device is detached on host side
352353
greentea_send_kv("check_if_not_mounted", 0);

0 commit comments

Comments
 (0)