Ver código fonte

Test naming updated (fixes #60).

main
offa 7 anos atrás
pai
commit
a75bc2df64
3 arquivos alterados com 16 adições e 16 exclusões
  1. +4
    -4
      test/ScopeExitTest.cpp
  2. +6
    -6
      test/ScopeFailTest.cpp
  3. +6
    -6
      test/ScopeSuccessTest.cpp

+ 4
- 4
test/ScopeExitTest.cpp Ver arquivo

@@ -91,14 +91,14 @@ namespace
}


TEST_CASE("deleter called on destruction", "[ScopeExit]")
TEST_CASE("exit function called on destruction", "[ScopeExit]")
{
REQUIRE_CALL(m, deleter());
auto guard = sr::make_scope_exit(deleter);
static_cast<void>(guard);
}

TEST_CASE("deleter lambda called on destruction", "[ScopeExit]")
TEST_CASE("exit function lambda called on destruction", "[ScopeExit]")
{
CallMock cm;
REQUIRE_CALL(cm, deleter());
@@ -106,7 +106,7 @@ TEST_CASE("deleter lambda called on destruction", "[ScopeExit]")
static_cast<void>(guard);
}

TEST_CASE("deleter called and rethrow on copy exception", "[ScopeExit]")
TEST_CASE("exit function called and rethrow on copy exception", "[ScopeExit]")
{
REQUIRE_THROWS([] {
const ThrowOnCopyMock noMove;
@@ -116,7 +116,7 @@ TEST_CASE("deleter called and rethrow on copy exception", "[ScopeExit]")
}());
}

TEST_CASE("deleter is not called if released", "[ScopeExit]")
TEST_CASE("exit function is not called if released", "[ScopeExit]")
{
REQUIRE_CALL(m, deleter()).TIMES(0);
auto guard = sr::make_scope_exit(deleter);

+ 6
- 6
test/ScopeFailTest.cpp Ver arquivo

@@ -91,14 +91,14 @@ namespace
}


TEST_CASE("deleter called on destruction", "[ScopeFail]")
TEST_CASE("exit function called on destruction", "[ScopeFail]")
{
REQUIRE_CALL(m, deleter()).TIMES(0);
auto guard = sr::make_scope_fail(deleter);
static_cast<void>(guard);
}

TEST_CASE("deleter lambda called on destruction", "[ScopeFail]")
TEST_CASE("exit function lambda called on destruction", "[ScopeFail]")
{
CallMock cm;
REQUIRE_CALL(cm, deleter()).TIMES(0);
@@ -106,7 +106,7 @@ TEST_CASE("deleter lambda called on destruction", "[ScopeFail]")
static_cast<void>(guard);
}

TEST_CASE("deleter called and rethrow on copy exception", "[ScopeFail]")
TEST_CASE("exit function called and rethrow on copy exception", "[ScopeFail]")
{
REQUIRE_THROWS([] {
const ThrowOnCopyMock noMove;
@@ -116,7 +116,7 @@ TEST_CASE("deleter called and rethrow on copy exception", "[ScopeFail]")
}());
}

TEST_CASE("deleter is not called if released", "[ScopeFail]")
TEST_CASE("exit function is not called if released", "[ScopeFail]")
{
REQUIRE_CALL(m, deleter()).TIMES(0);
auto guard = sr::make_scope_fail(deleter);
@@ -157,7 +157,7 @@ TEST_CASE("move transfers state if released", "[ScopeFail]")
static_cast<void>(guard);
}

TEST_CASE("deleter called on exception", "[ScopeFail]")
TEST_CASE("exit function called on exception", "[ScopeFail]")
{
try
{
@@ -171,7 +171,7 @@ TEST_CASE("deleter called on exception", "[ScopeFail]")
}
}

TEST_CASE("deleter not called on pending exception", "[ScopeFail]")
TEST_CASE("exit function not called on pending exception", "[ScopeFail]")
{
try
{

+ 6
- 6
test/ScopeSuccessTest.cpp Ver arquivo

@@ -91,14 +91,14 @@ namespace
}


TEST_CASE("deleter called on destruction", "[ScopeSuccess]")
TEST_CASE("exit function called on destruction", "[ScopeSuccess]")
{
REQUIRE_CALL(m, deleter());
auto guard = sr::make_scope_success(deleter);
static_cast<void>(guard);
}

TEST_CASE("deleter lambda called on destruction", "[ScopeSuccess]")
TEST_CASE("exit function lambda called on destruction", "[ScopeSuccess]")
{
CallMock cm;
REQUIRE_CALL(cm, deleter());
@@ -106,7 +106,7 @@ TEST_CASE("deleter lambda called on destruction", "[ScopeSuccess]")
static_cast<void>(guard);
}

TEST_CASE("deleter not called and rethrow on copy exception", "[ScopeSuccess]")
TEST_CASE("exit function not called and rethrow on copy exception", "[ScopeSuccess]")
{
REQUIRE_THROWS([] {
const ThrowOnCopyMock noMove;
@@ -114,7 +114,7 @@ TEST_CASE("deleter not called and rethrow on copy exception", "[ScopeSuccess]")
}());
}

TEST_CASE("deleter is not called if released", "[ScopeSuccess]")
TEST_CASE("exit function is not called if released", "[ScopeSuccess]")
{
REQUIRE_CALL(m, deleter()).TIMES(0);
auto guard = sr::make_scope_success(deleter);
@@ -155,7 +155,7 @@ TEST_CASE("move transfers state if released", "[ScopeSuccess]")
static_cast<void>(guard);
}

TEST_CASE("deleter not called on exception", "[ScopeFail]")
TEST_CASE("exit function not called on exception", "[ScopeFail]")
{
try
{
@@ -168,7 +168,7 @@ TEST_CASE("deleter not called on exception", "[ScopeFail]")
}
}

TEST_CASE("deleter called on pending exception", "[ScopeFail]")
TEST_CASE("exit function called on pending exception", "[ScopeFail]")
{
try
{

Carregando…
Cancelar
Salvar