Skip to content

Commit c22c75b

Browse files
committed
Merge branch 'main' into dev/audio_worklet
2 parents 13b0602 + a3561f6 commit c22c75b

File tree

1 file changed

+27
-35
lines changed

1 file changed

+27
-35
lines changed

tests/juce_core/juce_ZipFile.cpp

Lines changed: 27 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -146,29 +146,25 @@ TEST_F (ZipFileTests, CreateFromFile)
146146
File zipFile = getNonExistingZipFile();
147147
ZipFile zip (zipFile);
148148

149-
EXPECT_EQ (zip.getNumEntries(), 0); // Assumes the test.zip is empty or non-existent
149+
EXPECT_EQ (zip.getNumEntries(), 0);
150150
}
151151

152-
TEST_F (ZipFileTests, CreateFromInputStream)
152+
TEST_F (ZipFileTests, DISABLED_CreateFromInputStream)
153153
{
154-
/*
155154
File zipFile = getNonExistingZipFile();
156-
FileInputStream fileStream(zipFile);
157-
ZipFile zip(&fileStream, false);
155+
FileInputStream fileStream (zipFile);
156+
ZipFile zip (&fileStream, false);
158157

159-
EXPECT_EQ(zip.getNumEntries(), 0); // Assumes the test.zip is empty or non-existent
160-
*/
158+
EXPECT_EQ (zip.getNumEntries(), 0);
161159
}
162160

163-
TEST_F (ZipFileTests, CreateFromInputStreamNoOwnership)
161+
TEST_F (ZipFileTests, DISABLED_CreateFromInputStreamNoOwnership)
164162
{
165-
/*
166163
File zipFile = getNonExistingZipFile();
167-
FileInputStream fileStream(zipFile);
168-
ZipFile zip(fileStream);
164+
FileInputStream fileStream (zipFile);
165+
ZipFile zip (fileStream);
169166

170-
EXPECT_EQ(zip.getNumEntries(), 0); // Assumes the test.zip is empty or non-existent
171-
*/
167+
EXPECT_EQ (zip.getNumEntries(), 0);
172168
}
173169

174170
TEST_F (ZipFileTests, CreateFromInputSource)
@@ -186,39 +182,39 @@ TEST_F (ZipFileTests, CreateFromInputSource)
186182
auto* inputSource = new TestInputSource;
187183
ZipFile zip (inputSource);
188184

189-
EXPECT_EQ (zip.getNumEntries(), 0); // Assumes the TestInputSource returns null streams
185+
EXPECT_EQ (zip.getNumEntries(), 0);
190186
}
191187

192188
TEST_F (ZipFileTests, GetNumEntries)
193189
{
194190
File zipFile = getNonExistingZipFile();
195191
ZipFile zip (zipFile);
196192

197-
EXPECT_EQ (zip.getNumEntries(), 0); // Assumes the test.zip is empty or non-existent
193+
EXPECT_EQ (zip.getNumEntries(), 0);
198194
}
199195

200196
TEST_F (ZipFileTests, GetEntryByIndex)
201197
{
202198
File zipFile = getNonExistingZipFile();
203199
ZipFile zip (zipFile);
204200

205-
EXPECT_EQ (zip.getEntry (0), nullptr); // Assumes the test.zip is empty or non-existent
201+
EXPECT_EQ (zip.getEntry (0), nullptr);
206202
}
207203

208204
TEST_F (ZipFileTests, GetEntryByName)
209205
{
210206
File zipFile = getNonExistingZipFile();
211207
ZipFile zip (zipFile);
212208

213-
EXPECT_EQ (zip.getEntry ("nonexistent.txt"), nullptr); // Assumes the test.zip does not contain this file
209+
EXPECT_EQ (zip.getEntry ("nonexistent.txt"), nullptr);
214210
}
215211

216212
TEST_F (ZipFileTests, GetIndexOfFileName)
217213
{
218214
File zipFile = getNonExistingZipFile();
219215
ZipFile zip (zipFile);
220216

221-
EXPECT_EQ (zip.getIndexOfFileName ("nonexistent.txt"), -1); // Assumes the test.zip does not contain this file
217+
EXPECT_EQ (zip.getIndexOfFileName ("nonexistent.txt"), -1);
222218
}
223219

224220
TEST_F (ZipFileTests, SortEntriesByFilename)
@@ -235,7 +231,7 @@ TEST_F (ZipFileTests, CreateStreamForEntryByIndex)
235231
File zipFile = getNonExistingZipFile();
236232
ZipFile zip (zipFile);
237233

238-
EXPECT_EQ (zip.createStreamForEntry (0), nullptr); // Assumes the test.zip is empty or non-existent
234+
EXPECT_EQ (zip.createStreamForEntry (0), nullptr);
239235
}
240236

241237
TEST_F (ZipFileTests, CreateStreamForEntryByName)
@@ -244,31 +240,27 @@ TEST_F (ZipFileTests, CreateStreamForEntryByName)
244240
ZipFile zip (zipFile);
245241

246242
const ZipFile::ZipEntry* entry = zip.getEntry ("nonexistent.txt");
247-
ASSERT_EQ (nullptr, entry);
243+
EXPECT_EQ (nullptr, entry);
248244
}
249245

250-
TEST_F (ZipFileTests, UncompressTo)
246+
TEST_F (ZipFileTests, DISABLED_UncompressTo)
251247
{
252-
/*
253248
File zipFile = getNonExistingZipFile();
254-
ZipFile zip(zipFile);
255-
File targetDirectory(File::getCurrentWorkingDirectory().getChildFile("unzip_test"));
249+
ZipFile zip (zipFile);
250+
File targetDirectory (File::getCurrentWorkingDirectory().getChildFile ("unzip_test"));
256251

257-
Result result = zip.uncompressTo(targetDirectory, true);
258-
EXPECT_FALSE(result.wasOk()); // Assumes the test.zip is empty or non-existent
259-
*/
252+
Result result = zip.uncompressTo (targetDirectory, true);
253+
EXPECT_FALSE (result.wasOk());
260254
}
261255

262-
TEST_F (ZipFileTests, UncompressEntry)
256+
TEST_F (ZipFileTests, DISABLED_UncompressEntry)
263257
{
264-
/*
265258
File zipFile = getNonExistingZipFile();
266-
ZipFile zip(zipFile);
267-
File targetDirectory(File::getCurrentWorkingDirectory().getChildFile("unzip_test"));
259+
ZipFile zip (zipFile);
260+
File targetDirectory (File::getCurrentWorkingDirectory().getChildFile ("unzip_test"));
268261

269-
Result result = zip.uncompressEntry(0, targetDirectory, true);
270-
EXPECT_FALSE(result.wasOk()); // Assumes the test.zip is empty or non-existent
271-
*/
262+
Result result = zip.uncompressEntry (0, targetDirectory, true);
263+
EXPECT_FALSE (result.wasOk());
272264
}
273265

274266
TEST_F (ZipFileTests, BuilderAddFile)
@@ -293,5 +285,5 @@ TEST_F (ZipFileTests, BuilderWriteToStream)
293285
MemoryOutputStream outputStream;
294286

295287
bool result = builder.writeToStream (outputStream, nullptr);
296-
EXPECT_TRUE (result); // Expecting true even if the builder is empty
288+
EXPECT_TRUE (result);
297289
}

0 commit comments

Comments
 (0)