diff options
| author | William A. Kennington III <wak@google.com> | 2018-07-23 09:46:18 -0700 |
|---|---|---|
| committer | William A. Kennington III <wak@google.com> | 2018-07-23 09:47:01 -0700 |
| commit | 86be5dd8a02c3abf685f6313213c9356b7b1708d (patch) | |
| tree | 9674b47ce696a3d36fcb2e45b7b1054abc6553a4 /test/source/event.cpp | |
| parent | eaf815f7cf7d3f22028e55227d2147a722fde590 (diff) | |
| download | sdeventplus-86be5dd8a02c3abf685f6313213c9356b7b1708d.tar.gz sdeventplus-86be5dd8a02c3abf685f6313213c9356b7b1708d.zip | |
source/event: Rename Event to EventBase
Diffstat (limited to 'test/source/event.cpp')
| -rw-r--r-- | test/source/event.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/test/source/event.cpp b/test/source/event.cpp index bfd26c3..90edaec 100644 --- a/test/source/event.cpp +++ b/test/source/event.cpp @@ -23,8 +23,7 @@ using testing::Return; using testing::SaveArg; using testing::SetArgPointee; -using UniqueEvent = std::unique_ptr<sdeventplus::Event, - std::function<void(sdeventplus::Event*)>>; +using UniqueEvent = std::unique_ptr<Event, std::function<void(Event*)>>; class EventTest : public testing::Test { @@ -37,13 +36,12 @@ class EventTest : public testing::Test UniqueEvent make_event(sd_event* event) { - auto deleter = [this, event](sdeventplus::Event* e) { + auto deleter = [this, event](Event* e) { EXPECT_CALL(this->mock, sd_event_unref(event)) .WillOnce(Return(nullptr)); delete e; }; - return UniqueEvent( - new sdeventplus::Event(event, std::false_type(), &mock), deleter); + return UniqueEvent(new Event(event, std::false_type(), &mock), deleter); } void expect_destruct() @@ -74,7 +72,9 @@ TEST_F(EventTest, DeferConstruct) .WillOnce(DoAll(SetArgPointee<1>(expected_source), SaveArg<2>(&handler), Return(0))); int completions = 0; - Event::Callback callback = [&completions](Event&) { completions++; }; + EventBase::Callback callback = [&completions](EventBase&) { + completions++; + }; Defer defer(*event, std::move(callback)); EXPECT_EQ(&defer, userdata); EXPECT_FALSE(callback); @@ -99,7 +99,9 @@ TEST_F(EventTest, PostConstruct) .WillOnce(DoAll(SetArgPointee<1>(expected_source), SaveArg<2>(&handler), Return(0))); int completions = 0; - Event::Callback callback = [&completions](Event&) { completions++; }; + EventBase::Callback callback = [&completions](EventBase&) { + completions++; + }; Post post(*event, std::move(callback)); EXPECT_EQ(&post, userdata); EXPECT_FALSE(callback); @@ -124,7 +126,9 @@ TEST_F(EventTest, ExitConstruct) .WillOnce(DoAll(SetArgPointee<1>(expected_source), SaveArg<2>(&handler), Return(0))); int completions = 0; - Event::Callback callback = [&completions](Event&) { completions++; }; + EventBase::Callback callback = [&completions](EventBase&) { + completions++; + }; Exit exit(*event, std::move(callback)); EXPECT_EQ(&exit, userdata); EXPECT_FALSE(callback); @@ -142,7 +146,9 @@ TEST_F(EventTest, ConstructFailure) nullptr)) .WillOnce(Return(-EINVAL)); int completions = 0; - Event::Callback callback = [&completions](Event&) { completions++; }; + EventBase::Callback callback = [&completions](EventBase&) { + completions++; + }; EXPECT_THROW(Defer(*event, std::move(callback)), SdEventError); EXPECT_TRUE(callback); EXPECT_EQ(0, completions); |

