Adding ConnectionManager Test Case 57/236357/1
authorKush <kush.agrawal@samsung.com>
Thu, 30 Apr 2020 16:12:42 +0000 (21:42 +0530)
committerSudipto <sudipto.bal@samsung.com>
Tue, 16 Jun 2020 10:41:28 +0000 (16:11 +0530)
https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/693
(cherry-picked from 17b93dde4ed6de266af41a27f65026ca25b8ed53)

Change-Id: I404ed36b6a3efd40f0759df8da6d7be91b0d1bce
Signed-off-by: Kush <kush.agrawal@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
resource/csdk/connectivity/test/SConscript
resource/csdk/connectivity/test/caconnectionmanagertest.cpp [new file with mode: 0644]

index 24a0df3..2880e65 100644 (file)
@@ -67,6 +67,7 @@ else:
 
 tests_src = [
        'catests.cpp',
+       'caconnectionmanagertest.cpp',
        'caprotocolmessagetest.cpp',
        'ca_api_unittest.cpp',
        'octhread_tests.cpp',
diff --git a/resource/csdk/connectivity/test/caconnectionmanagertest.cpp b/resource/csdk/connectivity/test/caconnectionmanagertest.cpp
new file mode 100644 (file)
index 0000000..3724494
--- /dev/null
@@ -0,0 +1,57 @@
+//******************************************************************
+//
+// Copyright 2015 Samsung Electronics All Rights Reserved.
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+#include <stdio.h>
+
+#include "gtest/gtest.h"
+
+#include "caconnectionmanager.h"
+
+void CASendThreadFuncCallback(CAData_t *data)
+{
+    (void)data;
+}
+
+void CAReceiveThreadFuncCallback(CAData_t *data)
+{
+    (void)data;
+}
+
+TEST(CAConnectionManager, CAInitializeConnectionManager)
+{
+    
+    CAResult_t ret;
+    ret = CAInitializeConnectionManager(CASendThreadFuncCallback, CAReceiveThreadFuncCallback);
+    CATerminateConnectionManager();
+    EXPECT_EQ(ret, CA_STATUS_OK);
+
+}
+
+TEST(CAConnectionManager, CAInitConnectionManagerMutexVariables)
+{
+    CAResult_t ret;
+    ret = CAInitConnectionManagerMutexVariables();
+    CATerminateConnectionManagerMutexVariables();
+    EXPECT_EQ(ret, CA_STATUS_OK);
+
+}
+
+
+