Add clearing FS label to CreateAndWriteLabel unit test

For FAT16/32 and XFS file systems clearing the label uses different
command options and code path in file system specific ::write_label()
method.  Therefore extend this unit test to also test clearing the
label.
This commit is contained in:
Mike Fleetwood 2022-06-20 20:47:38 +01:00 committed by Curtis Gedak
parent b7ef1688b8
commit a46c0cbe80
1 changed files with 5 additions and 1 deletions

View File

@ -596,7 +596,11 @@ TEST_P(SupportedFileSystemsTest, CreateAndWriteLabel)
m_partition.set_filesystem_label("FIRST");
ASSERT_TRUE(m_fs_object->create(m_partition, m_operation_detail)) << m_operation_detail;
// Test writing a label is successful.
// Test clearing the label is successful.
m_partition.set_filesystem_label("");
ASSERT_TRUE(m_fs_object->write_label(m_partition, m_operation_detail)) << m_operation_detail;
// Test writing the label is successful.
m_partition.set_filesystem_label("SECOND");
ASSERT_TRUE(m_fs_object->write_label(m_partition, m_operation_detail)) << m_operation_detail;
}