Disabled all unit tests that ultimately make network API calls. 45/745/3
authorJoseph Morrow <joseph.l.morrow@intel.com>
Thu, 16 Apr 2015 00:26:12 +0000 (20:26 -0400)
committerErich Keane <erich.keane@intel.com>
Mon, 20 Apr 2015 06:07:57 +0000 (06:07 +0000)
A commit was pushed earlier that only disabled the tests that ultimately
made networking calls in just one unit test. This commit makes similar
changes to the rest of the unit tests in this repo.

Change-Id: If49f66d010eced3d3defa93a1824ae60e63ac159
Signed-off-by: Joseph Morrow <joseph.l.morrow@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/745
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Doug Hudson <douglas.hudson@intel.com>
Reviewed-by: Erich Keane <erich.keane@intel.com>
resource/csdk/connectivity/test/ca_api_unittest.cpp
resource/csdk/stack/test/stacktests.cpp
resource/unittests/OCPlatformTest.cpp

index be149e0..3a04120 100644 (file)
@@ -60,7 +60,6 @@ static CAInfo_t responseData;
 static CAResponseInfo_t responseInfo;
 static CAToken_t tempToken = NULL;
 static uint8_t tokenLength = CA_MAX_TOKEN_LEN;
-static CAResult_t g_selectNetworkResult = CA_STATUS_OK;
 static const char URI[] = "coap://10.11.12.13:4545/a/light";
 static const char RESOURCE_URI[] = "/a/light";
 
@@ -160,7 +159,7 @@ TEST_F(CATests, TerminateTest)
 }
 // CAStartListeningServer TC
 // check return value
