remoteEnrollee = EasySetup::getInstance()->createEnrolleeDevice(netInfo, onboardingConn);
remoteEnrollee->registerEasySetupStatusHandler(&easySetupStatusCallback);
- /*It will throw an exception,
- * as it will not be able to discover the provisioning resource
- * in the network
- */
+#ifdef REMOTE_ARDUINO_ENROLEE
+ EXPECT_NO_THROW(remoteEnrollee->startProvisioning());
+
+#else
+ /* It will throw the exception
+ * as it will not able to discover the provisioning resource in the network
+ */
EXPECT_ANY_THROW(remoteEnrollee->startProvisioning());
+#endif
}
//startProvisioning [Negative]
remoteEnrollee = EasySetup::getInstance()->createEnrolleeDevice(netInfo, onboardingConn);
- /*We are not registering the EasySetupStatusHandler that is why startProvisioning
- will throw the Exception & we are checking the same
- */
+ /* We are not registering the EasySetupStatusHandler, so startProvisioning
+ * will throw the Exception & we are checking the same
+ */
EXPECT_ANY_THROW(remoteEnrollee->startProvisioning());
}
remoteEnrollee = EasySetup::getInstance()->createEnrolleeDevice(netInfo, onboardingConn);
remoteEnrollee->registerEasySetupStatusHandler(&easySetupStatusCallback);
- /* It will throw an exception,
- * as we are calling stop provisioning api before start provisioning.
+#ifdef REMOTE_ARDUINO_ENROLEE
+ EXPECT_NO_THROW(remoteEnrollee->startProvisioning());
+ EXPECT_NO_THROW(remoteEnrollee->stopProvisioning());
+
+#else
+ /* It will throw the exception as
+ * it will not able to discover the provisioning resource in the network
+ */
+ EXPECT_ANY_THROW(remoteEnrollee->startProvisioning());
+
+ /* It will throw an exception
+ * as internally resource will be empty [startProvisioning is not succeed]
*/
EXPECT_ANY_THROW(remoteEnrollee->stopProvisioning());
+#endif
}
//stopProvisioning [Negative]
remoteEnrollee->registerEasySetupStatusHandler(&easySetupStatusCallback);
/* we didn't call the start provisioning API and directly calling stopProvisioning API.
- In this case API will throw the exception & we are checking the same.
- */
+ * In this case API will throw the exception & we are checking the same.
+ */
EXPECT_ANY_THROW(remoteEnrollee->stopProvisioning());
}