From: Kush Date: Thu, 30 Apr 2020 16:12:42 +0000 (+0530) Subject: Adding ConnectionManager Test Case X-Git-Tag: submit/tizen/20200616.235056~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=63fa4bc91119732c5a44b320adfe6cb2336bcf73;p=platform%2Fupstream%2Fiotivity.git Adding ConnectionManager Test Case https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/693 (cherry-picked from 17b93dde4ed6de266af41a27f65026ca25b8ed53) Change-Id: I404ed36b6a3efd40f0759df8da6d7be91b0d1bce Signed-off-by: Kush Signed-off-by: Sudipto --- diff --git a/resource/csdk/connectivity/test/SConscript b/resource/csdk/connectivity/test/SConscript index 24a0df3a2..2880e6584 100644 --- a/resource/csdk/connectivity/test/SConscript +++ b/resource/csdk/connectivity/test/SConscript @@ -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 index 000000000..372449454 --- /dev/null +++ b/resource/csdk/connectivity/test/caconnectionmanagertest.cpp @@ -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 + +#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); + +} + + +