浏览代码

Class name typo fixed (#147).

main
offa 6 年前
父节点
当前提交
21383753f9
共有 2 个文件被更改,包括 8 次插入8 次删除
  1. +6
    -6
      test/CallMocks.h
  2. +2
    -2
      test/UniqueResourceTest.cpp

+ 6
- 6
test/CallMocks.h 查看文件

@@ -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 查看文件

@@ -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]")

正在加载...
取消
保存