Unit test modified to exercise code paths
* for checking OCStop() without any OCInit()
* to check for repeated OCStop()s after one OCInit()
Change-Id: I78a817befdce335d3dba40e5aee62275784f4ef2
Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1252
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Erich Keane <erich.keane@intel.com>
TEST(StackStop, StackStopWithoutInit)
{
itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
TEST(StackStop, StackStopWithoutInit)
{
itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
+ EXPECT_EQ(OC_STACK_ERROR, OCStop());
+}
+
+TEST(StackStop, StackStopRepeated)
+{
+ itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
EXPECT_EQ(OC_STACK_OK, OCInit("127.0.0.1", 5683, OC_CLIENT));
EXPECT_EQ(OC_STACK_OK, OCStop());
EXPECT_EQ(OC_STACK_ERROR, OCStop());
EXPECT_EQ(OC_STACK_OK, OCInit("127.0.0.1", 5683, OC_CLIENT));
EXPECT_EQ(OC_STACK_OK, OCStop());
EXPECT_EQ(OC_STACK_ERROR, OCStop());