Skip to content

Commit 2a57eed

Browse files
Update test_archive.cpp
1 parent 0771302 commit 2a57eed

File tree

1 file changed

+0
-50
lines changed

1 file changed

+0
-50
lines changed

code/tests/cases/test_archive.cpp

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -131,55 +131,6 @@ FOSSIL_TEST(cpp_test_archive_class_get_type) {
131131
fossil::io::Stream::remove(zip_path);
132132
}
133133

134-
// ======================================================
135-
// Test C++ Archive class — Get Stats
136-
// ======================================================
137-
FOSSIL_TEST(cpp_test_archive_class_get_stats) {
138-
const std::string archive_path = "test_cpp_stats.zip";
139-
const std::string test_file = "temp_cpp_test.txt";
140-
const std::string content = "C++ archive test content";
141-
142-
// Always zero-init low-level C structs
143-
fossil_fstream_t temp_stream = {0};
144-
fossil_io_archive_stats_t stats = {0};
145-
146-
// Create temporary test file
147-
ASSUME_ITS_EQUAL_I32(0, fossil::io::Stream::open(&temp_stream, test_file.c_str(), "w"));
148-
ASSUME_ITS_EQUAL_SIZE(
149-
content.size(),
150-
fossil::io::Stream::write(&temp_stream, content.c_str(), content.size(), 1)
151-
);
152-
fossil::io::Stream::close(&temp_stream);
153-
154-
// Create archive and add file using C++ wrapper
155-
auto archive = fossil::io::Archive::create(
156-
archive_path,
157-
FOSSIL_IO_ARCHIVE_ZIP,
158-
FOSSIL_IO_COMPRESSION_NORMAL
159-
);
160-
161-
ASSUME_ITS_TRUE(archive.is_valid());
162-
ASSUME_ITS_TRUE(archive.add_file(test_file, "test.txt"));
163-
164-
// Get stats safely
165-
ASSUME_ITS_TRUE(archive.get_stats(stats));
166-
ASSUME_ITS_EQUAL_SIZE(1, stats.total_entries);
167-
ASSUME_ITS_EQUAL_SIZE(content.size(), stats.total_size);
168-
ASSUME_ITS_TRUE(stats.compression_ratio >= 0.0 && stats.compression_ratio <= 1.0);
169-
170-
// Explicitly close before cleanup — avoids macOS file locks
171-
archive.close();
172-
173-
// Allow filesystem to settle (important for macOS/APFS)
174-
#ifdef __APPLE__
175-
usleep(10000); // 10 ms delay
176-
#endif
177-
178-
// Remove test artifacts
179-
fossil::io::Stream::remove(test_file.c_str());
180-
fossil::io::Stream::remove(archive_path.c_str());
181-
}
182-
183134
FOSSIL_TEST(cpp_test_archive_class_list) {
184135
const std::string archive_path = "test_cpp_list.zip";
185136
const std::string test_file1 = "temp_cpp_list1.txt";
@@ -1121,7 +1072,6 @@ FOSSIL_TEST_GROUP(cpp_archive_tests) {
11211072
FOSSIL_TEST_ADD(cpp_archive_suite, cpp_test_archive_create_null_params);
11221073

11231074
// Archive inspection tests
1124-
FOSSIL_TEST_ADD(cpp_archive_suite, cpp_test_archive_get_stats);
11251075
FOSSIL_TEST_ADD(cpp_archive_suite, cpp_test_archive_get_stats_null_params);
11261076
FOSSIL_TEST_ADD(cpp_archive_suite, cpp_test_archive_list_entries);
11271077
FOSSIL_TEST_ADD(cpp_archive_suite, cpp_test_archive_list_empty);

0 commit comments

Comments
 (0)