summaryrefslogtreecommitdiffstats
path: root/test/internal/utils.cpp
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2018-07-17 16:54:36 -0700
committerWilliam A. Kennington III <wak@google.com>2018-07-17 16:54:55 -0700
commit4e9e604f02da41da974607be1ee00b0252776c82 (patch)
treee59c0e9b747c089ceebcde09ace6397b25c9a0ab /test/internal/utils.cpp
parentfeef68f751e09d8d5a4f2bf2f2f4cab27de1b73e (diff)
downloadsdeventplus-4e9e604f02da41da974607be1ee00b0252776c82.tar.gz
sdeventplus-4e9e604f02da41da974607be1ee00b0252776c82.zip
internal/utils: Errors now have names
Diffstat (limited to 'test/internal/utils.cpp')
-rw-r--r--test/internal/utils.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/internal/utils.cpp b/test/internal/utils.cpp
index 2a347ca..403964c 100644
--- a/test/internal/utils.cpp
+++ b/test/internal/utils.cpp
@@ -12,25 +12,27 @@ namespace
TEST(UtilsTest, PerformCallbackSuccess)
{
- EXPECT_EQ(0, performCallback([]() {}));
+ EXPECT_EQ(0, performCallback(nullptr, []() {}));
}
TEST(UtilsTest, SetPrepareSystemError)
{
- EXPECT_EQ(-EBUSY, performCallback([]() {
+ EXPECT_EQ(-EBUSY, performCallback("system_error", []() {
throw std::system_error(EBUSY, std::generic_category());
}));
}
TEST(UtilsTest, SetPrepareException)
{
- EXPECT_EQ(-ENOSYS,
- performCallback([]() { throw std::runtime_error("Exception"); }));
+ EXPECT_EQ(-ENOSYS, performCallback("runtime_error", []() {
+ throw std::runtime_error("Exception");
+ }));
}
TEST(UtilsTest, SetPrepareUnknownException)
{
- EXPECT_EQ(-ENOSYS, performCallback([]() { throw static_cast<int>(1); }));
+ EXPECT_EQ(-ENOSYS,
+ performCallback("unknown", []() { throw static_cast<int>(1); }));
}
} // namespace
OpenPOWER on IntegriCloud