Add a specific test for the failure found in bug 771670 and fixed by
commit:
253c4d6416
Fix BlockSpecial comparison (#771670)
Bug 781978 - Add Google Test C++ test framework
This commit is contained in:
parent
debbd811b8
commit
f4008092dd
|
@ -342,6 +342,18 @@ TEST( BlockSpecialTest, OperatorEqualsTwoDifferentBlockDevices )
|
|||
EXPECT_FALSE( bs1 == bs2 );
|
||||
}
|
||||
|
||||
TEST( BlockSpecialTest, OperatorEqualsSameBlockDevicesWithMinorZero )
|
||||
{
|
||||
// Test for fix in bug #771670. Ensure that block devices with minor number 0 are
|
||||
// compared by major, minor pair rather than by name.
|
||||
BlockSpecial::clear_cache();
|
||||
BlockSpecial::register_block_special( "/dev/mapper/encrypted_swap", 254, 0 );
|
||||
BlockSpecial::register_block_special( "/dev/dm-0", 254, 0 );
|
||||
BlockSpecial bs1( "/dev/mapper/encrypted_swap" );
|
||||
BlockSpecial bs2( "/dev/dm-0" );
|
||||
EXPECT_TRUE( bs1 == bs2 );
|
||||
}
|
||||
|
||||
// FIXME: Write tests to fully check operator<() is working as intended.
|
||||
|
||||
} // namespace GParted
|
||||
|
|
Loading…
Reference in New Issue