1 /* *****************************************************************
3 * Copyright 2016 Samsung Electronics All Rights Reserved.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
19 * *****************************************************************/
22 #include <oic_malloc.h>
24 #include <OCPlatform_impl.h>
25 #include <oxmjustworks.h>
26 #include <oxmrandompin.h>
27 #include <OCProvisioningManager.h>
28 #include <gtest/gtest.h>
31 static std::string IP("127.0.0.1");
32 static uint16_t PORT = 5683;
34 namespace OCCloudProvisioningTest
38 void resultCallback(OCStackResult result, void *data)
44 TEST(RequestCertTest, TestNullCallback)
46 OCCloudProvisioning cloud(IP, PORT);
47 EXPECT_EQ(OC_STACK_INVALID_CALLBACK, cloud.requestCertificate(NULL));
50 TEST(AclIdByDeviceTest, AclIdNullCallback)
52 OCCloudProvisioning cloud(IP, PORT);
53 std::string devId("");
54 EXPECT_EQ(OC_STACK_INVALID_CALLBACK, cloud.getAclIdByDevice(devId, NULL));
57 TEST(AclInfoTest, AclInfoNullCallback)
59 OCCloudProvisioning cloud(IP, PORT);
60 std::string aclId("");
61 EXPECT_EQ(OC_STACK_INVALID_CALLBACK, cloud.getIndividualAclInfo(aclId, NULL));
64 TEST(GetCRLTest, GetCrlNullCallback)
66 OCCloudProvisioning cloud(IP, PORT);
67 EXPECT_EQ(OC_STACK_INVALID_CALLBACK, cloud.getCRL(NULL));
70 TEST(PostCRLTest, PostCrlNullCallback)
72 std::string thisUpdate("");
73 std::string nextUpdate("");
75 stringArray_t serials;
76 OCCloudProvisioning cloud(IP, PORT);
77 EXPECT_EQ(OC_STACK_INVALID_CALLBACK, cloud.postCRL(thisUpdate,
79 &crl, &serials, NULL));