-TEST(StartListeningServerTest, TC_03_Positive_01)
+TEST(StartListeningServerTest, DISABLED_TC_03_Positive_01)
 {
     CASelectNetwork(CA_ETHERNET);
     EXPECT_EQ(CA_STATUS_OK, CAStartListeningServer());
@@ -168,7 +167,7 @@ TEST(StartListeningServerTest, TC_03_Positive_01)
 
 // CAStartDiscoveryServer TC
 // check return value
-TEST(StartDiscoveryServerTest, TC_04_Positive_01)
+TEST(StartDiscoveryServerTest, DISABLED_TC_04_Positive_01)
 {
     EXPECT_EQ(CA_STATUS_OK, CAStartDiscoveryServer());
 }
@@ -293,7 +292,7 @@ TEST_F(CATests, DestroyTokenTest)
 
 // CAFindResource TC
 // check return value
-TEST(FindResourceTest, TC_14_Positive_01)
+TEST(FindResourceTest, DISABLED_TC_14_Positive_01)
 {
     uri = (char *) RESOURCE_URI;
 
@@ -313,7 +312,7 @@ TEST_F(CATests, FindResourceTest)
 
 // CASendRequest TC
 // check return value
-TEST(SendRequestTest, TC_16_Positive_01)
+TEST(SendRequestTest, DISABLED_TC_16_Positive_01)
 {
     uri = (char *) URI;
     CACreateRemoteEndpoint(uri, CA_ETHERNET, &tempRep);
@@ -393,7 +392,7 @@ TEST_F(CATests, SendRequestTestWithNullAddr)
 
 // CASendResponse TC
 // check return value
-TEST(SendResponseTest, TC_19_Positive_01)
+TEST(SendResponseTest, DISABLED_TC_19_Positive_01)
 {
     uri = (char *) URI;
     CACreateRemoteEndpoint(uri, CA_ETHERNET, &tempRep);
@@ -419,7 +418,7 @@ TEST(SendResponseTest, TC_19_Positive_01)
 }
 
 // check return value when uri is NULL
-TEST(SendResponseTest, TC_20_Negative_01)
+TEST(SendResponseTest, DISABLED_TC_20_Negative_01)
 {
     uri = NULL;
     CACreateRemoteEndpoint(uri, CA_ETHERNET, &tempRep);
@@ -464,7 +463,7 @@ TEST_F(CATests, SendResponseTest)
 
 // CASendNotification TC
 // check return value
-TEST(SendNotificationTest, TC_22_Positive_01)
+TEST(SendNotificationTest, DISABLED_TC_22_Positive_01)
 {
     uri = (char *) URI;
     CACreateRemoteEndpoint(uri, CA_ETHERNET, &tempRep);
@@ -521,7 +520,7 @@ TEST_F(CATests, SendNotificationTest)
 
 // CAAdvertiseResource TC
 // check return value
-TEST(AdvertiseResourceTest, TC_24_Positive_01)
+TEST(AdvertiseResourceTest, DISABLED_TC_24_Positive_01)
 {
     uri = (char *) RESOURCE_URI;
     int optionNum = 2;
@@ -600,18 +599,16 @@ CAResult_t checkSelectNetwork()
 
     if (CA_STATUS_OK == res)
     {
-        g_selectNetworkResult = res;
+        EXPECT_EQ(CA_STATUS_OK, CAUnSelectNetwork(CA_ETHERNET));
         return CA_STATUS_OK;
     }
-    else if (CA_NOT_SUPPORTED == res)
+    if (CA_NOT_SUPPORTED == res)
     {
-        g_selectNetworkResult = res;
+        EXPECT_EQ(CA_STATUS_FAILED, CAUnSelectNetwork(CA_ETHERNET));
         return CA_STATUS_OK;
     }
-    else
-    {
-        return CA_STATUS_FAILED;
-    }
+
+    return res;
 }
 
 // check return value when selected network is disable
@@ -621,21 +618,6 @@ TEST_F(CATests, SelectNetworkTestBad)
     EXPECT_EQ(CA_NOT_SUPPORTED, CASelectNetwork(1000));
 }
 
-// CAUnSelectNewwork TC
-// check return value
-TEST(UnSelectNetworkTest, TC_28_Positive_01)
-{
-    if (CA_STATUS_OK == g_selectNetworkResult)
-    {
-        EXPECT_EQ(CA_STATUS_OK, CAUnSelectNetwork(CA_ETHERNET));
-    }
-
-    if (CA_NOT_SUPPORTED == g_selectNetworkResult)
-    {
-        EXPECT_EQ(CA_STATUS_FAILED, CAUnSelectNetwork(CA_ETHERNET));
-    }
-}
-
 // check return value when selected network is disable
 TEST_F(CATests, UnSelectNetworkTest)
 {
@@ -652,7 +634,7 @@ TEST_F(CATests, HandlerRequestResponseTest)
 
 // CASendRequestToAll TC
 // check return value
-TEST (SendRequestToAllTest, TC_31_Positive_01)
+TEST(SendRequestToAllTest, DISABLED_TC_31_Positive_01)
 {
     uri = (char *) RESOURCE_URI;
     CACreateRemoteEndpoint(uri, CA_ETHERNET, &tempRep);
@@ -683,7 +665,7 @@ TEST (SendRequestToAllTest, TC_31_Positive_01)
 }
 
 // check return value when group->resourceUri is NULL
-TEST (SendRequestToAllTest, TC_32_Negative_01)
+TEST(SendRequestToAllTest, DISABLED_TC_32_Negative_01)
 {
     uri = (char *) RESOURCE_URI;
     CAGroupEndpoint_t *group = NULL;
index 8da73ca..ba9cad7 100644 (file)
@@ -180,7 +180,7 @@ TEST(StackStart, StackStartSuccessiveInits)
     EXPECT_EQ(OC_STACK_OK, OCStop());
 }
 
-TEST(StackDiscovery, DoResourceDeviceDiscovery)
+TEST(StackDiscovery, DISABLED_DoResourceDeviceDiscovery)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
     OCCallbackData cbData;
@@ -216,7 +216,7 @@ TEST(StackStop, StackStopWithoutInit)
     EXPECT_EQ(OC_STACK_ERROR, OCStop());
 }
 
-TEST(StackResource, UpdateResourceNullURI)
+TEST(StackResource, DISABLED_UpdateResourceNullURI)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
     OCCallbackData cbData;
index 1ef5c02..4154d61 100644 (file)
@@ -356,7 +356,7 @@ namespace OCPlatformTest
     }
 
     //PresenceTest
-    TEST(PresenceTest, StartAndStopPresence)
+    TEST(PresenceTest, DISABLED_StartAndStopPresence)
     {
         EXPECT_EQ(OC_STACK_OK, OCPlatform::startPresence(30));
         EXPECT_NE(HANDLE_ZERO, RegisterResource( std::string("/a/Presence"),
@@ -473,7 +473,7 @@ namespace OCPlatformTest
 
 
     //FindResource test
-    TEST(FindResourceTest, FindResourceValid)
+    TEST(FindResourceTest, DISABLED_FindResourceValid)
     {
       std::ostringstream requestURI;
       requestURI << OC_WELL_KNOWN_QUERY << "?rt=core.light";
@@ -511,7 +511,7 @@ namespace OCPlatformTest
               OC_WIFI, NULL), OC::OCException);
     }
 
-    TEST(FindResourceTest, FindResourceWithLowQoS)
+    TEST(FindResourceTest, DISABLED_FindResourceWithLowQoS)
     {
         std::ostringstream requestURI;
         requestURI << OC_WELL_KNOWN_QUERY << "?rt=core.light";
@@ -520,7 +520,7 @@ namespace OCPlatformTest
                         OC::QualityOfService::LowQos));
     }
 
-    TEST(FindResourceTest, FindResourceWithMidQos)
+    TEST(FindResourceTest, DISABLED_FindResourceWithMidQos)
     {
         std::ostringstream requestURI;
         requestURI << OC_WELL_KNOWN_QUERY << "?rt=core.light";
@@ -529,7 +529,7 @@ namespace OCPlatformTest
                         OC::QualityOfService::MidQos));
     }
 
