Merge branch 'ckm' into tizen
[platform/core/test/security-tests.git] / src / common / sm_label_monitor.cpp
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *    Licensed under the Apache License, Version 2.0 (the "License");
5  *    you may not use this file except in compliance with the License.
6  *    You may obtain a copy of the License at
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *    Unless required by applicable law or agreed to in writing, software
11  *    distributed under the License is distributed on an "AS IS" BASIS,
12  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *    See the License for the specific language governing permissions and
14  *    limitations under the License.
15  */
16
17 #include "sm_label_monitor.h"
18
19 #include <dpl/test/test_runner.h>
20
21 namespace SecurityManagerTest {
22
23 LabelMonitor::LabelMonitor()
24     : m_monitor(nullptr)
25 {
26     int result = security_manager_app_labels_monitor_init(&m_monitor);
27     RUNNER_ASSERT_MSG(static_cast<lib_retcode>(result) == SECURITY_MANAGER_SUCCESS,
28                       "security_manager_app_labels_monitor_init failed with " << result);
29     RUNNER_ASSERT_MSG(m_monitor != nullptr,
30                       "security_manager_app_labels_monitor_init didn't allocate memory");
31 }
32
33 LabelMonitor::~LabelMonitor()
34 {
35     security_manager_app_labels_monitor_finish(m_monitor);
36 }
37
38 } // namespace SecurityManagerTest