From 4d8ddd98e77db7f1981939d60f9a3960fa8fa38a Mon Sep 17 00:00:00 2001 From: Kyungwook Tak Date: Tue, 16 Aug 2016 14:05:16 +0900 Subject: [PATCH] CKM: Add TC for new API (ckmc_alias_new) Change-Id: I349f1e0741a0e3711bc4523305e43d211ccefe4e Signed-off-by: Kyungwook Tak --- src/ckm/unprivileged/capi-testcases.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/ckm/unprivileged/capi-testcases.cpp b/src/ckm/unprivileged/capi-testcases.cpp index 4b82520..8c41bfe 100644 --- a/src/ckm/unprivileged/capi-testcases.cpp +++ b/src/ckm/unprivileged/capi-testcases.cpp @@ -594,7 +594,23 @@ RUNNER_TEST(T3035_remove_symmetric_key_C_API) } -RUNNER_TEST(T3036_deinit_C_API) +RUNNER_TEST(T3036_alias_new_C_API) +{ + char *full_alias = NULL; + std::string owner_id = "iocma412ovyc"; + std::string alias = "fvyuweq27c"; + + std::string full_alias_str = owner_id + ckmc_owner_id_separator + alias; + + int temp = ckmc_alias_new(owner_id.c_str(), alias.c_str(), &full_alias); + std::unique_ptr p(full_alias, ::free); + RUNNER_ASSERT_MSG(temp == CKMC_ERROR_NONE, CKMCReadableError(temp)); + RUNNER_ASSERT_MSG(full_alias_str == full_alias, + "Invalid full alias. expected(" << full_alias_str << + ") actual(" << full_alias << ")"); +} + +RUNNER_TEST(T3037_deinit_C_API) { int temp; -- 2.7.4