Change-Id: I8aa6a784e672957c717790e755b8b2de0274ba99
main.cpp
)
+FIND_PACKAGE (Threads)
+
INCLUDE_DIRECTORIES(
${PROJECT_SOURCE_DIR}/src/common
..
TARGET_LINK_LIBRARIES(${TARGET_CKM_TESTS}
${TARGET_CKM_TEST_COMMON}
${COMMON_TARGET_TEST}
+ ${CMAKE_THREAD_LIBS_INIT}
)
INSTALL(TARGETS ${TARGET_CKM_TESTS} DESTINATION bin)
#include <string>
#include <vector>
#include <unordered_map>
+#include <thread>
#include <dpl/test/test_runner.h>
#include <ckm-common.h>
encrypted);
});
}
+
+/////////////////////////////////////////
+// Mulithreaded test for synchronous API
+/////////////////////////////////////////
+RUNNER_TEST(TED_3000_muliple_threads, SyncEnv)
+{
+ std::vector<std::thread> threads;
+ threads.reserve(10);
+ for(unsigned i = 0; i < 10;++i)
+ threads.emplace_back([]{ testEncryptDecryptBigData({CKMC_ALGO_AES_CBC, 256}); });
+ for (auto& thread : threads)
+ thread.join();
+}