(third_party deps) fix #177, update bundled spdlog to 1.6.0
This commit is contained in:
10
third_party/spdlog/tests/test_file_helper.cpp
vendored
10
third_party/spdlog/tests/test_file_helper.cpp
vendored
@ -4,9 +4,6 @@
|
||||
#include "includes.h"
|
||||
|
||||
using spdlog::details::file_helper;
|
||||
using spdlog::details::log_msg;
|
||||
|
||||
static const std::string target_filename = "test_logs/file_helper_test.txt";
|
||||
|
||||
static void write_with_helper(file_helper &helper, size_t howmany)
|
||||
{
|
||||
@ -21,6 +18,7 @@ TEST_CASE("file_helper_filename", "[file_helper::filename()]]")
|
||||
prepare_logdir();
|
||||
|
||||
file_helper helper;
|
||||
std::string target_filename = "test_logs/file_helper_test.txt";
|
||||
helper.open(target_filename);
|
||||
REQUIRE(helper.filename() == target_filename);
|
||||
}
|
||||
@ -28,6 +26,7 @@ TEST_CASE("file_helper_filename", "[file_helper::filename()]]")
|
||||
TEST_CASE("file_helper_size", "[file_helper::size()]]")
|
||||
{
|
||||
prepare_logdir();
|
||||
std::string target_filename = "test_logs/file_helper_test.txt";
|
||||
size_t expected_size = 123;
|
||||
{
|
||||
file_helper helper;
|
||||
@ -41,6 +40,7 @@ TEST_CASE("file_helper_size", "[file_helper::size()]]")
|
||||
TEST_CASE("file_helper_reopen", "[file_helper::reopen()]]")
|
||||
{
|
||||
prepare_logdir();
|
||||
std::string target_filename = "test_logs/file_helper_test.txt";
|
||||
file_helper helper;
|
||||
helper.open(target_filename);
|
||||
write_with_helper(helper, 12);
|
||||
@ -52,6 +52,7 @@ TEST_CASE("file_helper_reopen", "[file_helper::reopen()]]")
|
||||
TEST_CASE("file_helper_reopen2", "[file_helper::reopen(false)]]")
|
||||
{
|
||||
prepare_logdir();
|
||||
std::string target_filename = "test_logs/file_helper_test.txt";
|
||||
size_t expected_size = 14;
|
||||
file_helper helper;
|
||||
helper.open(target_filename);
|
||||
@ -71,7 +72,8 @@ static void test_split_ext(const char *fname, const char *expect_base, const cha
|
||||
std::replace(filename.begin(), filename.end(), '/', '\\');
|
||||
std::replace(expected_base.begin(), expected_base.end(), '/', '\\');
|
||||
#endif
|
||||
spdlog::filename_t basename, ext;
|
||||
spdlog::filename_t basename;
|
||||
spdlog::filename_t ext;
|
||||
std::tie(basename, ext) = file_helper::split_by_extension(filename);
|
||||
REQUIRE(basename == expected_base);
|
||||
REQUIRE(ext == expected_ext);
|
||||
|
Reference in New Issue
Block a user