Browse Source

Class name typo fixed (#147).

main
offa 6 years ago
parent
commit
21383753f9
2 changed files with 8 additions and 8 deletions
  1. +6
    -6
      test/CallMocks.h
  2. +2
    -2
      test/UniqueResourceTest.cpp

+ 6
- 6
test/CallMocks.h View File

@@ -98,14 +98,14 @@ namespace mock
};


struct ConditialThrowOnCopyMock
struct ConditionalThrowOnCopyMock
{
explicit ConditialThrowOnCopyMock(Handle h, bool throwOnCopyMock) : handle(h),
explicit ConditionalThrowOnCopyMock(Handle h, bool throwOnCopyMock) : handle(h),
shouldThrow(throwOnCopyMock)
{
}

ConditialThrowOnCopyMock(const ConditialThrowOnCopyMock& other) : handle(other.handle),
ConditionalThrowOnCopyMock(const ConditionalThrowOnCopyMock& other) : handle(other.handle),
shouldThrow(other.shouldThrow)
{
if( shouldThrow == true )
@@ -114,9 +114,9 @@ namespace mock
}
}

ConditialThrowOnCopyMock(ConditialThrowOnCopyMock&&) = default;
ConditionalThrowOnCopyMock(ConditionalThrowOnCopyMock&&) = default;

ConditialThrowOnCopyMock& operator=(const ConditialThrowOnCopyMock& other)
ConditionalThrowOnCopyMock& operator=(const ConditionalThrowOnCopyMock& other)
{
if( &other != this )
{
@@ -132,7 +132,7 @@ namespace mock
return *this;
}

ConditialThrowOnCopyMock& operator=(ConditialThrowOnCopyMock&&) = default;
ConditionalThrowOnCopyMock& operator=(ConditionalThrowOnCopyMock&&) = default;


Handle handle;

+ 2
- 2
test/UniqueResourceTest.cpp View File

@@ -149,8 +149,8 @@ TEST_CASE("reset handles exception on assignment", "[UniqueResource]")
REQUIRE_CALL(m, deleter(3));
REQUIRE_CALL(m, deleter(7));
auto d = [](const auto& v) { deleter(v.handle); };
auto guard = sr::unique_resource{ConditialThrowOnCopyMock{3, false}, d};
guard.reset(ConditialThrowOnCopyMock{7, true});
auto guard = sr::unique_resource{ConditionalThrowOnCopyMock{3, false}, d};
guard.reset(ConditionalThrowOnCopyMock{7, true});
}

TEST_CASE("release disables deleter", "[UniqueResource]")

Loading…
Cancel
Save