Fix possible memory leaks in Logic initialization
[platform/core/security/cynara.git] / test / TestEventListenerProxy.h
1 /*
2  * Copyright (c) 2014 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  * @file        test/TestEventListenerProxy.h
18  * @author      Aleksander Zdyb <a.zdyb@samsung.com>
19  * @version     1.0
20  * @brief       Proxy for ::testing::TestEventListener
21  */
22
23 #ifndef TEST_TESTEVENTLISTENERPROXY_H_
24 #define TEST_TESTEVENTLISTENERPROXY_H_
25
26 #include <gtest/gtest.h>
27
28 namespace Cynara {
29
30 using namespace testing;
31
32 class TestEventListenerProxy : public TestEventListener
33 {
34 public:
35     explicit TestEventListenerProxy(TestEventListener *originalListener);
36     virtual ~TestEventListenerProxy();
37
38     virtual void OnTestProgramStart(const UnitTest &unit_test);
39     virtual void OnTestIterationStart(const UnitTest &unit_test, int iteration);
40     virtual void OnEnvironmentsSetUpStart(const UnitTest &unit_test);
41     virtual void OnEnvironmentsSetUpEnd(const UnitTest &unit_test);
42     virtual void OnTestCaseStart(const TestCase &test_case);
43     virtual void OnTestStart(const TestInfo &test_info);
44     virtual void OnTestPartResult(const TestPartResult &result);
45     virtual void OnTestEnd(const TestInfo &test_info);
46     virtual void OnTestCaseEnd(const TestCase &test_case);
47     virtual void OnEnvironmentsTearDownStart(const UnitTest &unit_test);
48     virtual void OnEnvironmentsTearDownEnd(const UnitTest &unit_test);
49     virtual void OnTestIterationEnd(const UnitTest &unit_test, int iteration);
50     virtual void OnTestProgramEnd(const UnitTest &unit_test);
51
52 protected:
53     TestEventListener *originalListener() {
54         return m_originalListener;
55     }
56
57 private:
58     TestEventListener *m_originalListener;
59 };
60
61 } /* namespace Cynara */
62
63 #endif /* TEST_TESTEVENTLISTENERPROXY_H_ */