-    TEST(FindResourceTest, FindResourceWithHighQos)
+    TEST(FindResourceTest, DISABLED_FindResourceWithHighQos)
     {
         std::ostringstream requestURI;
         requestURI << OC_WELL_KNOWN_QUERY << "?rt=core.light";
@@ -538,7 +538,7 @@ namespace OCPlatformTest
                         OC::QualityOfService::HighQos));
     }
 
-    TEST(FindResourceTest, FindResourceWithNaQos)
+    TEST(FindResourceTest, DISABLED_FindResourceWithNaQos)
     {
         std::ostringstream requestURI;
         requestURI << OC_WELL_KNOWN_QUERY << "?rt=core.light";
@@ -548,7 +548,7 @@ namespace OCPlatformTest
     }
 
     //GetDeviceInfo Test
-    TEST(GetDeviceInfoTest, GetDeviceInfoWithValidParameters)
+    TEST(GetDeviceInfoTest, DISABLED_GetDeviceInfoWithValidParameters)
     {
         std::string deviceDiscoveryURI = "/oc/core/d";
         PlatformConfig cfg;
@@ -579,7 +579,7 @@ namespace OCPlatformTest
                 OC::OCException);
     }
 
-    TEST(GetDeviceInfoTest, GetDeviceInfoWithLowQos)
+    TEST(GetDeviceInfoTest, DISABLED_GetDeviceInfoWithLowQos)
     {
         std::string deviceDiscoveryURI = "/oc/core/d";
         PlatformConfig cfg;
@@ -591,7 +591,7 @@ namespace OCPlatformTest
                         OC::QualityOfService::LowQos));
     }
 
-    TEST(GetDeviceInfoTest, GetDeviceInfoWithMidQos)
+    TEST(GetDeviceInfoTest, DISABLED_GetDeviceInfoWithMidQos)
     {
         std::string deviceDiscoveryURI = "/oc/core/d";
         PlatformConfig cfg;
@@ -603,7 +603,7 @@ namespace OCPlatformTest
                         OC::QualityOfService::MidQos));
     }
 
