RUNNER_ASSERT_ERRNO_MSG(0 == ret, "shm_unlink failed");
}
+RUNNER_TEST(shm04_performance_test_shm_open) {
+ const char *shmName = "shm04_testName";
+
+ // clean up environment
+ shm_unlink(shmName);
+
+ RUNNER_PERF_TEST_BEGIN(10);
+
+ for (int i=0; i<1000; ++i) {
+ int fd = shm_open(shmName, O_CREAT | O_RDWR, 0666);
+ RUNNER_ASSERT_ERRNO_MSG(fd >= 0, "shm_open failed");
+ close(fd);
+ shm_unlink(shmName);
+ }
+
+ RUNNER_PERF_TEST_END();
+}
+
+RUNNER_TEST(shm05_performance_test_shm_open_wrapper) {
+ const char *shmName = "shm05_testName";
+
+ AppInstallHelper appa("shm05_app");
+ ScopedInstaller reqa(appa);
+
+ // clean up environment
+ shm_unlink(shmName);
+
+ std::string appId = appa.getAppId();
+
+ RUNNER_PERF_TEST_BEGIN(10);
+
+ for (int i=0; i<1000; ++i) {
+ int fd = security_manager_shm_open(shmName, O_CREAT | O_RDWR, 0666, appId.c_str());
+ RUNNER_ASSERT_ERRNO_MSG(fd >= 0, "security_manager_shm_open failed: " << fd << " iteration " << i);
+ close(fd);
+ shm_unlink(shmName);
+ }
+
+ RUNNER_PERF_TEST_END();
+}
+