[UTC][iotcon][NON-ACR][Add check feature]
authorJooseok Park <jooseok.park@samsung.com>
Tue, 31 Jan 2017 04:08:43 +0000 (13:08 +0900)
committerJooseok Park <jooseok.park@samsung.com>
Tue, 31 Jan 2017 04:10:52 +0000 (13:10 +0900)
Change-Id: Ie787d43c9da34f38213f17369d287f22475c593e

src/utc/iotcon/utc-iotcon.c

index a23c0a4c768b0daffde1fbefe327ced7508577c9..628af5340f56024b479813025e4df658edd6b236 100644 (file)
@@ -387,7 +387,15 @@ static void cb2(const char *pin, void *user_data)
  */
 int utc_iotcon_add_generated_pin_cb_n(void)
 {
-       int ret = iotcon_add_generated_pin_cb(NULL, NULL);
+       int ret;
+
+       if (false == g_feature) {
+               ret = iotcon_add_generated_pin_cb(NULL, NULL);
+               ICUTC_ASSERT_EQ(ret, IOTCON_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
+       ret = iotcon_add_generated_pin_cb(NULL, NULL);
        ICUTC_ASSERT_EQ(ret, IOTCON_ERROR_INVALID_PARAMETER);
        return 0;
 }
@@ -399,7 +407,15 @@ int utc_iotcon_add_generated_pin_cb_n(void)
  */
 int utc_iotcon_add_generated_pin_cb_p(void)
 {
-       int ret = iotcon_add_generated_pin_cb(cb1, NULL);
+       int ret;
+
+       if (false == g_feature) {
+               ret = iotcon_add_generated_pin_cb(cb1, NULL);
+               ICUTC_ASSERT_EQ(ret, IOTCON_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
+       ret = iotcon_add_generated_pin_cb(cb1, NULL);
        ICUTC_ASSERT_EQ(ret, 0);
        return 0;
 }
@@ -411,8 +427,16 @@ int utc_iotcon_add_generated_pin_cb_p(void)
  */
 int utc_iotcon_remove_generated_pin_cb_n(void)
 {
+       int ret;
+
+       if (false == g_feature) {
+               ret = iotcon_remove_generated_pin_cb(cb2);
+               ICUTC_ASSERT_EQ(ret, IOTCON_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
        iotcon_add_generated_pin_cb(cb1, NULL);
-       int ret = iotcon_remove_generated_pin_cb(cb2);
+       ret = iotcon_remove_generated_pin_cb(cb2);
        ICUTC_ASSERT_EQ(ret, IOTCON_ERROR_NO_DATA);
        return 0;
 }
@@ -424,8 +448,16 @@ int utc_iotcon_remove_generated_pin_cb_n(void)
  */
 int utc_iotcon_remove_generated_pin_cb_p(void)
 {
+       int ret;
+
+       if (false == g_feature) {
+               ret = iotcon_remove_generated_pin_cb(cb1);
+               ICUTC_ASSERT_EQ(ret, IOTCON_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
        iotcon_add_generated_pin_cb(cb1, NULL);
-       int ret = iotcon_remove_generated_pin_cb(cb1);
+       ret = iotcon_remove_generated_pin_cb(cb1);
        ICUTC_ASSERT_EQ(ret, 0);
        return 0;
 }