-    TEST(GetDeviceInfoTest, GetDeviceInfoWithHighQos)
+    TEST(GetDeviceInfoTest, DISABLED_GetDeviceInfoWithHighQos)
     {
         std::string deviceDiscoveryURI = "/oc/core/d";
         PlatformConfig cfg;
@@ -615,7 +615,7 @@ namespace OCPlatformTest
                         OC::QualityOfService::HighQos));
     }
 
-    TEST(GetDeviceInfoTest, GetDeviceInfoWithNaQos)
+    TEST(GetDeviceInfoTest, DISABLED_GetDeviceInfoWithNaQos)
     {
         std::string deviceDiscoveryURI = "/oc/core/d";
         PlatformConfig cfg;
@@ -656,7 +656,7 @@ namespace OCPlatformTest
     }
 
     //SubscribePresence Test
-    TEST(SubscribePresenceTest,SubscribePresenceWithValidParameters)
+    TEST(SubscribePresenceTest, DISABLED_SubscribePresenceWithValidParameters)
     {
         std::string hostAddress = "192.168.1.2:5000";
         OCPlatform::OCPresenceHandle presenceHandle = nullptr;
@@ -665,7 +665,7 @@ namespace OCPlatformTest
                  OC_WIFI, &presenceHandler));
     }
 
-    TEST(SubscribePresenceTest,SubscribePresenceWithNullHost)
+    TEST(SubscribePresenceTest, SubscribePresenceWithNullHost)
     {
         OCPlatform::OCPresenceHandle presenceHandle = nullptr;
 
@@ -673,7 +673,7 @@ namespace OCPlatformTest
                  OC_WIFI, &presenceHandler));
     }
 
-    TEST(SubscribePresenceTest,SubscribePresenceWithNullPresenceHandler)
+    TEST(SubscribePresenceTest, SubscribePresenceWithNullPresenceHandler)
     {
         OCPlatform::OCPresenceHandle presenceHandle = nullptr;
 
@@ -681,7 +681,7 @@ namespace OCPlatformTest
                  OC_WIFI, NULL));
     }
 
-    TEST(SubscribePresenceTest,SubscribePresenceWithResourceType)
+    TEST(SubscribePresenceTest, DISABLED_SubscribePresenceWithResourceType)
     {
         OCPlatform::OCPresenceHandle presenceHandle = nullptr;
 
@@ -689,7 +689,7 @@ namespace OCPlatformTest
                 OC_MULTICAST_IP, "core.light", OC_WIFI, &presenceHandler));
     }
 
-    TEST(SubscribePresenceTest,SubscribePresenceWithNullResourceType)
+    TEST(SubscribePresenceTest, SubscribePresenceWithNullResourceType)
     {
         OCPlatform::OCPresenceHandle presenceHandle = nullptr;
 
@@ -697,7 +697,7 @@ namespace OCPlatformTest
                 OC_MULTICAST_IP, nullptr, OC_WIFI, &presenceHandler));
     }
 
-    TEST(SubscribePresenceTest, UnsubscribePresenceWithValidHandleAndRT)
+    TEST(SubscribePresenceTest, DISABLED_UnsubscribePresenceWithValidHandleAndRT)
     {
         OCPlatform::OCPresenceHandle presenceHandle = nullptr;
 
@@ -712,7 +712,7 @@ namespace OCPlatformTest
         EXPECT_ANY_THROW(OCPlatform::unsubscribePresence(presenceHandle));
     }
 
-    TEST(SubscribePresenceTest, UnsubscribePresenceWithValidHandle)
+    TEST(SubscribePresenceTest, DISABLED_UnsubscribePresenceWithValidHandle)
     {
         OCPlatform::OCPresenceHandle presenceHandle = nullptr;