Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
spdlog
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
spdlog
Commits
989a10e4
Commit
989a10e4
authored
Jul 21, 2018
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added async test to tests
parent
41d248f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
tests/test_async.cpp
tests/test_async.cpp
+20
-0
No files found.
tests/test_async.cpp
View file @
989a10e4
...
@@ -40,6 +40,26 @@ TEST_CASE("discard policy ", "[async]")
...
@@ -40,6 +40,26 @@ TEST_CASE("discard policy ", "[async]")
REQUIRE
(
test_sink
->
msg_counter
()
<
messages
);
REQUIRE
(
test_sink
->
msg_counter
()
<
messages
);
}
}
TEST_CASE
(
"discard policy using factory "
,
"[async]"
)
{
using
namespace
spdlog
;
//auto test_sink = std::make_shared<sinks::test_sink_mt>();
size_t
queue_size
=
2
;
size_t
messages
=
1024
;
{
//auto tp = std::make_shared<details::thread_pool>(queue_size, 1);
auto
logger
=
spdlog
::
create_async_nb
<
sinks
::
test_sink_mt
>
(
"as2"
);
for
(
size_t
i
=
0
;
i
<
messages
;
i
++
)
{
logger
->
info
(
"Hello message #{}"
,
i
);
}
auto
sink
=
std
::
static_pointer_cast
<
sinks
::
test_sink_mt
>
(
logger
->
sinks
()[
0
]);
REQUIRE
(
sink
->
msg_counter
()
<
messages
);
}
}
TEST_CASE
(
"flush"
,
"[async]"
)
TEST_CASE
(
"flush"
,
"[async]"
)
{
{
using
namespace
spdlog
;
using
namespace
spdlog
;
...
...
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