[IOT-2063] Enabled ca_api_unittest for CAGetNetworkInformation
authorhyuna0213.jo <hyuna0213.jo@samsung.com>
Tue, 23 May 2017 04:49:24 +0000 (13:49 +0900)
committerAshok Babu Channa <ashok.channa@samsung.com>
Mon, 12 Jun 2017 06:35:35 +0000 (06:35 +0000)
Change-Id: I2279dc5ce94ae7262d7f425d857d929791c18796
Signed-off-by: hyuna0213.jo <hyuna0213.jo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/20293
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Jaehong Jo <jaehong.jo@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
resource/csdk/connectivity/test/ca_api_unittest.cpp

index 39eccd6..b091308 100755 (executable)
@@ -521,17 +521,15 @@ TEST_F(CATests, GetNetworkInformationTest)
     free(tempInfo);
 }
 
-// TODO: This is temporary disabled.
-TEST(CAGetNetworkInformationTest, DISABLED_EnableIPv6)
+TEST_F(CATests, GetNetworkInformationTest_EnableIPv6)
 {
-    CAInitialize(CA_DEFAULT_ADAPTER);
+    EXPECT_EQ(CA_STATUS_OK, CASelectNetwork(CA_ADAPTER_IP));
+
     caglobals.ip.ipv6enabled = true;
     caglobals.ip.ipv4enabled = false;
 
     size_t tempSize = 0;
     CAEndpoint_t *tempInfo = NULL;
-
-    EXPECT_EQ(CA_STATUS_OK, CASelectNetwork(CA_ADAPTER_IP));
     EXPECT_EQ(CA_STATUS_OK, CAGetNetworkInformation(&tempInfo, &tempSize));
 
     for (size_t index = 0; index < tempSize; index++)
@@ -540,19 +538,17 @@ TEST(CAGetNetworkInformationTest, DISABLED_EnableIPv6)
     }
 
     OICFree(tempInfo);
-    CATerminate();
 }
 
-TEST(CAGetNetworkInformationTest, DISABLED_EnableIPv4)
+TEST_F(CATests, GetNetworkInformationTest_EnableIPv4)
 {
-    CAInitialize(CA_DEFAULT_ADAPTER);
+    EXPECT_EQ(CA_STATUS_OK, CASelectNetwork(CA_ADAPTER_IP));
+
     caglobals.ip.ipv6enabled = false;
     caglobals.ip.ipv4enabled = true;
 
     size_t tempSize = 0;
     CAEndpoint_t *tempInfo = NULL;
-
-    EXPECT_EQ(CA_STATUS_OK, CASelectNetwork(CA_ADAPTER_IP));
     EXPECT_EQ(CA_STATUS_OK, CAGetNetworkInformation(&tempInfo, &tempSize));
 
     for (size_t index = 0; index < tempSize; index++)
@@ -561,19 +557,17 @@ TEST(CAGetNetworkInformationTest, DISABLED_EnableIPv4)
     }
 
     OICFree(tempInfo);
-    CATerminate();
 }
 
-TEST(CAGetNetworkInformationTest, DISABLED_EnableIPv4AndIPv6)
+TEST_F(CATests, GetNetworkInformationTest_EnableIPv4AndIPv6)
 {
-    CAInitialize(CA_DEFAULT_ADAPTER);
+    EXPECT_EQ(CA_STATUS_OK, CASelectNetwork(CA_ADAPTER_IP));
+
     caglobals.ip.ipv6enabled = true;
     caglobals.ip.ipv4enabled = true;
 
     size_t tempSize = 0;
     CAEndpoint_t *tempInfo = NULL;
-
-    EXPECT_EQ(CA_STATUS_OK, CASelectNetwork(CA_ADAPTER_IP));
     EXPECT_EQ(CA_STATUS_OK, CAGetNetworkInformation(&tempInfo, &tempSize));
 
     CATransportFlags_t flags = (CATransportFlags_t)(CA_IPV4|CA_IPV6);
@@ -583,7 +577,6 @@ TEST(CAGetNetworkInformationTest, DISABLED_EnableIPv4AndIPv6)
     }
 
     OICFree(tempInfo);
-    CATerminate();
 }
 
 TEST_F(CATests, GetSelectedNetwork)