security-server tests on DPL framework
[platform/core/test/security-tests.git] / tests / security-server-tests / test.h
1 /*
2  * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
3  */
4 /*
5  * @file    test.h
6  * @author  Bumjin Im (bj.im@samsung.com)
7  * @author  Mariusz Domanski (m.domanski@samsung.com)
8  * @version 1.0
9  * @brief   Test cases for security server
10  */
11
12 #ifndef SECURITY_SERVER_TESTS_TEST_H
13 #define    SECURITY_SERVER_TESTS_TEST_H
14
15 #include <dlog.h>
16 #include <sstream>
17 #include <iomanip>
18
19 #define SECURITY_SERVER_TEST_SOCK_PATH "/tmp/.security-server-test"
20
21 #ifdef LOG_TAG
22     #undef LOG_TAG
23 #endif // LOG_TAG
24 #ifndef LOG_TAG
25     #define LOG_TAG "SEC_SRV_TESTS"
26 #endif // LOG_TAG
27
28 void printhex(unsigned char *data, int size)
29 {
30     int i;
31     std::ostringstream msg;
32     msg << std::hex << std::setfill('0') << std::uppercase;
33     for(i=0;i<size;i++)
34     {
35         msg << std::setw(2) << static_cast<int>(data[i]) << " ";
36         if(((i+1) % 16) == 0 && i != 0)
37             msg << std::endl;
38     }
39     msg << std::endl;
40     LOGD("%s", msg.str().c_str());
41 }
42
43 #endif // SECURITY_SERVER_TESTS_TEST_H