Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
spdlog
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
spdlog
Commits
7663f583
Commit
7663f583
authored
Dec 22, 2017
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed file_helper::split_by_extenstion tests for gcc
parent
8e3f968b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
22 deletions
+23
-22
file_helper.cpp
tests/file_helper.cpp
+23
-22
No files found.
tests/file_helper.cpp
View file @
7663f583
...
...
@@ -75,8 +75,11 @@ TEST_CASE("file_helper_reopen2", "[file_helper::reopen(false)]]")
static
void
test_split_ext
(
spdlog
::
filename_t
&
filename
,
spdlog
::
filename_t
&
expected_base
,
spdlog
::
filename_t
&
expected
_ext
)
static
void
test_split_ext
(
const
char
*
fname
,
const
char
*
expect_base
,
const
char
*
expect
_ext
)
{
spdlog
::
filename_t
filename
(
fname
);
spdlog
::
filename_t
expected_base
(
expect_base
);
spdlog
::
filename_t
expected_ext
(
expect_ext
);
#ifdef _WIN32 // replace folder sep
std
::
replace
(
filename
.
begin
(),
filename
.
end
(),
'/'
,
'\\'
);
...
...
@@ -90,27 +93,25 @@ static void test_split_ext(spdlog::filename_t& filename, spdlog::filename_t & ex
TEST_CASE
(
"file_helper_split_by_extenstion"
,
"[file_helper::split_by_extenstion()]]"
)
{
using
file_t
=
spdlog
::
filename_t
;
test_split_ext
(
file_t
(
"mylog.txt"
),
file_t
(
"mylog"
),
file_t
(
".txt"
));
test_split_ext
(
file_t
(
".mylog.txt"
),
file_t
(
".mylog"
),
file_t
(
".txt"
));
test_split_ext
(
file_t
(
".mylog"
),
file_t
(
".mylog"
),
file_t
(
""
));
test_split_ext
(
file_t
(
"/aaa/bb.d/mylog"
),
file_t
(
"/aaa/bb.d/mylog"
),
file_t
(
""
));
test_split_ext
(
file_t
(
"/aaa/bb.d/mylog.txt"
),
file_t
(
"/aaa/bb.d/mylog"
),
file_t
(
".txt"
));
test_split_ext
(
file_t
(
"aaa/bbb/ccc/mylog.txt"
),
file_t
(
"aaa/bbb/ccc/mylog"
),
file_t
(
".txt"
));
test_split_ext
(
file_t
(
"aaa/bbb/ccc/mylog."
),
file_t
(
"aaa/bbb/ccc/mylog."
),
file_t
(
""
));
test_split_ext
(
file_t
(
"aaa/bbb/ccc/.mylog.txt"
),
file_t
(
"aaa/bbb/ccc/.mylog"
),
file_t
(
".txt"
));
test_split_ext
(
file_t
(
"/aaa/bbb/ccc/mylog.txt"
),
file_t
(
"/aaa/bbb/ccc/mylog"
),
file_t
(
".txt"
));
test_split_ext
(
file_t
(
"/aaa/bbb/ccc/.mylog"
),
file_t
(
"/aaa/bbb/ccc/.mylog"
),
file_t
(
""
));
test_split_ext
(
file_t
(
"../mylog.txt"
),
file_t
(
"../mylog"
),
file_t
(
".txt"
));
test_split_ext
(
file_t
(
".././mylog.txt"
),
file_t
(
".././mylog"
),
file_t
(
".txt"
));
test_split_ext
(
file_t
(
".././mylog.txt/xxx"
),
file_t
(
".././mylog.txt/xxx"
),
file_t
(
""
));
test_split_ext
(
file_t
(
"/mylog.txt"
),
file_t
(
"/mylog"
),
file_t
(
".txt"
));
test_split_ext
(
file_t
(
"//mylog.txt"
),
file_t
(
"//mylog"
),
file_t
(
".txt"
));
test_split_ext
(
file_t
(
""
),
file_t
(
""
),
file_t
(
""
));
test_split_ext
(
file_t
(
"."
),
file_t
(
"."
),
file_t
(
""
));
test_split_ext
(
file_t
(
"..txt"
),
file_t
(
"."
),
file_t
(
".txt"
));
{
test_split_ext
(
"mylog.txt"
,
"mylog"
,
".txt"
);
test_split_ext
(
".mylog.txt"
,
".mylog"
,
".txt"
);
test_split_ext
(
".mylog"
,
".mylog"
,
""
);
test_split_ext
(
"/aaa/bb.d/mylog"
,
"/aaa/bb.d/mylog"
,
""
);
test_split_ext
(
"/aaa/bb.d/mylog.txt"
,
"/aaa/bb.d/mylog"
,
".txt"
);
test_split_ext
(
"aaa/bbb/ccc/mylog.txt"
,
"aaa/bbb/ccc/mylog"
,
".txt"
);
test_split_ext
(
"aaa/bbb/ccc/mylog."
,
"aaa/bbb/ccc/mylog."
,
""
);
test_split_ext
(
"aaa/bbb/ccc/.mylog.txt"
,
"aaa/bbb/ccc/.mylog"
,
".txt"
);
test_split_ext
(
"/aaa/bbb/ccc/mylog.txt"
,
"/aaa/bbb/ccc/mylog"
,
".txt"
);
test_split_ext
(
"/aaa/bbb/ccc/.mylog"
,
"/aaa/bbb/ccc/.mylog"
,
""
);
test_split_ext
(
"../mylog.txt"
,
"../mylog"
,
".txt"
);
test_split_ext
(
".././mylog.txt"
,
".././mylog"
,
".txt"
);
test_split_ext
(
".././mylog.txt/xxx"
,
".././mylog.txt/xxx"
,
""
);
test_split_ext
(
"/mylog.txt"
,
"/mylog"
,
".txt"
);
test_split_ext
(
"//mylog.txt"
,
"//mylog"
,
".txt"
);
test_split_ext
(
""
,
""
,
""
);
test_split_ext
(
"."
,
"."
,
""
);
test_split_ext
(
"..txt"
,
"."
,
".txt"
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment