3 #include <test_common.h>
4 #include <ckm/ckm-type.h>
12 DBFixture(const char *db_fname);
14 constexpr static const char* m_default_name = "name";
15 constexpr static const char* m_default_label = "label";
17 // ::::::::::::::::::::::::: helper methods :::::::::::::::::::::::::
18 static void generate_name(unsigned int id, CKM::Name & output);
19 static void generate_label(unsigned int id, CKM::Label & output);
20 static CKM::DB::Row create_default_row(CKM::DataType type = CKM::DataType::BINARY_DATA);
21 static CKM::DB::Row create_default_row(const CKM::Name &name,
22 const CKM::Label &label,
23 CKM::DataType type = CKM::DataType::BINARY_DATA);
24 static void compare_row(const CKM::DB::Row &lhs, const CKM::DB::Row &rhs);
26 // ::::::::::::::::::::::::: time measurement :::::::::::::::::::::::::
27 void performance_start(const char *operation_name);
28 void performance_stop(long num_operations_performed);
30 // ::::::::::::::::::::::::: DB :::::::::::::::::::::::::
31 void generate_perf_DB(unsigned int num_name, unsigned int num_label);
32 long add_full_access_rights(unsigned int num_name, unsigned int num_names_per_label);
33 void check_DB_integrity(const CKM::DB::Row &rowPattern);
35 void insert_row(const CKM::Name &name, const CKM::Label &owner_label);
36 void delete_row(const CKM::Name &name, const CKM::Label &owner_label);
37 void add_permission(const CKM::Name &name, const CKM::Label &owner_label, const CKM::Label &accessor_label);
38 void read_row_expect_success(const CKM::Name &name, const CKM::Label &owner_label);
43 double performance_get_time_elapsed_ms();
45 constexpr static const char* m_crypto_db_fname = "/tmp/testme.db";
46 std::string m_operation;
47 std::chrono::high_resolution_clock::time_point m_start_time, m_end_time;