summaryrefslogtreecommitdiffstats
path: root/test/source/base.cpp
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2018-07-17 14:40:14 -0700
committerWilliam A. Kennington III <wak@google.com>2018-07-17 14:40:14 -0700
commit7c24e05704497d7bbf99b18cfd19b0a591ed29ef (patch)
treea2d5f4103553694c4b73db324b4ca86de927b1a4 /test/source/base.cpp
parent715c72f8b9c45edc27fa2a4b0f3d5f2b0e0eefec (diff)
downloadsdeventplus-7c24e05704497d7bbf99b18cfd19b0a591ed29ef.tar.gz
sdeventplus-7c24e05704497d7bbf99b18cfd19b0a591ed29ef.zip
source/base: Only disable the event if it exists
This shouldn't happen in practice but will be needed to supporting moving.
Diffstat (limited to 'test/source/base.cpp')
-rw-r--r--test/source/base.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/source/base.cpp b/test/source/base.cpp
index 3b6a63f..c9b248f 100644
--- a/test/source/base.cpp
+++ b/test/source/base.cpp
@@ -93,6 +93,16 @@ TEST_F(BaseTest, NewBaseNoRef)
EXPECT_CALL(mock, sd_event_unref(expected_event)).WillOnce(Return(nullptr));
}
+TEST_F(BaseTest, NoSource)
+{
+ EXPECT_CALL(mock, sd_event_ref(expected_event))
+ .WillOnce(Return(expected_event));
+ BaseImpl source(*event, nullptr, std::false_type());
+
+ EXPECT_CALL(mock, sd_event_source_unref(nullptr)).WillOnce(Return(nullptr));
+ EXPECT_CALL(mock, sd_event_unref(expected_event)).WillOnce(Return(nullptr));
+}
+
class BaseMethodTest : public BaseTest
{
protected:
OpenPOWER on IntegriCloud