Skip to content

Commit be0a891

Browse files
committed
Improve test fixture names
1 parent 92a1370 commit be0a891

4 files changed

Lines changed: 64 additions & 64 deletions

File tree

tests/core/desktopfile/test_desktopfile.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ using namespace linuxdeploy::core::desktopfile;
1212

1313
namespace bf = boost::filesystem;
1414

15-
class DesktopFileFixture : public ::testing::Test {
15+
class DesktopFileTest : public ::testing::Test {
1616
public:
1717
std::string testType;
1818
std::string testName;
@@ -61,12 +61,12 @@ class DesktopFileFixture : public ::testing::Test {
6161
}
6262
};
6363

64-
TEST_F(DesktopFileFixture, testDefaultConstructor) {
64+
TEST_F(DesktopFileTest, testDefaultConstructor) {
6565
DesktopFile file;
6666
EXPECT_TRUE(file.isEmpty());
6767
}
6868

69-
TEST_F(DesktopFileFixture, testPathConstructor) {
69+
TEST_F(DesktopFileTest, testPathConstructor) {
7070
ASSERT_THROW(DesktopFile nonExistingPath("/a/b/c/d/e/f/g/h/1/2/3/4/5/6/7/8"), IOError);
7171

7272
DesktopFile emptyFile("/dev/null");
@@ -76,7 +76,7 @@ TEST_F(DesktopFileFixture, testPathConstructor) {
7676
EXPECT_FALSE(file.isEmpty());
7777
}
7878

79-
TEST_F(DesktopFileFixture, testStreamConstructor) {
79+
TEST_F(DesktopFileTest, testStreamConstructor) {
8080
std::stringstream emptyString;
8181
DesktopFile emptyFile(emptyString);
8282
EXPECT_TRUE(emptyFile.isEmpty());
@@ -89,7 +89,7 @@ TEST_F(DesktopFileFixture, testStreamConstructor) {
8989
assertIsTestDesktopFile(file);
9090
}
9191

92-
TEST_F(DesktopFileFixture, testCopyConstructor) {
92+
TEST_F(DesktopFileTest, testCopyConstructor) {
9393
DesktopFile empty;
9494
EXPECT_TRUE(empty == empty);
9595
EXPECT_FALSE(empty != empty);
@@ -111,7 +111,7 @@ TEST_F(DesktopFileFixture, testCopyConstructor) {
111111
assertIsTestDesktopFile(copy);
112112
}
113113

114-
TEST_F(DesktopFileFixture, testCopyAssignmentConstructor) {
114+
TEST_F(DesktopFileTest, testCopyAssignmentConstructor) {
115115
std::stringstream ss;
116116
ss << testDesktopFile;
117117
DesktopFile file(ss);
@@ -126,7 +126,7 @@ TEST_F(DesktopFileFixture, testCopyAssignmentConstructor) {
126126
assertIsTestDesktopFile(copy);
127127
}
128128

129-
TEST_F(DesktopFileFixture, testMoveAssignmentConstructor) {
129+
TEST_F(DesktopFileTest, testMoveAssignmentConstructor) {
130130
std::stringstream ss;
131131
ss << testDesktopFile;
132132
DesktopFile file(ss);
@@ -138,7 +138,7 @@ TEST_F(DesktopFileFixture, testMoveAssignmentConstructor) {
138138
assertIsTestDesktopFile(copy);
139139
}
140140

141-
TEST_F(DesktopFileFixture, testAddDefaultValues) {
141+
TEST_F(DesktopFileTest, testAddDefaultValues) {
142142
const auto& value = "testExecutable";
143143

144144
DesktopFile file;
@@ -157,7 +157,7 @@ TEST_F(DesktopFileFixture, testAddDefaultValues) {
157157
EXPECT_EQ(reader["Desktop Entry"]["Categories"].value(), "Utility;");
158158
}
159159

160-
TEST_F(DesktopFileFixture, testAddDefaultValuesExistingKeys) {
160+
TEST_F(DesktopFileTest, testAddDefaultValuesExistingKeys) {
161161
const auto& value = "testExecutable";
162162

163163
std::stringstream iss;
@@ -181,7 +181,7 @@ TEST_F(DesktopFileFixture, testAddDefaultValuesExistingKeys) {
181181
EXPECT_EQ(reader["Desktop Entry"]["Categories"].value(), "Utility;");
182182
}
183183

184-
TEST_F(DesktopFileFixture, testAddDefaultValuesNoOverwrite) {
184+
TEST_F(DesktopFileTest, testAddDefaultValuesNoOverwrite) {
185185
const auto& value = "testExecutable";
186186

187187
std::stringstream iss;
@@ -208,7 +208,7 @@ TEST_F(DesktopFileFixture, testAddDefaultValuesNoOverwrite) {
208208
}
209209
}
210210

211-
TEST_F(DesktopFileFixture, testSaveToPath) {
211+
TEST_F(DesktopFileTest, testSaveToPath) {
212212
std::stringstream ins;
213213
ins << testDesktopFile;
214214

@@ -217,12 +217,12 @@ TEST_F(DesktopFileFixture, testSaveToPath) {
217217
EXPECT_NO_THROW(file.save("/dev/null"));
218218
}
219219

220-
TEST_F(DesktopFileFixture, testSave) {
220+
TEST_F(DesktopFileTest, testSave) {
221221
DesktopFile file("/dev/null");
222222
EXPECT_NO_THROW(file.save());
223223
}
224224

225-
TEST_F(DesktopFileFixture, testSaveToStream) {
225+
TEST_F(DesktopFileTest, testSaveToStream) {
226226
std::stringstream ins;
227227
ins << testDesktopFile;
228228

@@ -234,7 +234,7 @@ TEST_F(DesktopFileFixture, testSaveToStream) {
234234
assertHasTestDesktopFileKeys(outs);
235235
}
236236

237-
TEST_F(DesktopFileFixture, testEquality) {
237+
TEST_F(DesktopFileTest, testEquality) {
238238
std::stringstream ins0(testDesktopFile);
239239
std::stringstream ins1(testDesktopFile);
240240

@@ -247,7 +247,7 @@ TEST_F(DesktopFileFixture, testEquality) {
247247
EXPECT_EQ(file0, file1);
248248
}
249249

250-
TEST_F(DesktopFileFixture, testInequality) {
250+
TEST_F(DesktopFileTest, testInequality) {
251251
std::stringstream ins;
252252
ins << testDesktopFile;
253253

tests/core/desktopfile/test_desktopfileentry.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,39 +11,39 @@ using namespace linuxdeploy::core::desktopfile;
1111

1212
namespace bf = boost::filesystem;
1313

14-
class DesktopFileEntryFixture : public ::testing::Test {
14+
class DesktopFileEntryTest : public ::testing::Test {
1515
public:
1616
const std::string key;
1717
const std::string value;
1818

1919
protected:
20-
DesktopFileEntryFixture() : key("testKey"), value("testValue") {}
20+
DesktopFileEntryTest() : key("testKey"), value("testValue") {}
2121

2222
private:
2323
void SetUp() override {}
2424

2525
void TearDown() override {}
2626
};
2727

28-
TEST_F(DesktopFileEntryFixture, testDefaultConstructor) {
28+
TEST_F(DesktopFileEntryTest, testDefaultConstructor) {
2929
DesktopFileEntry entry;
3030
EXPECT_TRUE(entry.isEmpty());
3131
}
3232

33-
TEST_F(DesktopFileEntryFixture, testKeyValueConstructor) {
33+
TEST_F(DesktopFileEntryTest, testKeyValueConstructor) {
3434
DesktopFileEntry entry(key, value);
3535
EXPECT_FALSE(entry.isEmpty());
3636
EXPECT_EQ(entry.key(), key);
3737
EXPECT_EQ(entry.value(), value);
3838
}
3939

40-
TEST_F(DesktopFileEntryFixture, testGetters) {
40+
TEST_F(DesktopFileEntryTest, testGetters) {
4141
DesktopFileEntry entry(key, value);
4242
EXPECT_EQ(entry.key(), key);
4343
EXPECT_EQ(entry.value(), value);
4444
}
4545

46-
TEST_F(DesktopFileEntryFixture, testEqualityAndInequalityOperators) {
46+
TEST_F(DesktopFileEntryTest, testEqualityAndInequalityOperators) {
4747
DesktopFileEntry emptyEntry;
4848
EXPECT_TRUE(emptyEntry == emptyEntry);
4949
EXPECT_FALSE(emptyEntry != emptyEntry);
@@ -55,7 +55,7 @@ TEST_F(DesktopFileEntryFixture, testEqualityAndInequalityOperators) {
5555
EXPECT_NE(nonEmptyEntry, nonEmptyEntryWithDifferentValue);
5656
}
5757

58-
TEST_F(DesktopFileEntryFixture, testCopyConstructor) {
58+
TEST_F(DesktopFileEntryTest, testCopyConstructor) {
5959
DesktopFileEntry entry(key, value);
6060
EXPECT_FALSE(entry.isEmpty());
6161

@@ -65,7 +65,7 @@ TEST_F(DesktopFileEntryFixture, testCopyConstructor) {
6565
EXPECT_EQ(entry, copy);
6666
}
6767

68-
TEST_F(DesktopFileEntryFixture, testCopyAssignmentConstructor) {
68+
TEST_F(DesktopFileEntryTest, testCopyAssignmentConstructor) {
6969
DesktopFileEntry entry;
7070
EXPECT_TRUE(entry.isEmpty());
7171

@@ -80,7 +80,7 @@ TEST_F(DesktopFileEntryFixture, testCopyAssignmentConstructor) {
8080
entry = entry;
8181
}
8282

83-
TEST_F(DesktopFileEntryFixture, testMoveAssignmentConstructor) {
83+
TEST_F(DesktopFileEntryTest, testMoveAssignmentConstructor) {
8484
DesktopFileEntry entry;
8585
EXPECT_TRUE(entry.isEmpty());
8686

@@ -95,7 +95,7 @@ TEST_F(DesktopFileEntryFixture, testMoveAssignmentConstructor) {
9595
entry = std::move(entry);
9696
}
9797

98-
TEST_F(DesktopFileEntryFixture, testConversionToInt) {
98+
TEST_F(DesktopFileEntryTest, testConversionToInt) {
9999
DesktopFileEntry intEntry(key, "1234");
100100
EXPECT_EQ(intEntry.asInt(), 1234);
101101

@@ -106,7 +106,7 @@ TEST_F(DesktopFileEntryFixture, testConversionToInt) {
106106
ASSERT_THROW(emptyEntry.asInt(), std::invalid_argument);
107107
}
108108

109-
TEST_F(DesktopFileEntryFixture, testConversionToLong) {
109+
TEST_F(DesktopFileEntryTest, testConversionToLong) {
110110
DesktopFileEntry intEntry(key, "123456789123456789");
111111
EXPECT_EQ(intEntry.asLong(), 123456789123456789L);
112112

@@ -117,7 +117,7 @@ TEST_F(DesktopFileEntryFixture, testConversionToLong) {
117117
ASSERT_THROW(emptyEntry.asLong(), std::invalid_argument);
118118
}
119119

120-
TEST_F(DesktopFileEntryFixture, testConversionToDouble) {
120+
TEST_F(DesktopFileEntryTest, testConversionToDouble) {
121121
DesktopFileEntry doubleEntry(key, "1.234567");
122122
EXPECT_NEAR(doubleEntry.asDouble(), 1.234567, 0.00000001);
123123

@@ -128,7 +128,7 @@ TEST_F(DesktopFileEntryFixture, testConversionToDouble) {
128128
ASSERT_THROW(emptyEntry.asDouble(), std::invalid_argument);
129129
}
130130

131-
TEST_F(DesktopFileEntryFixture, testParsingStringList) {
131+
TEST_F(DesktopFileEntryTest, testParsingStringList) {
132132
DesktopFileEntry emptyEntry(key, "");
133133
EXPECT_EQ(emptyEntry.parseStringList(), std::vector<std::string>({}));
134134

0 commit comments

Comments
 (0)