offa 7 anni fa
parent
commit
7ea1aa7439
1 ha cambiato i file con 8 aggiunte e 7 eliminazioni
  1. +8
    -7
      test/UniqueResourceTest.cpp

+ 8
- 7
test/UniqueResourceTest.cpp Vedi File

@@ -38,7 +38,9 @@ namespace

struct ThrowOnCopyMock
{
ThrowOnCopyMock() { }
ThrowOnCopyMock()
{
}

ThrowOnCopyMock(const ThrowOnCopyMock&) noexcept(false)
{
@@ -47,7 +49,6 @@ namespace

ThrowOnCopyMock(ThrowOnCopyMock&&) = delete;

MAKE_CONST_MOCK1(deleter, void(ThrowOnCopyMock));

ThrowOnCopyMock& operator=(const ThrowOnCopyMock&) noexcept(false)
{
@@ -60,20 +61,20 @@ namespace

struct NotNothrowMoveMock
{
NotNothrowMoveMock(CallMock* mo) : m_mock(mo) { }
NotNothrowMoveMock(CallMock* mo) : m_mock(mo)
{
}

NotNothrowMoveMock(const NotNothrowMoveMock& other) : m_mock(other.m_mock)
{
throw std::exception{};
}

NotNothrowMoveMock(NotNothrowMoveMock&& other) noexcept(false) : m_mock(other.m_mock) { }

void operator()(Handle h) const
NotNothrowMoveMock(NotNothrowMoveMock&& other) noexcept(false) : m_mock(other.m_mock)
{
m_mock->deleter(h);
}


NotNothrowMoveMock& operator=(const NotNothrowMoveMock&)
{
throw "Not implemented";

Loading…
Annulla
Salva