summaryrefslogtreecommitdiff
path: root/CIAO/connectors/dds4ccm/tests/Policies/dw_qos_test.cpp
blob: 6e4278e1b0447c3d3f8424d22e702f9608a969f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
// $Id$

#include "dw_qos_test.h"

#include "dur_qos_test.h"
#include "dur_service_qos_test.h"
#include "deadline_qos_test.h"
#include "lat_budget_qos_test.h"
#include "liveliness_qos_test.h"
#include "reliability_qos_test.h"
#include "dest_order_qos_test.h"
#include "hist_qos_test.h"
#include "resource_limits_qos_test.h"
#include "transport_prio_qos_test.h"
#include "lifespan_qos_test.h"
#include "user_data_qos_test.h"
#include "ownership_qos_test.h"
#include "ownership_strength_qos_test.h"
#include "wr_lifecycle_qos_test.h"

DatawriterPolicyTest::DatawriterPolicyTest ()
{
}

int
DatawriterPolicyTest::run ()
{
  int ret = 0;
  try
    {
      ::DDS::DataWriterQos policy;
      DDS_DataWriterQos dds_policy_org, dds_policy;

      dds_policy_org = DDS_DATAWRITER_QOS_DEFAULT;

      policy <<= dds_policy_org;
      dds_policy <<= policy;

      if (!DurabilityPolicyTest::check (dds_policy.durability,
                                        policy.durability))
        {
          ACE_ERROR ((LM_ERROR, "ERROR DATAWRITER : "
                                "Error in DurabilityQosPolicy.\n"));
          ++ret;
        }

      if (!DurabilityServicePolicyTest::check (dds_policy.durability_service,
                                               policy.durability_service))
        {
          ACE_ERROR ((LM_ERROR, "ERROR DATAWRITER : "
                                "Error in DurabilityServiceQosPolicy.\n"));
          ++ret;
        }

      if (!DeadlinePolicyTest::check (dds_policy.deadline,
                                      policy.deadline))
        {
          ACE_ERROR ((LM_ERROR, "ERROR DATAWRITER : "
                                "Error in DeadlineQosPolicy.\n"));
          ++ret;
        }

      if (!LatencyBudgetPolicyTest::check (dds_policy.latency_budget,
                                           policy.latency_budget))
        {
          ACE_ERROR ((LM_ERROR, "ERROR DATAWRITER : "
                                "Error in LatencyBudgetQosPolicy.\n"));
          ++ret;
        }

      if (!LivelinessPolicyTest::check (dds_policy.liveliness,
                                        policy.liveliness))
        {
          ACE_ERROR ((LM_ERROR, "ERROR DATAWRITER : "
                                "Error in LivelinessQosPolicy.\n"));
          ++ret;
        }

      if (!ReliabilityPolicyTest::check (dds_policy.reliability,
                                         policy.reliability))
        {
          ACE_ERROR ((LM_ERROR, "ERROR DATAWRITER : "
                                "Error in ReliabilityQosPolicy.\n"));
          ++ret;
        }

      if (!DestinationOrderPolicyTest::check (dds_policy.destination_order,
                                             policy.destination_order))
        {
          ACE_ERROR ((LM_ERROR, "ERROR DATAWRITER : "
                                "Error in DestinationOrderQosPolicy.\n"));
          ++ret;
        }

      if (!HistoryPolicyTest::check (dds_policy.history,
                                     policy.history))
        {
          ACE_ERROR ((LM_ERROR, "ERROR DATAWRITER : "
                                "Error in HistoryQosPolicy.\n"));
          ++ret;
        }

      if (!ResourceLimitsPolicyTest::check (dds_policy.resource_limits,
                                     policy.resource_limits))
        {
          ACE_ERROR ((LM_ERROR, "ERROR DATAWRITER : "
                                "Error in ResourceLimitsQosPolicy.\n"));
          ++ret;
        }

      if (!TransportPriorityPolicyTest::check (dds_policy.transport_priority,
                                              policy.transport_priority))
        {
          ACE_ERROR ((LM_ERROR, "ERROR DATAWRITER : "
                                "Error in TransportPriorityQosPolicy.\n"));
          ++ret;
        }

      if (!LifespanPolicyTest::check (dds_policy.lifespan,
                                      policy.lifespan))
        {
          ACE_ERROR ((LM_ERROR, "ERROR DATAWRITER : "
                                "Error in LifespanQosPolicy.\n"));
          ++ret;
        }

      if (!UserDataPolicyTest::check (dds_policy.user_data, policy.user_data))
        {
          ACE_ERROR ((LM_ERROR, "ERROR DATAWRITER : "
                                "Error in UserDataQosPolicy.\n"));
          ++ret;
        }

      if (!OwnershipPolicyTest::check (dds_policy.ownership,
                                       policy.ownership))
        {
          ACE_ERROR ((LM_ERROR, "ERROR DATAWRITER : "
                                "Error in OwnershipQosPolicy.\n"));
          ++ret;
        }

      if (!OwnershipStrengthPolicyTest::check (dds_policy.ownership_strength,
                                       policy.ownership_strength))
        {
          ACE_ERROR ((LM_ERROR, "ERROR DATAWRITER : "
                                "Error in OwnershipStrengthQosPolicy.\n"));
          ++ret;
        }

      if (!WriterDataLifecyclePolicyTest::check (dds_policy.writer_data_lifecycle,
                                                 policy.writer_data_lifecycle))
        {
          ACE_ERROR ((LM_ERROR, "ERROR DATAWRITER : "
                                "Error in WriterDataLifecycleQosPolicy.\n"));
          ++ret;
        }
    }
  catch (...)
    {
      ACE_ERROR ((LM_ERROR, "ERROR DATAWRITER: Unexpected exception caught."));
      return -1;
    }
  return ret;
}