/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2014-2015 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
<< " Expected result: " << expectedResult);
}
+void addUser(const UserRequest &request, lib_retcode expectedResult)
+{
+ int result = security_manager_user_add(request.get());
+ RUNNER_ASSERT_MSG((lib_retcode)result == expectedResult,
+ "adding user returned wrong value."
+ << " UserRequest: [ " << request << "];"
+ << " Result: " << result << ";"
+ << " Expected result: " << expectedResult);
+}
+
+void deleteUser(const UserRequest &request, lib_retcode expectedResult)
+{
+ int result = security_manager_user_delete(request.get());
+ RUNNER_ASSERT_MSG((lib_retcode)result == expectedResult,
+ "deleting user returned wrong value."
+ << " UserRequest: [ " << request << "];"
+ << " Result: " << result << ";"
+ << " Expected result: " << expectedResult);
+}
+
} // namespace Api
} // namespace SecurityManagerTest
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2014-2015 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#define SECURITY_MANAGER_TEST_API
#include <sm_request.h>
+#include <sm_user_request.h>
#include <security-manager.h>
void setProcessGroups(const char *appId, lib_retcode expectedResult = SECURITY_MANAGER_SUCCESS);
void dropProcessPrivileges(lib_retcode expectedResult = SECURITY_MANAGER_SUCCESS);
void prepareApp(const char *appId, lib_retcode expectedResult = SECURITY_MANAGER_SUCCESS);
+void addUser(const UserRequest &request, lib_retcode expectedResult = SECURITY_MANAGER_SUCCESS);
+void deleteUser(const UserRequest &request, lib_retcode expectedResult = SECURITY_MANAGER_SUCCESS);
} // namespace Api