From a5e5b874ff69b4cf31a04b6ad857eda9f7826626 Mon Sep 17 00:00:00 2001 From: Oz Date: Tue, 16 Jan 2024 21:42:37 +0100 Subject: [PATCH] Revert back to Catch2 v2 Catch v3 doesn't support MSVC 2015 --- tests/CMakeLists.txt | 4 +- tests/src/main.cpp | 2 +- tests/src/test_bit7zlibrary.cpp | 6 +- tests/src/test_bitabstractarchivecreator.cpp | 4 +- tests/src/test_bitarchiveeditor.cpp | 2 +- tests/src/test_bitarchiveiteminfo.cpp | 4 +- tests/src/test_bitarchivereader.cpp | 18 +++--- tests/src/test_biterror.cpp | 3 +- tests/src/test_bitexception.cpp | 3 +- tests/src/test_bitfilecompressor.cpp | 2 +- tests/src/test_bitfileextractor.cpp | 2 +- tests/src/test_bitinputarchive.cpp | 68 +++++++++----------- tests/src/test_bititemsvector.cpp | 4 +- tests/src/test_bitmemcompressor.cpp | 2 +- tests/src/test_bitmemextractor.cpp | 2 +- tests/src/test_bitoutputarchive.cpp | 4 +- tests/src/test_bitpropvariant.cpp | 4 +- tests/src/test_bitstreamcompressor.cpp | 2 +- tests/src/test_bitstreamextractor.cpp | 2 +- tests/src/test_cbufferinstream.cpp | 5 +- tests/src/test_dateutil.cpp | 3 +- tests/src/test_formatdetect.cpp | 3 +- tests/src/test_fsutil.cpp | 2 +- tests/src/test_stringutil.cpp | 3 +- tests/src/test_util.cpp | 3 +- tests/src/test_windows.cpp | 3 +- tests/src/utils/filesystem.cpp | 4 +- 27 files changed, 66 insertions(+), 98 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 99db45f3..2f21da2c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -165,10 +165,10 @@ endif() # Catch2 CPMAddPackage( NAME Catch2 - VERSION 3.5.1 + VERSION 2.13.10 OPTIONS "CATCH_CONFIG_CONSOLE_WIDTH 512" "CATCH_CONFIG_ENABLE_ALL_STRINGMAKERS ON" GITHUB_REPOSITORY "catchorg/Catch2" ) -list( APPEND CMAKE_MODULE_PATH "${Catch2_SOURCE_DIR}/extras" ) +list( APPEND CMAKE_MODULE_PATH "${Catch2_SOURCE_DIR}/contrib" ) include( CTest ) include( Catch ) diff --git a/tests/src/main.cpp b/tests/src/main.cpp index 4ad6f9de..d2ffb80f 100644 --- a/tests/src/main.cpp +++ b/tests/src/main.cpp @@ -12,7 +12,7 @@ #define CATCH_CONFIG_RUNNER -#include // IMPORTANT: it must be included before any other includes. +#include // IMPORTANT: it must be included before any other includes. #include diff --git a/tests/src/test_bit7zlibrary.cpp b/tests/src/test_bit7zlibrary.cpp index 9f68a827..f6c1125f 100644 --- a/tests/src/test_bit7zlibrary.cpp +++ b/tests/src/test_bit7zlibrary.cpp @@ -10,9 +10,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include -#include -#include +#include #include "utils/shared_lib.hpp" @@ -46,7 +44,7 @@ TEST_CASE( "Bit7zLibrary: Constructing from a non-existing shared library", "[bi TEST_CASE( "Bit7zLibrary: Normal construction", "[bit7zlibrary]" ) { const auto libPath = sevenzip_lib_path(); - INFO( "Library path: " << fs::path{ libPath }.string() ); + INFO( "Library path: " << fs::path{ libPath }.string() ) REQUIRE_NOTHROW( Bit7zLibrary{ libPath } ); } diff --git a/tests/src/test_bitabstractarchivecreator.cpp b/tests/src/test_bitabstractarchivecreator.cpp index ab85dd12..85ffffd7 100644 --- a/tests/src/test_bitabstractarchivecreator.cpp +++ b/tests/src/test_bitabstractarchivecreator.cpp @@ -10,9 +10,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include -#include -#include +#include #include "utils/shared_lib.hpp" diff --git a/tests/src/test_bitarchiveeditor.cpp b/tests/src/test_bitarchiveeditor.cpp index 2c6fc515..02dc0d4e 100644 --- a/tests/src/test_bitarchiveeditor.cpp +++ b/tests/src/test_bitarchiveeditor.cpp @@ -10,7 +10,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include +#include #include "utils/shared_lib.hpp" diff --git a/tests/src/test_bitarchiveiteminfo.cpp b/tests/src/test_bitarchiveiteminfo.cpp index c6702827..0310366a 100644 --- a/tests/src/test_bitarchiveiteminfo.cpp +++ b/tests/src/test_bitarchiveiteminfo.cpp @@ -10,9 +10,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include -#include -#include +#include #include "utils/archive.hpp" #include "utils/filesystem.hpp" diff --git a/tests/src/test_bitarchivereader.cpp b/tests/src/test_bitarchivereader.cpp index 11a854b0..98520a44 100644 --- a/tests/src/test_bitarchivereader.cpp +++ b/tests/src/test_bitarchivereader.cpp @@ -10,9 +10,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include -#include -#include +#include #include "utils/archive.hpp" #include "utils/filesystem.hpp" @@ -58,8 +56,8 @@ void require_archive_item( const BitInFormat& format, const BitArchiveItem& item, const ExpectedItem& expectedItem, const SourceLocation& location ) { - INFO( "Failed while checking archive item " << Catch::StringMaker< tstring >::convert( item.name() ) ); - INFO( " from " << location.file_name() << ":" << location.line() ); + INFO( "Failed while checking archive item " << Catch::StringMaker< tstring >::convert( item.name() ) ) + INFO( " from " << location.file_name() << ":" << location.line() ) REQUIRE( item.isDir() == ( expectedItem.fileInfo.type == fs::file_type::directory ) ); if ( !item.isDir() ) { @@ -94,8 +92,8 @@ void require_archive_item( const BitInFormat& format, inline void require_archive_content( const BitArchiveReader& info, const TestInputArchive& input, const SourceLocation& location ) { - INFO( "Failed while checking content of " << Catch::StringMaker< tstring >::convert( info.archivePath() ) ); - INFO( " from " << location.file_name() << ":" << location.line() ); + INFO( "Failed while checking content of " << Catch::StringMaker< tstring >::convert( info.archivePath() ) ) + INFO( " from " << location.file_name() << ":" << location.line() ) REQUIRE_FALSE( info.archiveProperties().empty() ); const auto& archive_content = input.content(); @@ -364,7 +362,7 @@ TEST_CASE( "BitArchiveReader: Reading metadata of multi-volume archives", "[bita DYNAMIC_SECTION( "Archive format: " << testArchive.extension() ) { const fs::path arcFileName = "clouds.jpg." + testArchive.extension() + ".001"; - INFO( "Archive file: " << arcFileName ); + INFO( "Archive file: " << arcFileName ) SECTION( "Opening as a split archive" ) { const BitArchiveReader info( test::sevenzip_lib(), arcFileName.string< tchar >(), BitFormat::Split ); @@ -522,8 +520,8 @@ void require_item_type( const BitArchiveReader& info, fs::file_type fileType, std::uint32_t winAttributes, SourceLocation location ) { - INFO( "Failed checking required item " << Catch::StringMaker< tstring >::convert( itemName ) ); - INFO( " from " << location.file_name() << ":" << location.line() ); + INFO( "Failed checking required item " << Catch::StringMaker< tstring >::convert( itemName ) ) + INFO( " from " << location.file_name() << ":" << location.line() ) auto iterator = info.find( itemName ); REQUIRE( iterator != info.cend() ); REQUIRE( iterator->name() == itemName ); diff --git a/tests/src/test_biterror.cpp b/tests/src/test_biterror.cpp index 99d24c25..dbfa4c13 100644 --- a/tests/src/test_biterror.cpp +++ b/tests/src/test_biterror.cpp @@ -10,8 +10,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include -#include +#include #include diff --git a/tests/src/test_bitexception.cpp b/tests/src/test_bitexception.cpp index 989cdb16..85202bdb 100644 --- a/tests/src/test_bitexception.cpp +++ b/tests/src/test_bitexception.cpp @@ -10,8 +10,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include -#include +#include #include #include diff --git a/tests/src/test_bitfilecompressor.cpp b/tests/src/test_bitfilecompressor.cpp index 6b80a325..2cbea815 100644 --- a/tests/src/test_bitfilecompressor.cpp +++ b/tests/src/test_bitfilecompressor.cpp @@ -10,7 +10,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include +#include #include "utils/shared_lib.hpp" diff --git a/tests/src/test_bitfileextractor.cpp b/tests/src/test_bitfileextractor.cpp index b567a11e..a76ac1b9 100644 --- a/tests/src/test_bitfileextractor.cpp +++ b/tests/src/test_bitfileextractor.cpp @@ -10,7 +10,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include +#include #include "utils/shared_lib.hpp" diff --git a/tests/src/test_bitinputarchive.cpp b/tests/src/test_bitinputarchive.cpp index bee74697..81f35608 100644 --- a/tests/src/test_bitinputarchive.cpp +++ b/tests/src/test_bitinputarchive.cpp @@ -10,12 +10,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include -#include -#include -#include -#include -#include +#include #include "utils/archive.hpp" #include "utils/crc.hpp" @@ -55,8 +50,8 @@ inline auto archive_item( const BitArchiveReader& archive, } void require_filesystem_item( const ExpectedItem& expectedItem, const SourceLocation& location ) { - INFO( "From " << location.file_name() << ":" << location.line() ); - INFO( "Failed while checking expected item: " << expectedItem.inArchivePath.u8string() ); + INFO( "From " << location.file_name() << ":" << location.line() ) + INFO( "Failed while checking expected item: " << expectedItem.inArchivePath.u8string() ) // Note: there's no need to check the file with fs::exists // since the file's type check already includes the check for the file existence. @@ -80,7 +75,7 @@ void require_filesystem_item( const ExpectedItem& expectedItem, const SourceLoca void require_extracts_to_filesystem( const BitArchiveReader& info, const ExpectedItems& expectedItems ) { TempTestDirectory testDir{ "test_bitinputarchive" }; - INFO( "Test directory: " << testDir ); + INFO( "Test directory: " << testDir ) REQUIRE_NOTHROW( info.extractTo( testDir ) ); if ( expectedItems.empty() ) { @@ -94,7 +89,7 @@ void require_extracts_to_filesystem( const BitArchiveReader& info, const Expecte void require_extracts_items_to_filesystem( const BitArchiveReader& info, const ExpectedItems& expectedItems ) { TempTestDirectory testDir{ "test_bitinputarchive" }; - INFO( "Test directory: " << testDir ); + INFO( "Test directory: " << testDir ) for ( const auto& expectedItem : expectedItems ) { const auto archiveItem = archive_item( info, expectedItem ); @@ -150,7 +145,7 @@ void require_extracts_to_buffers_map( const BitArchiveReader& info, const Expect REQUIRE_NOTHROW( info.extractTo( bufferMap ) ); REQUIRE( bufferMap.size() == info.filesCount() ); for ( const auto& expectedItem : expectedItems ) { - INFO( "Failed while checking expected item '" << expectedItem.inArchivePath.u8string() << "'" ); + INFO( "Failed while checking expected item '" << expectedItem.inArchivePath.u8string() << "'" ) const auto& extractedItem = bufferMap.find( path_to_tstring( expectedItem.inArchivePath ) ); if ( expectedItem.fileInfo.type != fs::file_type::directory ) { REQUIRE( extractedItem != bufferMap.end() ); @@ -164,7 +159,7 @@ void require_extracts_to_buffers_map( const BitArchiveReader& info, const Expect void require_extracts_to_buffers( const BitArchiveReader& info, const ExpectedItems& expectedItems ) { buffer_t outputBuffer; for ( const auto& expectedItem : expectedItems ) { - INFO( "Failed while checking expected item '" << expectedItem.inArchivePath.u8string() << "'" ); + INFO( "Failed while checking expected item '" << expectedItem.inArchivePath.u8string() << "'" ) const auto archiveItem = archive_item( info, expectedItem ); REQUIRE( archiveItem != info.cend() ); if ( archiveItem->isDir() ) { @@ -194,7 +189,7 @@ void require_extracts_to_fixed_buffers( const BitArchiveReader& info, const Expe buffer_t invalidBuffer( invalidBufferSize, static_cast< byte_t >( '\0' ) ); buffer_t outputBuffer; for ( const auto& expectedItem : expectedItems ) { - INFO( "Failed while checking expected item '" << expectedItem.inArchivePath.u8string() << "'" ); + INFO( "Failed while checking expected item '" << expectedItem.inArchivePath.u8string() << "'" ) const auto archiveItem = archive_item( info, expectedItem ); REQUIRE( archiveItem != info.cend() ); @@ -257,7 +252,7 @@ void require_extracts_to_fixed_buffers( const BitArchiveReader& info, const Expe void require_extracts_to_streams( const BitArchiveReader& info, const ExpectedItems& expectedItems ) { for ( const auto& expectedItem : expectedItems ) { - INFO( "Failed while checking expected item '" << expectedItem.inArchivePath.u8string() << "'" ); + INFO( "Failed while checking expected item '" << expectedItem.inArchivePath.u8string() << "'" ) const auto archiveItem = archive_item( info, expectedItem ); REQUIRE( archiveItem != info.cend() ); @@ -294,8 +289,8 @@ void require_archive_extracts( const BitArchiveReader& info, } #endif - INFO( "From " << location.file_name() << ":" << location.line() ); - INFO( "Failed while extracting the archive" ); + INFO( "From " << location.file_name() << ":" << location.line() ) + INFO( "Failed while extracting the archive" ) SECTION( "Extracting to a temporary filesystem folder" ) { require_extracts_to_filesystem( info, expectedItems ); @@ -333,12 +328,12 @@ void require_archive_extract_fails( const BitArchiveReader& info, const SourceLo } #endif - INFO( "From " << location.file_name() << ":" << location.line() ); - INFO( "Failed while extracting the archive" ); + INFO( "From " << location.file_name() << ":" << location.line() ) + INFO( "Failed while extracting the archive" ) SECTION( "Extracting to a temporary filesystem folder should fail" ) { TempTestDirectory testDir{ "test_bitinputarchive" }; - INFO( "Test directory: " << testDir ); + INFO( "Test directory: " << testDir ) REQUIRE_THROWS( info.extractTo( testDir ) ); // TODO: Make some guarantees on what remains after a failed extraction for ( const auto& item : fs::directory_iterator( testDir.path() ) ) { @@ -363,8 +358,8 @@ void require_archive_extract_fails( const BitArchiveReader& info, const SourceLo require_archive_extract_fails( info, BIT7Z_CURRENT_LOCATION ) void require_archive_tests( const BitArchiveReader& info, const SourceLocation& location ) { - INFO( "From " << location.file_name() << ":" << location.line() ); - INFO( "Failed while testing the archive" ); + INFO( "From " << location.file_name() << ":" << location.line() ) + INFO( "Failed while testing the archive" ) #ifdef BIT7Z_BUILD_FOR_P7ZIP const auto& detectedFormat = (info).detectedFormat(); if ( detectedFormat == BitFormat::Rar || detectedFormat == BitFormat::Rar5 ) { @@ -575,7 +570,7 @@ TEST_CASE( "BitInputArchive: Testing and extracting multi-volume archives", "[bi const auto wholeArcFileName = std::string{ "clouds.jpg." } + testFormat.extension; const fs::path splitArcFileName = wholeArcFileName + ".001"; - INFO( "Archive file: " << splitArcFileName ); + INFO( "Archive file: " << splitArcFileName ) SECTION( "Opening as a split archive" ) { const BitArchiveReader info( test::sevenzip_lib(), @@ -960,7 +955,7 @@ TEMPLATE_TEST_CASE( "BitInputArchive: Extracting an archive using various Overwr BitArchiveReader info( test::sevenzip_lib(), inputArchive, testFormat.format ); TempTestDirectory testOutDir{ "test_bitinputarchive" }; - INFO( "Output directory: " << testOutDir ); + INFO( "Output directory: " << testOutDir ) const auto expectedFile = overwritten_file_path< TestType >( testFormat.format ); REQUIRE_FALSE( fs::exists( expectedFile ) ); @@ -1067,7 +1062,7 @@ TEMPLATE_TEST_CASE( "BitInputArchive: Extracting an archive to the filesystem sh #endif TempTestDirectory testOutDir{ "test_bitinputarchive" }; - INFO( "Output directory: " << testOutDir ); + INFO( "Output directory: " << testOutDir ) REQUIRE_NOTHROW( info.extractTo( testOutDir ) ); @@ -1133,7 +1128,7 @@ TEMPLATE_TEST_CASE( "BitInputArchive: Extracting an archive not having time meta REQUIRE( expectedModifiedTime.dwHighDateTime != 0 ); TempTestDirectory testOutDir{ "test_bitinputarchive" }; - INFO( "Output directory: " << testOutDir ); + INFO( "Output directory: " << testOutDir ) REQUIRE_NOTHROW( info.extractTo( testOutDir ) ); @@ -1160,7 +1155,7 @@ TEMPLATE_TEST_CASE( "BitInputArchive: Extracting a file with a comment should pr BitArchiveReader info( test::sevenzip_lib(), inputArchive, BitFormat::SevenZip ); TempTestDirectory testOutDir{ "test_bitinputarchive" }; - INFO( "Output directory: " << testOutDir ); + INFO( "Output directory: " << testOutDir ) REQUIRE_NOTHROW( info.extractTo( testOutDir ) ); @@ -1233,7 +1228,7 @@ TEMPLATE_TEST_CASE( "BitInputArchive: Using extraction callbacks", "[bitinputarc SECTION( "When extracting to the filesystem" ) { TempTestDirectory testOutDir{ "test_bitinputarchive" }; - INFO( "Output directory: " << testOutDir ); + INFO( "Output directory: " << testOutDir ) require_extracts_to_filesystem( info, expectedItems ); } @@ -1260,19 +1255,14 @@ TEMPLATE_TEST_CASE( "BitInputArchive: Using extraction callbacks", "[bitinputarc // For some reason, the Tar format makes the progress decrease in some cases, // and it is not always less than the total size ¯\_(ツ)_/¯. if ( testArchive.format != BitFormat::Tar ) { - // Checking that the values reported by the progress callback are increasing. + // Checking that the values reported by the progress callback are increasing, + // and less than or equal to the total size. uint64_t lastProgress = 0; - REQUIRE_THAT( progressValues, - AllMatch( Predicate< uint64_t >( [ &lastProgress ]( uint64_t progress ) -> bool { - const bool result = progress >= lastProgress; - lastProgress = progress; - return result; - } ) ) ); - - // Checking that all the values reported by the progress callback ar less than or equal to the total size. - REQUIRE_THAT( progressValues, AllMatch( Predicate< uint64_t >( [ &totalSize ]( uint64_t progress ) -> bool { - return progress <= totalSize; - } ) ) ); + for ( uint64_t progress : progressValues ) { + REQUIRE( progress >= lastProgress ); + REQUIRE( progress <= totalSize ); + lastProgress = progress; + } // TODO: Fix 7-Zip not calling the progress callback on last extracted block in these formats if ( testArchive.format != BitFormat::Iso && testArchive.format != BitFormat::Rar5 ) { diff --git a/tests/src/test_bititemsvector.cpp b/tests/src/test_bititemsvector.cpp index 8b879820..aa7f09df 100644 --- a/tests/src/test_bititemsvector.cpp +++ b/tests/src/test_bititemsvector.cpp @@ -10,9 +10,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include -#include -#include +#include #include "utils/filesystem.hpp" diff --git a/tests/src/test_bitmemcompressor.cpp b/tests/src/test_bitmemcompressor.cpp index 6354e567..5a86db7d 100644 --- a/tests/src/test_bitmemcompressor.cpp +++ b/tests/src/test_bitmemcompressor.cpp @@ -10,7 +10,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include +#include #include "utils/shared_lib.hpp" diff --git a/tests/src/test_bitmemextractor.cpp b/tests/src/test_bitmemextractor.cpp index 101666ce..0c6042b8 100644 --- a/tests/src/test_bitmemextractor.cpp +++ b/tests/src/test_bitmemextractor.cpp @@ -10,7 +10,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include +#include #include "utils/shared_lib.hpp" diff --git a/tests/src/test_bitoutputarchive.cpp b/tests/src/test_bitoutputarchive.cpp index 40fb6cc1..24350403 100644 --- a/tests/src/test_bitoutputarchive.cpp +++ b/tests/src/test_bitoutputarchive.cpp @@ -10,9 +10,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include -#include -#include +#include #include "utils/archive.hpp" #include "utils/shared_lib.hpp" diff --git a/tests/src/test_bitpropvariant.cpp b/tests/src/test_bitpropvariant.cpp index 04337302..0e25a5ba 100644 --- a/tests/src/test_bitpropvariant.cpp +++ b/tests/src/test_bitpropvariant.cpp @@ -10,9 +10,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include -#include -#include +#include #include #include diff --git a/tests/src/test_bitstreamcompressor.cpp b/tests/src/test_bitstreamcompressor.cpp index 956ef140..f4ade9c2 100644 --- a/tests/src/test_bitstreamcompressor.cpp +++ b/tests/src/test_bitstreamcompressor.cpp @@ -10,7 +10,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include +#include #include "utils/shared_lib.hpp" diff --git a/tests/src/test_bitstreamextractor.cpp b/tests/src/test_bitstreamextractor.cpp index 6d02e997..92d943b8 100644 --- a/tests/src/test_bitstreamextractor.cpp +++ b/tests/src/test_bitstreamextractor.cpp @@ -10,7 +10,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include +#include #include "utils/shared_lib.hpp" diff --git a/tests/src/test_cbufferinstream.cpp b/tests/src/test_cbufferinstream.cpp index 1581787f..cad5847e 100644 --- a/tests/src/test_cbufferinstream.cpp +++ b/tests/src/test_cbufferinstream.cpp @@ -10,8 +10,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include -#include +#include #include #include @@ -163,7 +162,7 @@ TEST_CASE( "CBufferInStream: Seeking a buffer stream with no content", "[cbuffer SECTION( "Seeking from the midpoint of the stream" ) { // First, we seek to the midpoint of the stream const Int64 midOffset = static_cast< Int64 >( bufferSize ) / 2; - INFO( "Middle offset value: " << midOffset ); + INFO( "Middle offset value: " << midOffset ) REQUIRE( inStream.Seek( midOffset, STREAM_SEEK_SET, nullptr ) == S_OK ); REQUIRE( inStream.Seek( 0, STREAM_SEEK_CUR, &newPosition ) == S_OK ); REQUIRE( newPosition == midOffset ); diff --git a/tests/src/test_dateutil.cpp b/tests/src/test_dateutil.cpp index 91ef50a7..fd3fd499 100644 --- a/tests/src/test_dateutil.cpp +++ b/tests/src/test_dateutil.cpp @@ -10,8 +10,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include -#include +#include #include diff --git a/tests/src/test_formatdetect.cpp b/tests/src/test_formatdetect.cpp index f6483386..15dfc11e 100644 --- a/tests/src/test_formatdetect.cpp +++ b/tests/src/test_formatdetect.cpp @@ -12,8 +12,7 @@ #ifdef BIT7Z_AUTO_FORMAT -#include -#include +#include #include "utils/format.hpp" #include "utils/filesystem.hpp" diff --git a/tests/src/test_fsutil.cpp b/tests/src/test_fsutil.cpp index 01c135c3..1751be27 100644 --- a/tests/src/test_fsutil.cpp +++ b/tests/src/test_fsutil.cpp @@ -10,7 +10,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include +#include #include "utils/filesystem.hpp" diff --git a/tests/src/test_stringutil.cpp b/tests/src/test_stringutil.cpp index cc78c25a..579847bf 100644 --- a/tests/src/test_stringutil.cpp +++ b/tests/src/test_stringutil.cpp @@ -10,8 +10,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include -#include +#include #include diff --git a/tests/src/test_util.cpp b/tests/src/test_util.cpp index 6ee4598c..d7489f41 100644 --- a/tests/src/test_util.cpp +++ b/tests/src/test_util.cpp @@ -10,8 +10,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include -#include +#include #include #include diff --git a/tests/src/test_windows.cpp b/tests/src/test_windows.cpp index d5e55b68..a96e7872 100644 --- a/tests/src/test_windows.cpp +++ b/tests/src/test_windows.cpp @@ -12,8 +12,7 @@ #ifndef _WIN32 -#include -#include +#include #include #include diff --git a/tests/src/utils/filesystem.cpp b/tests/src/utils/filesystem.cpp index 503818e4..0a666644 100644 --- a/tests/src/utils/filesystem.cpp +++ b/tests/src/utils/filesystem.cpp @@ -10,7 +10,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include +#include #include @@ -329,7 +329,7 @@ auto random_test_id() -> std::string { static constexpr auto hex_digits = "0123456789abcdef"; static constexpr auto hex_count = 16; - thread_local static std::default_random_engine random_engine{ Catch::getSeed() }; + thread_local static std::default_random_engine random_engine{ Catch::rngSeed() }; thread_local static std::uniform_int_distribution<> distribution{ 0, hex_count - 1 }; std::string str( 8, '\0' );