b7c3a40ad9d73e2f076f409efa6b75bcb4491c26
[profile/ivi/genivi/genivi-audio-manager.git] / AudioManagerDaemon / test / CommonFunctions.h
1 /*
2  * CommonHeaders.h
3  *
4  *  Created on: Dec 10, 2011
5  *      Author: christian
6  */
7
8 #ifndef COMMONHEADERS_H_
9 #define COMMONHEADERS_H_
10
11 #include <gtest/gtest.h>
12 #include "DatabaseHandler.h"
13
14 using namespace am;
15
16 class CommonFunctions
17 {
18 public:
19
20         static std::vector<am_ConnectionFormat_e> getStandardConnectionFormatList();
21         static std::vector<am_SoundProperty_s> getStandardSoundPropertyList();
22         static std::vector<am_MainSoundProperty_s> getStandardMainSoundPropertyList();
23         static std::vector<bool> getStandardConvertionMatrix();
24         bool compareSource(std::vector<am_Source_s>::iterator listIterator, const am_Source_s& sourceData);
25         bool compareSink(std::vector<am_Sink_s>::iterator listIterator, const am_Sink_s& sinkData);
26         bool compareGateway(std::vector<am_Gateway_s>::iterator listIterator, const am_Gateway_s& gatewayData);
27         bool compareGateway1(const am_Gateway_s gateway1, const am_Gateway_s gatewayData);
28         bool compareSinkMainSink(std::vector<am_SinkType_s>::iterator listIterator, const std::vector<am_Sink_s>& sinkList);
29         bool compareSinkMainSource(std::vector<am_SourceType_s>::iterator listIterator, const std::vector<am_Source_s>& sourceList);
30         void createSink(am_Sink_s& sink) const;
31         void createSource(am_Source_s& source) const ;
32         void createDomain(am_Domain_s& domain) const;
33         void createGateway(am_Gateway_s& gateway);
34         void createConnection(am_Connection_s& connection) const ;
35         void createMainConnection(am_MainConnection_s& mainConnection, am_Route_s route) const;
36         void connectionList2RoutingList(std::vector<am_RoutingElement_s>& routingList, const std::vector<am_Connection_s>& connectionList);
37
38         struct sortBySinkID
39         {
40                 bool operator()(const am_RoutingElement_s & a, const am_RoutingElement_s & b) const
41                 {
42                         return (a.sinkID < b.sinkID);
43                 }
44         };
45
46         struct sortByConnectionFormat
47         {
48                 bool operator()(const am_ConnectionFormat_e & a, const am_ConnectionFormat_e & b) const
49                 {
50                         return (a < b);
51                 }
52         };
53
54         struct sortByMainSoundProperty
55         {
56                 bool operator()(const am_MainSoundProperty_s & a, const am_MainSoundProperty_s & b) const
57                 {
58                         return (a.type > b.type);
59                 }
60         };
61
62         struct sortBySoundProperty
63         {
64                 bool operator()(const am_SoundProperty_s & a, const am_SoundProperty_s & b) const
65                 {
66                         return (a.type < b.type);
67                 }
68         };
69 };
70
71
72
73
74 #endif /* COMMONHEADERS_H_ */