Merge pull request #5 from intothevoid/master
[KDIS.git] / KDIS / Tests / UnitTests / PDU_ProtocolFamily6.cpp
blobe9e33cc507b9f09eacad9af96829802886c20413
1 #include <iostream>
2 #include "gtest/gtest.h"
4 #include "KDIS/KDefines.h"
5 #if DIS_VERSION > 5
6 #include "KDIS/PDU/Distributed_Emission_Regeneration/IFF_PDU.h"
7 #include "KDIS/PDU/Distributed_Emission_Regeneration/SEES_PDU.h"
8 #include "KDIS/PDU/Distributed_Emission_Regeneration/Underwater_Acoustic_PDU.h"
10 #include "KDIS/PDU/Entity_Info_Interaction/Collision_Elastic_PDU.h"
11 #include "KDIS/PDU/Entity_Info_Interaction/Entity_State_Update_PDU.h"
13 #include "KDIS/PDU/Entity_Management/Aggregate_State_PDU.h"
14 #include "KDIS/PDU/Entity_Management/IsGroupOf_PDU.h"
15 #include "KDIS/PDU/Entity_Management/IsPartOf_PDU.h"
16 #include "KDIS/PDU/Entity_Management/Transfer_Control_Request_PDU.h"
18 #include "KDIS/PDU/Live_Entity/Appearance_PDU.h"
19 #include "KDIS/PDU/Live_Entity/Articulated_Parts_PDU.h"
20 #include "KDIS/PDU/Live_Entity/LE_Detonation_PDU.h"
21 #include "KDIS/PDU/Live_Entity/LE_Fire_PDU.h"
22 #include "KDIS/PDU/Live_Entity/TSPI_PDU.h"
24 #include "KDIS/PDU/Simulation_Management_With_Reliability/Acknowledge_R_PDU.h"
25 #include "KDIS/PDU/Simulation_Management_With_Reliability/Action_Request_R_PDU.h"
26 #include "KDIS/PDU/Simulation_Management_With_Reliability/Action_Response_R_PDU.h"
27 #include "KDIS/PDU/Simulation_Management_With_Reliability/Comment_R_PDU.h"
28 #include "KDIS/PDU/Simulation_Management_With_Reliability/Create_Entity_R_PDU.h"
29 #include "KDIS/PDU/Simulation_Management_With_Reliability/Data_Query_R_PDU.h"
30 #include "KDIS/PDU/Simulation_Management_With_Reliability/Data_R_PDU.h"
31 #include "KDIS/PDU/Simulation_Management_With_Reliability/Event_Report_R_PDU.h"
32 #include "KDIS/PDU/Simulation_Management_With_Reliability/Record_Query_R_PDU.h"
33 #include "KDIS/PDU/Simulation_Management_With_Reliability/Record_R_PDU.h"
34 #include "KDIS/PDU/Simulation_Management_With_Reliability/Remove_Entity_R_PDU.h"
35 #include "KDIS/PDU/Simulation_Management_With_Reliability/Set_Data_R_PDU.h"
36 #include "KDIS/PDU/Simulation_Management_With_Reliability/Set_Record_R_PDU.h"
37 #include "KDIS/PDU/Simulation_Management_With_Reliability/Start_Resume_R_PDU.h"
38 #include "KDIS/PDU/Simulation_Management_With_Reliability/Stop_Freeze_R_PDU.h"
40 #include "KDIS/PDU/Synthetic_Environment/Areal_Object_State_PDU.h"
41 #include "KDIS/PDU/Synthetic_Environment/Environmental_Process_PDU.h"
42 #include "KDIS/PDU/Synthetic_Environment/Gridded_Data_PDU.h"
43 #include "KDIS/PDU/Synthetic_Environment/Linear_Object_State_PDU.h"
44 #include "KDIS/PDU/Synthetic_Environment/Point_Object_State_PDU.h"
46 using namespace KDIS;
47 using namespace PDU;
48 using namespace DATA_TYPE::ENUMS;
50 //////////////////////////////////////////////////////////////////////////
51 // Distributed Emission Regeneration
52 //////////////////////////////////////////////////////////////////////////
54 TEST(PDU_ProtocolFamily6, IFF_PDU)
56 IFF_PDU pdu;
57 EXPECT_EQ(Distributed_Emission_Regeneration, pdu.GetProtocolFamily());
60 TEST(PDU_ProtocolFamily6, SEES_PDU)
62 SEES_PDU pdu;
63 EXPECT_EQ(Distributed_Emission_Regeneration, pdu.GetProtocolFamily());
66 TEST(PDU_ProtocolFamily6, Underwater_Acoustic_PDU)
68 Underwater_Acoustic_PDU pdu;
69 EXPECT_EQ(Distributed_Emission_Regeneration, pdu.GetProtocolFamily());
72 //////////////////////////////////////////////////////////////////////////
73 // Entity Info Interaction
74 //////////////////////////////////////////////////////////////////////////
76 TEST(PDU_ProtocolFamily6, Collision_Elastic_PDU)
78 Collision_Elastic_PDU pdu;
79 EXPECT_EQ(Entity_Information_Interaction, pdu.GetProtocolFamily());
82 TEST(PDU_ProtocolFamily6, Entity_State_Update_PDU)
84 Entity_State_Update_PDU pdu;
85 EXPECT_EQ(Entity_Information_Interaction, pdu.GetProtocolFamily());
88 //////////////////////////////////////////////////////////////////////////
89 // Entity Management
90 //////////////////////////////////////////////////////////////////////////
92 TEST(PDU_ProtocolFamily5, Aggregate_State_PDU)
94 Aggregate_State_PDU pdu;
95 EXPECT_EQ(EntityManagement, pdu.GetProtocolFamily());
98 TEST(PDU_ProtocolFamily5, IsGroupOf_PDU)
100 IsGroupOf_PDU pdu;
101 EXPECT_EQ(EntityManagement, pdu.GetProtocolFamily());
104 TEST(PDU_ProtocolFamily5, IsPartOf_PDU)
106 IsPartOf_PDU pdu;
107 EXPECT_EQ(EntityManagement, pdu.GetProtocolFamily());
110 TEST(PDU_ProtocolFamily5, Transfer_Control_Request_PDU)
112 Transfer_Control_Request_PDU pdu;
113 EXPECT_EQ(EntityManagement, pdu.GetProtocolFamily());
116 //////////////////////////////////////////////////////////////////////////
117 // Live Entity
118 //////////////////////////////////////////////////////////////////////////
120 TEST(PDU_ProtocolFamily5, Appearance_PDU)
122 Appearance_PDU pdu;
123 EXPECT_EQ(LiveEntity, pdu.GetProtocolFamily());
126 TEST(PDU_ProtocolFamily5, Articulated_Parts_PDU)
128 Articulated_Parts_PDU pdu;
129 EXPECT_EQ(LiveEntity, pdu.GetProtocolFamily());
132 TEST(PDU_ProtocolFamily5, LE_Detonation_PDU)
134 LE_Detonation_PDU pdu;
135 EXPECT_EQ(LiveEntity, pdu.GetProtocolFamily());
138 TEST(PDU_ProtocolFamily5, LE_Fire_PDU)
140 LE_Fire_PDU pdu;
141 EXPECT_EQ(LiveEntity, pdu.GetProtocolFamily());
144 TEST(PDU_ProtocolFamily5, TSPI_PDU)
146 TSPI_PDU pdu;
147 EXPECT_EQ(LiveEntity, pdu.GetProtocolFamily());
150 //////////////////////////////////////////////////////////////////////////
151 // Simulation Management With Reliability
152 //////////////////////////////////////////////////////////////////////////
154 TEST(PDU_ProtocolFamily6, Acknowledge_R_PDU)
156 Acknowledge_R_PDU pdu;
157 EXPECT_EQ(SimulationManagementwithReliability, pdu.GetProtocolFamily());
160 TEST(PDU_ProtocolFamily6, Action_Request_R_PDU)
162 Action_Request_R_PDU pdu;
163 EXPECT_EQ(SimulationManagementwithReliability, pdu.GetProtocolFamily());
166 TEST(PDU_ProtocolFamily6, Action_Response_R_PDU)
168 Action_Response_R_PDU pdu;
169 EXPECT_EQ(SimulationManagementwithReliability, pdu.GetProtocolFamily());
172 TEST(PDU_ProtocolFamily6, Comment_R_PDU)
174 Comment_R_PDU pdu;
175 EXPECT_EQ(SimulationManagementwithReliability, pdu.GetProtocolFamily());
178 TEST(PDU_ProtocolFamily6, Create_Entity_R_PDU)
180 Create_Entity_R_PDU pdu;
181 EXPECT_EQ(SimulationManagementwithReliability, pdu.GetProtocolFamily());
184 TEST(PDU_ProtocolFamily6, Data_Query_R_PDU)
186 Data_Query_R_PDU pdu;
187 EXPECT_EQ(SimulationManagementwithReliability, pdu.GetProtocolFamily());
190 TEST(PDU_ProtocolFamily6, Data_R_PDU)
192 Data_R_PDU pdu;
193 EXPECT_EQ(SimulationManagementwithReliability, pdu.GetProtocolFamily());
196 TEST(PDU_ProtocolFamily6, Event_Report_R_PDU)
198 Event_Report_R_PDU pdu;
199 EXPECT_EQ(SimulationManagementwithReliability, pdu.GetProtocolFamily());
202 TEST(PDU_ProtocolFamily6, Record_Query_R_PDU)
204 Record_Query_R_PDU pdu;
205 EXPECT_EQ(SimulationManagementwithReliability, pdu.GetProtocolFamily());
208 TEST(PDU_ProtocolFamily6, Record_R_PDU)
210 Record_R_PDU pdu;
211 EXPECT_EQ(SimulationManagementwithReliability, pdu.GetProtocolFamily());
214 TEST(PDU_ProtocolFamily6, Remove_Entity_R_PDU)
216 Remove_Entity_R_PDU pdu;
217 EXPECT_EQ(SimulationManagementwithReliability, pdu.GetProtocolFamily());
220 TEST(PDU_ProtocolFamily6, Set_Data_R_PDU)
222 Set_Data_R_PDU pdu;
223 EXPECT_EQ(SimulationManagementwithReliability, pdu.GetProtocolFamily());
226 TEST(PDU_ProtocolFamily6, Set_Record_R_PDU)
228 Set_Record_R_PDU pdu;
229 EXPECT_EQ(SimulationManagementwithReliability, pdu.GetProtocolFamily());
232 TEST(PDU_ProtocolFamily6, Start_Resume_R_PDU)
234 Start_Resume_R_PDU pdu;
235 EXPECT_EQ(SimulationManagementwithReliability, pdu.GetProtocolFamily());
238 TEST(PDU_ProtocolFamily6, Stop_Freeze_R_PDU)
240 Stop_Freeze_R_PDU pdu;
241 EXPECT_EQ(SimulationManagementwithReliability, pdu.GetProtocolFamily());
244 //////////////////////////////////////////////////////////////////////////
245 // Synthetic Environment
246 //////////////////////////////////////////////////////////////////////////
248 TEST(PDU_ProtocolFamily6, Areal_Object_State_PDU)
250 Areal_Object_State_PDU pdu;
251 EXPECT_EQ(SyntheticEnvironment, pdu.GetProtocolFamily());
254 TEST(PDU_ProtocolFamily6, Environmental_Process_PDU)
256 Environmental_Process_PDU pdu;
257 EXPECT_EQ(SyntheticEnvironment, pdu.GetProtocolFamily());
260 TEST(PDU_ProtocolFamily6, Gridded_Data_PDU)
262 Gridded_Data_PDU pdu;
263 EXPECT_EQ(SyntheticEnvironment, pdu.GetProtocolFamily());
266 TEST(PDU_ProtocolFamily6, Linear_Object_State_PDU)
268 Linear_Object_State_PDU pdu;
269 EXPECT_EQ(SyntheticEnvironment, pdu.GetProtocolFamily());
272 TEST(PDU_ProtocolFamily6, Point_Object_State_PDU)
274 Point_Object_State_PDU pdu;
275 EXPECT_EQ(SyntheticEnvironment, pdu.GetProtocolFamily());
278 #endif