ITs-iotcon-resource.c
ITs-iotcon-presence.c
ITs-iotcon-presence-response.c
+ ITs-iotcon-serive.c
)
PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
}\
}
+#define START_TEST_SERVICE{\
+ FPRINTF("[Line : %d][%s] Starting test : %s\\n", __LINE__, API_NAMESPACE, __FUNCTION__);\
+}
+
+
#define RUN_POLLING_LOOP {\
g_pMainLoop = g_main_loop_new(NULL, false);\
nIotconTimeoutId = g_timeout_add(TIMEOUT_CB, TimeoutFunction, g_pMainLoop);\
--- /dev/null
+//
+// Copyright (c) 2014 Samsung Electronics Co., Ltd.
+//
+// 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 "ITs-iotcon-common.h"
+
+//& set: Iotcon
+
+/** @addtogroup itc-iotcon
+* @ingroup itc
+* @{
+*/
+
+
+/**
+ * @function ITs_iotcon_service_startup
+ * @description Called before each test
+ * @parameter NA
+ * @return NA
+ */
+
+void ITs_iotcon_service_startup(void)
+{
+ struct stat stBuff;
+ char *svr_db_path;
+ if ( stat(ERR_LOG, &stBuff) == 0 )
+ {
+ remove(ERR_LOG);
+ }
+ g_bFeatureUnsupported = false;
+ if ( !TCTCheckSystemInfoFeatureSupported(IOTCON_FEATURE, API_NAMESPACE) )
+ {
+ g_bFeatureUnsupported = true;
+ }
+ return;
+}
+
+
+/**
+ * @function ITs_iotcon_service_cleanup
+ * @description Called after each test
+ * @parameter NA
+ * @return NA
+ */
+void ITs_iotcon_service_cleanup(void)
+{
+ return;
+}
+
+/** @addtogroup itc-iotcon-testcases
+* @brief Integration testcases for module iotcon
+* @ingroup itc-iotcon
+* @{
+*/
+
+//& type: auto
+//& purpose: scenario to connect and disconnect iotcon.
+/**
+* @testcase ITc_iotcon_initialize_deinitialize_p
+* @author SRID(sk.roy)
+* @reviewer SRID(parshant.v)
+* @type auto
+* @since_tizen 3.0
+* @description connect and disconnect iotcon.
+* @scenario connect iotcon \n
+* disconnect iotcon\n
+* @apicovered iotcon_initialize, iotcon_deinitialize
+* @passcase if iotcon_initialize and iotcon_deinitialize passes
+* @failcase if iotcon_initialize or iotcon_deinitialize fails
+* @precondition NA
+* @postcondition NA
+*/
+int ITc_iotcon_initialize_deinitialize_p(void)
+{
+ START_TEST_SERVICE;
+ char *svr_db_path;
+
+ ic_get_svr_db_path(&svr_db_path);
+ int nRet = iotcon_initialize(svr_db_path);
+ free(svr_db_path);
+ if(g_bFeatureUnsupported)
+ {
+ if ( nRet != TIZEN_ERROR_NOT_SUPPORTED )
+ {
+ FPRINTF("[Line : %d][%s] iotcon_initialize API call returned mismatch %s error for unsupported feature\\n", __LINE__, API_NAMESPACE, IotConGetError(nRet));
+ return 1;
+
+ }
+ else
+ {
+ FPRINTF("[Line : %d][%s] iotcon_initialize API call correctly returned %s error for unsupported feature\\n", __LINE__, API_NAMESPACE, IotConGetError(nRet));
+ return 0;
+ }
+ }
+ else
+ {
+ PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_initialize", IotConGetError(nRet));
+ }
+
+ iotcon_deinitialize();
+
+ return 0;
+}
+/** @} */
+/** @} */
*/
//& type: auto
-//& purpose: scenario to connect and disconnect iotcon.
-/**
-* @testcase ITc_iotcon_initialize_deinitialize_p
-* @author SRID(sk.roy)
-* @reviewer SRID(parshant.v)
-* @type auto
-* @since_tizen 3.0
-* @description connect and disconnect iotcon.
-* @scenario connect iotcon \n
-* disconnect iotcon\n
-* @apicovered iotcon_initialize, iotcon_deinitialize
-* @passcase if iotcon_initialize and iotcon_deinitialize passes
-* @failcase if iotcon_initialize or iotcon_deinitialize fails
-* @precondition NA
-* @postcondition NA
-*/
-int ITc_iotcon_initialize_deinitialize_p(void)
-{
- START_TEST;
- char *svr_db_path;
-
- iotcon_deinitialize();
-
- ic_get_svr_db_path(&svr_db_path);
- int nRet = iotcon_initialize(svr_db_path);
- PRINT_RESULT(IOTCON_ERROR_NONE, nRet, "iotcon_initialize", IotConGetError(nRet));
-
- iotcon_deinitialize();
- nRet = iotcon_initialize(svr_db_path);
- free(svr_db_path);
- PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_initialize", IotConGetError(nRet));
-
- if(nRet != IOTCON_ERROR_NONE)
- g_bIotconConnect = false;
-
- return 0;
-}
-
-//& type: auto
//& purpose: scenario to create and destroy iotcon list
/**
* @testcase ITc_iotcon_set_get_timeout_p
extern void ITs_iotcon_device_cleanup(void);
extern void ITs_iotcon_list_startup(void);
extern void ITs_iotcon_list_cleanup(void);
+extern void ITs_iotcon_service_startup(void);
+extern void ITs_iotcon_service_cleanup(void);
extern void ITs_iotcon_lite_resource_startup(void);
extern void ITs_iotcon_lite_resource_cleanup(void);
extern void ITs_iotcon_observers_startup(void);
{"ITc_iotcon_response_set_get_representation_p", ITc_iotcon_response_set_get_representation_p, ITs_iotcon_response_startup, ITs_iotcon_response_cleanup},
{"ITc_iotcon_response_set_get_result_p", ITc_iotcon_response_set_get_result_p, ITs_iotcon_response_startup, ITs_iotcon_response_cleanup},
{"ITc_iotcon_response_send_p", ITc_iotcon_response_send_p, ITs_iotcon_response_startup, ITs_iotcon_response_cleanup},
- {"ITc_iotcon_initialize_deinitialize_p", ITc_iotcon_initialize_deinitialize_p, ITs_iotcon_startup, ITs_iotcon_cleanup},
+ {"ITc_iotcon_initialize_deinitialize_p", ITc_iotcon_initialize_deinitialize_p, ITs_iotcon_service_startup, ITs_iotcon_service_cleanup},
{"ITc_iotcon_set_get_timeout_p", ITc_iotcon_set_get_timeout_p, ITs_iotcon_startup, ITs_iotcon_cleanup},
// {"ITc_iotcon_set_get_polling_interval_p", ITc_iotcon_set_get_polling_interval_p, ITs_iotcon_startup, ITs_iotcon_cleanup},
// {"ITc_iotcon_polling_invoke_p", ITc_iotcon_polling_invoke_p, ITs_iotcon_startup, ITs_iotcon_cleanup},
extern void ITs_iotcon_device_cleanup(void);
extern void ITs_iotcon_list_startup(void);
extern void ITs_iotcon_list_cleanup(void);
+extern void ITs_iotcon_service_startup(void);
+extern void ITs_iotcon_service_cleanup(void);
extern void ITs_iotcon_lite_resource_startup(void);
extern void ITs_iotcon_lite_resource_cleanup(void);
extern void ITs_iotcon_observers_startup(void);
{"ITc_iotcon_response_set_get_representation_p", ITc_iotcon_response_set_get_representation_p, ITs_iotcon_response_startup, ITs_iotcon_response_cleanup},
{"ITc_iotcon_response_set_get_result_p", ITc_iotcon_response_set_get_result_p, ITs_iotcon_response_startup, ITs_iotcon_response_cleanup},
{"ITc_iotcon_response_send_p", ITc_iotcon_response_send_p, ITs_iotcon_response_startup, ITs_iotcon_response_cleanup},
- {"ITc_iotcon_initialize_deinitialize_p", ITc_iotcon_initialize_deinitialize_p, ITs_iotcon_startup, ITs_iotcon_cleanup},
+ {"ITc_iotcon_initialize_deinitialize_p", ITc_iotcon_initialize_deinitialize_p, ITs_iotcon_service_startup, ITs_iotcon_service_cleanup},
{"ITc_iotcon_set_get_timeout_p", ITc_iotcon_set_get_timeout_p, ITs_iotcon_startup, ITs_iotcon_cleanup},
// {"ITc_iotcon_set_get_polling_interval_p", ITc_iotcon_set_get_polling_interval_p, ITs_iotcon_startup, ITs_iotcon_cleanup},
// {"ITc_iotcon_polling_invoke_p", ITc_iotcon_polling_invoke_p, ITs_iotcon_startup, ITs_iotcon_cleanup},
extern void ITs_iotcon_device_cleanup(void);
extern void ITs_iotcon_list_startup(void);
extern void ITs_iotcon_list_cleanup(void);
+extern void ITs_iotcon_service_startup(void);
+extern void ITs_iotcon_service_cleanup(void);
extern void ITs_iotcon_lite_resource_startup(void);
extern void ITs_iotcon_lite_resource_cleanup(void);
extern void ITs_iotcon_observers_startup(void);
{"ITc_iotcon_response_set_get_representation_p", ITc_iotcon_response_set_get_representation_p, ITs_iotcon_response_startup, ITs_iotcon_response_cleanup},
{"ITc_iotcon_response_set_get_result_p", ITc_iotcon_response_set_get_result_p, ITs_iotcon_response_startup, ITs_iotcon_response_cleanup},
{"ITc_iotcon_response_send_p", ITc_iotcon_response_send_p, ITs_iotcon_response_startup, ITs_iotcon_response_cleanup},
- {"ITc_iotcon_initialize_deinitialize_p", ITc_iotcon_initialize_deinitialize_p, ITs_iotcon_startup, ITs_iotcon_cleanup},
+ {"ITc_iotcon_initialize_deinitialize_p", ITc_iotcon_initialize_deinitialize_p, ITs_iotcon_service_startup, ITs_iotcon_service_cleanup},
{"ITc_iotcon_set_get_timeout_p", ITc_iotcon_set_get_timeout_p, ITs_iotcon_startup, ITs_iotcon_cleanup},
// {"ITc_iotcon_set_get_polling_interval_p", ITc_iotcon_set_get_polling_interval_p, ITs_iotcon_startup, ITs_iotcon_cleanup},
// {"ITc_iotcon_polling_invoke_p", ITc_iotcon_polling_invoke_p, ITs_iotcon_startup, ITs_iotcon_cleanup},
extern void ITs_iotcon_device_cleanup(void);
extern void ITs_iotcon_list_startup(void);
extern void ITs_iotcon_list_cleanup(void);
+extern void ITs_iotcon_service_startup(void);
+extern void ITs_iotcon_service_cleanup(void);
extern void ITs_iotcon_lite_resource_startup(void);
extern void ITs_iotcon_lite_resource_cleanup(void);
extern void ITs_iotcon_observers_startup(void);
{"ITc_iotcon_response_set_get_representation_p", ITc_iotcon_response_set_get_representation_p, ITs_iotcon_response_startup, ITs_iotcon_response_cleanup},
{"ITc_iotcon_response_set_get_result_p", ITc_iotcon_response_set_get_result_p, ITs_iotcon_response_startup, ITs_iotcon_response_cleanup},
{"ITc_iotcon_response_send_p", ITc_iotcon_response_send_p, ITs_iotcon_response_startup, ITs_iotcon_response_cleanup},
- {"ITc_iotcon_initialize_deinitialize_p", ITc_iotcon_initialize_deinitialize_p, ITs_iotcon_startup, ITs_iotcon_cleanup},
+ {"ITc_iotcon_initialize_deinitialize_p", ITc_iotcon_initialize_deinitialize_p, ITs_iotcon_service_startup, ITs_iotcon_service_cleanup},
{"ITc_iotcon_set_get_timeout_p", ITc_iotcon_set_get_timeout_p, ITs_iotcon_startup, ITs_iotcon_cleanup},
// {"ITc_iotcon_set_get_polling_interval_p", ITc_iotcon_set_get_polling_interval_p, ITs_iotcon_startup, ITs_iotcon_cleanup},
// {"ITc_iotcon_polling_invoke_p", ITc_iotcon_polling_invoke_p, ITs_iotcon_startup, ITs_iotcon_cleanup},