CERT_TEST_LEAF, // test certificate signed with CERT_TEST_IM_CA
};
-template <typename F, typename... Args>
-void assert_result(int expected, F&& func, Args... args)
-{
- int ret = func(args...);
- RUNNER_ASSERT_MSG_BT(ret == expected, "Expected " << expected << " got: " << ret);
-}
-
-template <typename F, typename... Args>
-void assert_positive(F&& func, Args... args)
-{
- assert_result(CKMC_ERROR_NONE, std::move(func), args...);
-}
-
-template <typename F, typename... Args>
-void assert_invalid_param(F&& func, Args... args)
-{
- assert_result(CKMC_ERROR_INVALID_PARAMETER, std::move(func), args...);
-}
-
-template <typename T>
-size_t list_size(const T* list)
-{
- size_t size = 0;
- while(list) {
- list = list->next;
- size++;
- }
- return size;
-}
-
typedef std::unique_ptr<ckmc_cert_s, void (*)(ckmc_cert_s*)> CertPtr;
typedef std::unique_ptr<ckmc_cert_list_s, void (*)(ckmc_cert_list_s*)> CertListPtr;
typedef std::unique_ptr<ckmc_alias_list_s, void (*)(ckmc_alias_list_s*)> AliasListPtr;
#include <unordered_set>
#include <memory>
#include <ckm/ckm-type.h>
+#include <ckmc/ckmc-error.h>
+#include <tests_common.h>
void switch_to_storage_user(const char* label);
void switch_to_storage_ocsp_user(const char* label);
+// RUNNER_ASSERT wrappers
+template <typename F, typename... Args>
+void assert_result(int expected, F&& func, Args... args)
+{
+ int ret = func(args...);
+ RUNNER_ASSERT_MSG_BT(ret == expected, "Expected " << expected << " got: " << ret);
+}
+
+template <typename F, typename... Args>
+void assert_positive(F&& func, Args... args)
+{
+ assert_result(CKMC_ERROR_NONE, std::move(func), args...);
+}
+
+template <typename F, typename... Args>
+void assert_invalid_param(F&& func, Args... args)
+{
+ assert_result(CKMC_ERROR_INVALID_PARAMETER, std::move(func), args...);
+}
+
+
+// list operations
+template <typename T>
+size_t list_size(const T* list)
+{
+ size_t size = 0;
+ while(list) {
+ list = list->next;
+ size++;
+ }
+ return size;
+}
+
+
// service lifecycle management
enum ServiceIdx {
LISTENER,