Skip to content

Commit 01cc5c6

Browse files
committed
Silence warnings about unused variables in the tests
1 parent e3d8fcb commit 01cc5c6

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

tests/constructors.cpp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
#include "catch.hpp"
22
#include "function_ref.hpp"
33

4-
void foo(){}
5-
struct bar {
6-
void baz(){}
4+
void foo() {}
5+
struct bar
6+
{
7+
void baz() {}
78
};
89

9-
TEST_CASE("Constructors", "[constructors]") {
10-
tl::function_ref<void(void)> fr1 = []{};
10+
TEST_CASE("Constructors", "[constructors]")
11+
{
12+
tl::function_ref<void(void)> fr1 = [] {};
1113
tl::function_ref<void(void)> fr2 = foo;
1214
tl::function_ref<void(bar)> fr3 = &bar::baz;
15+
16+
// Silence warnings
17+
(void)fr1;
18+
(void)fr2;
19+
(void)fr3;
1320
}

tests/issues.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "function_ref.hpp"
33

44
TEST_CASE("Issue #2") {
5-
const auto lam = [](int x) {};
5+
const auto lam = [](int ) {};
66
tl::function_ref<void(int)> ref = lam;
7+
(void)ref;
78
}

0 commit comments

Comments
 (0)