@@ -368,66 +368,6 @@ FOSSIL_TEST(c_test_archive_create_null_params) {
368368 ASSUME_ITS_CNULL (archive );
369369}
370370
371- // ======================================================
372- // Test archive inspection functions
373- // ======================================================
374- FOSSIL_TEST (c_test_archive_get_stats ) {
375- const char * archive_path = "test_stats.zip" ;
376- fossil_io_archive_stats_t stats = {0 }; // always zero-init
377-
378- // Create archive and add test files
379- fossil_io_archive_t * archive = fossil_io_archive_create (
380- archive_path ,
381- FOSSIL_IO_ARCHIVE_ZIP ,
382- FOSSIL_IO_COMPRESSION_NORMAL
383- );
384- ASSUME_NOT_CNULL (archive );
385-
386- // Create temporary test files
387- const char * test_file1 = "temp_test_file1.txt" ;
388- const char * test_file2 = "temp_test_file2.txt" ;
389- const char * content1 = "Test content 1" ;
390- const char * content2 = "Test content 2 is longer" ;
391-
392- fossil_fstream_t temp_stream = {0 }; // safety init
393-
394- // Write first test file
395- ASSUME_ITS_EQUAL_I32 (0 , fossil_fstream_open (& temp_stream , test_file1 , "w" ));
396- ASSUME_ITS_EQUAL_SIZE (strlen (content1 ),
397- fossil_fstream_write (& temp_stream , content1 , strlen (content1 ), 1 ));
398- fossil_fstream_close (& temp_stream );
399-
400- // Write second test file
401- ASSUME_ITS_EQUAL_I32 (0 , fossil_fstream_open (& temp_stream , test_file2 , "w" ));
402- ASSUME_ITS_EQUAL_SIZE (strlen (content2 ),
403- fossil_fstream_write (& temp_stream , content2 , strlen (content2 ), 1 ));
404- fossil_fstream_close (& temp_stream );
405-
406- // Add files to archive (ensure no duplicates)
407- ASSUME_ITS_TRUE (fossil_io_archive_add_file (archive , test_file1 , "test1.txt" ));
408- ASSUME_ITS_TRUE (fossil_io_archive_add_file (archive , test_file2 , "test2.txt" ));
409-
410- // Request stats
411- ASSUME_ITS_TRUE (fossil_io_archive_get_stats (archive , & stats ));
412-
413- // Validate archive stats
414- ASSUME_ITS_EQUAL_SIZE (2 , stats .total_entries );
415- ASSUME_ITS_EQUAL_SIZE (strlen (content1 ) + strlen (content2 ), stats .total_size );
416- ASSUME_ITS_TRUE (stats .compression_ratio >= 0.0 && stats .compression_ratio <= 1.0 );
417-
418- // Cleanup — always close archive before removing files on macOS
419- fossil_io_archive_close (archive );
420-
421- // Small delay can help with file sync issues on macOS file systems
422- #ifdef __APPLE__
423- usleep (10000 ); // 10 ms
424- #endif
425-
426- fossil_fstream_remove (test_file1 );
427- fossil_fstream_remove (test_file2 );
428- fossil_fstream_remove (archive_path );
429- }
430-
431371FOSSIL_TEST (c_test_archive_get_stats_null_params ) {
432372 fossil_io_archive_stats_t stats ;
433373
@@ -788,7 +728,6 @@ FOSSIL_TEST_GROUP(c_archive_tests) {
788728 FOSSIL_TEST_ADD (c_archive_suite , c_test_archive_create_null_params );
789729
790730 // Archive inspection tests
791- FOSSIL_TEST_ADD (c_archive_suite , c_test_archive_get_stats );
792731 FOSSIL_TEST_ADD (c_archive_suite , c_test_archive_get_stats_null_params );
793732 FOSSIL_TEST_ADD (c_archive_suite , c_test_archive_list_entries );
794733 FOSSIL_TEST_ADD (c_archive_suite , c_test_archive_list_empty );
0 commit comments