Add test case for vcore_client_get_certificate_list_from_store function in Client.cpp 36/316236/17
authortranthanhtung2001 <tran.tung@samsung.com>
Fri, 16 Aug 2024 07:31:43 +0000 (14:31 +0700)
committerDariusz Michaluk <d.michaluk@samsung.com>
Wed, 21 Aug 2024 06:59:49 +0000 (06:59 +0000)
Change-Id: I70130fd9c0d5641ffa4d34c9d9b9f2514036f930
Signed-off-by: tranthanhtung2001 <tran.tung@samsung.com>
unit-tests/test_vcore_client.cpp

index 60c15ad..bbbfc30 100644 (file)
@@ -253,6 +253,24 @@ NEGATIVE_TEST_CASE(T_vcore_client_get_certificate_from_store_with_param_wrong)
                free(certData);
 }
 
+POSITIVE_TEST_CASE(T_vcore_client_get_certificate_list_from_store)
+{
+       CertSvcStoreCertList *achivedList;
+
+       size_t length = 0;
+       int result = vcore_client_get_certificate_list_from_store(VPN_STORE, ENABLED, &achivedList, &length);
+
+       BOOST_CHECK_EQUAL(result, CERTSVC_SUCCESS);
+       BOOST_CHECK_EQUAL(length, 1);
+
+       BOOST_CHECK_EQUAL(std::strcmp(achivedList->gname, ValidGname.c_str()), 0);
+       BOOST_CHECK_EQUAL(std::strcmp(achivedList->title, CommonName.c_str()), 0);
+
+       free(achivedList->gname);
+       free(achivedList->title);
+       free(achivedList);
+}
+
 POSITIVE_TEST_CASE(T_vcore_client_delete_certificate_from_store)
 {
        int result;