mirror of
https://github.com/audacity/linuxdeploy.git
synced 2026-04-16 21:51:43 -05:00
Fix semantics of isEmpty()
This commit is contained in:
@@ -24,7 +24,7 @@ public:
|
||||
|
||||
public:
|
||||
bool isEmpty() {
|
||||
return path.empty();
|
||||
return sections.empty();
|
||||
}
|
||||
|
||||
void assertPathIsNotEmptyAndFileExists() {
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
bool operator!=(const DesktopFileReader& other) const;
|
||||
|
||||
public:
|
||||
// checks whether a file has been read already
|
||||
// checks whether parsed data is available
|
||||
bool isEmpty() const;
|
||||
|
||||
// returns desktop file path
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST_F(DesktopFileReaderFixture, testPathConstructor) {
|
||||
bf::path path = "/dev/null";
|
||||
|
||||
DesktopFileReader reader(path);
|
||||
EXPECT_FALSE(reader.isEmpty());
|
||||
EXPECT_TRUE(reader.isEmpty());
|
||||
|
||||
ASSERT_THROW(DesktopFileReader("/no/such/file/or/directory"), std::invalid_argument);
|
||||
}
|
||||
@@ -51,10 +51,10 @@ TEST_F(DesktopFileReaderFixture, testCopyConstructor) {
|
||||
bf::path path = "/dev/null";
|
||||
|
||||
DesktopFileReader reader(path);
|
||||
EXPECT_FALSE(reader.isEmpty());
|
||||
EXPECT_TRUE(reader.isEmpty());
|
||||
|
||||
DesktopFileReader copy = reader;
|
||||
EXPECT_FALSE(copy.isEmpty());
|
||||
EXPECT_TRUE(copy.isEmpty());
|
||||
|
||||
EXPECT_EQ(reader, copy);
|
||||
}
|
||||
@@ -66,7 +66,7 @@ TEST_F(DesktopFileReaderFixture, testCopyAssignmentConstructor) {
|
||||
EXPECT_TRUE(reader.isEmpty());
|
||||
|
||||
DesktopFileReader otherReader(path);
|
||||
EXPECT_FALSE(otherReader.isEmpty());
|
||||
EXPECT_TRUE(otherReader.isEmpty());
|
||||
|
||||
reader = otherReader;
|
||||
EXPECT_EQ(reader.path(), path);
|
||||
@@ -82,7 +82,7 @@ TEST_F(DesktopFileReaderFixture, testMoveAssignmentConstructor) {
|
||||
EXPECT_TRUE(reader.isEmpty());
|
||||
|
||||
DesktopFileReader otherReader(path);
|
||||
EXPECT_FALSE(otherReader.isEmpty());
|
||||
EXPECT_TRUE(otherReader.isEmpty());
|
||||
|
||||
reader = std::move(otherReader);
|
||||
EXPECT_EQ(reader.path(), path);
|
||||
|
||||
Reference in New Issue
Block a user