From e81f2cac429073ebe683715def98a0c2b86c6184 Mon Sep 17 00:00:00 2001 From: henricasanova Date: Thu, 30 Nov 2017 12:01:43 -1000 Subject: [PATCH] Coverage++ --- test/simulation/OneTaskTest.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/test/simulation/OneTaskTest.cpp b/test/simulation/OneTaskTest.cpp index 8359ac7cfb..10b2bfc0a1 100644 --- a/test/simulation/OneTaskTest.cpp +++ b/test/simulation/OneTaskTest.cpp @@ -224,6 +224,31 @@ class ExecutionWithLocationMapTestWMS : public wrench::WMS { throw std::runtime_error("Output file not written to storage service"); } + + /* Do a bogus lookup of the file registry service */ + bool success = true; + try { + this->simulation->getFileRegistryService()->lookupEntry(nullptr); + } catch (std::invalid_argument &e) { + success = false; + } + if (success) { + throw std::runtime_error("Shouldn't be able to lookup a nullptr entry in the File Registry Service"); + } + + /* Do a bogus add entry of the file registry service */ + success = true; + try { + this->simulation->getFileRegistryService()->addEntry(nullptr, nullptr); + } catch (std::invalid_argument &e) { + success = false; + } + if (success) { + throw std::runtime_error("Shouldn't be able to add nullptr entry in the File Registry Service"); + } + + + // Terminate this->simulation->shutdownAllComputeServices(); this->simulation->shutdownAllStorageServices();