Fix build for boost 1.71.0
[platform/core/security/libwebappenc.git] / tests / test-common.h
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  * @file        test-common.h
18  * @author      Kyungwook Tak (k.tak@samsung.com)
19  * @version     1.0
20  */
21 #pragma once
22
23 #include <vector>
24
25 #include <boost/test/unit_test.hpp>
26 #include <boost/test/unit_test_log.hpp>
27 #include <boost/test/results_reporter.hpp>
28
29 #include "colour_log_formatter.h"
30
31 #include "types.h"
32
33 /* fixtures should be declared on outside of namespace */
34 struct TestConfig {
35         TestConfig()
36         {
37                 boost::unit_test::unit_test_log.set_threshold_level(boost::unit_test::log_test_units);
38                 boost::unit_test::results_reporter::set_level(boost::unit_test::SHORT_REPORT);
39                 boost::unit_test::unit_test_log.set_formatter(new Wae::Test::colour_log_formatter);
40
41                 BOOST_TEST_MESSAGE("run test program with --run_test=SYSTEM on sdb root turned ON");
42                 BOOST_TEST_MESSAGE("run test program with --run_test=USER   on sdb root turned OFF");
43         }
44 };
45
46 namespace Wae {
47 namespace Test {
48
49 std::string bytes_to_hex(const std::vector<unsigned char> &bytes);
50 std::string bytes_to_hex(const unsigned char *ptr, size_t len);
51 std::string bytes_to_hex(const raw_buffer_s *rb);
52 std::vector<unsigned char> bytearr_to_vec(const unsigned char *ptr, size_t len);
53 std::vector<unsigned char> bytearr_to_vec(const raw_buffer_s *);
54
55 } // namespace Test
56 } // namespace Wae