File size: 7,214 Bytes
68ce2fc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-    */
/* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */

/*

  Author(s):  Anton Deguet
  Created on: 2003-08-20

  (C) Copyright 2003-2026 Johns Hopkins University (JHU), All Rights
  Reserved.

--- begin cisst license - do not edit ---

This software is provided "as is" under an open source license, with
no warranty.  The complete license can be found in license.txt and
http://www.cisst.org/cisst/license.txt.

--- end cisst license ---
*/


#include <cppunit/TestCase.h>
#include <cppunit/extensions/HelperMacros.h>

#include <cisstVector/vctFixedSizeVectorRef.h>
#include <cisstVector/vctFixedSizeVector.h>

class vctFixedSizeVectorRefTest : public CppUnit::TestFixture
{
    CPPUNIT_TEST_SUITE(vctFixedSizeVectorRefTest);

    CPPUNIT_TEST(TestAssignmentDouble);
    CPPUNIT_TEST(TestAssignmentFloat);
    CPPUNIT_TEST(TestAssignmentInt);

    CPPUNIT_TEST(TestAccessMethodsDouble);
    CPPUNIT_TEST(TestAccessMethodsFloat);
    CPPUNIT_TEST(TestAccessMethodsInt);

    CPPUNIT_TEST(TestSoViOperationsDouble);
    CPPUNIT_TEST(TestSoViOperationsFloat);
    CPPUNIT_TEST(TestSoViOperationsInt);

    CPPUNIT_TEST(TestSoViViOperationsDouble);
    CPPUNIT_TEST(TestSoViViOperationsFloat);
    CPPUNIT_TEST(TestSoViViOperationsInt);

    CPPUNIT_TEST(TestVioViOperationsDouble);
    CPPUNIT_TEST(TestVioViOperationsFloat);
    CPPUNIT_TEST(TestVioViOperationsInt);

    CPPUNIT_TEST(TestVoViViOperationsDouble);
    CPPUNIT_TEST(TestVoViViOperationsFloat);
    CPPUNIT_TEST(TestVoViViOperationsInt);

    CPPUNIT_TEST(TestCrossProductDouble);
    CPPUNIT_TEST(TestCrossProductFloat);
    CPPUNIT_TEST(TestCrossProductInt);

    CPPUNIT_TEST(TestDotProductDouble);
    CPPUNIT_TEST(TestDotProductFloat);
    CPPUNIT_TEST(TestDotProductInt);

    CPPUNIT_TEST(TestVoViOperationsDouble);
    CPPUNIT_TEST(TestVoViOperationsFloat);
    CPPUNIT_TEST(TestVoViOperationsInt);

    CPPUNIT_TEST(TestVoViSiOperationsDouble);
    CPPUNIT_TEST(TestVoViSiOperationsFloat);
    CPPUNIT_TEST(TestVoViSiOperationsInt);

    CPPUNIT_TEST(TestVoSiViOperationsDouble);
    CPPUNIT_TEST(TestVoSiViOperationsFloat);
    CPPUNIT_TEST(TestVoSiViOperationsInt);

    CPPUNIT_TEST(TestVioSiOperationsDouble);
    CPPUNIT_TEST(TestVioSiOperationsFloat);
    CPPUNIT_TEST(TestVioSiOperationsInt);

    CPPUNIT_TEST(TestVioOperationsDouble);
    CPPUNIT_TEST(TestVioOperationsFloat);
    CPPUNIT_TEST(TestVioOperationsInt);

    CPPUNIT_TEST(TestSoViSiOperationsDouble);
    CPPUNIT_TEST(TestSoViSiOperationsFloat);
    CPPUNIT_TEST(TestSoViSiOperationsInt);

    CPPUNIT_TEST(TestIteratorsDouble);
    CPPUNIT_TEST(TestIteratorsFloat);
    CPPUNIT_TEST(TestIteratorsInt);

    CPPUNIT_TEST(TestSTLFunctionsDouble);
    CPPUNIT_TEST(TestSTLFunctionsFloat);
    CPPUNIT_TEST(TestSTLFunctionsInt);

    CPPUNIT_TEST(TestNormalizationDouble);
    CPPUNIT_TEST(TestNormalizationFloat);

    CPPUNIT_TEST(TestRandomTemporaryRefDouble);
    CPPUNIT_TEST(TestRandomTemporaryRefFloat);
    CPPUNIT_TEST(TestRandomTemporaryRefInt);

    CPPUNIT_TEST_SUITE_END();

 public:
    void setUp(void) {
    }

    void tearDown(void) {
    }

   /*! Test assignment methods */
    template<class _elementType>
        void TestAssignment(void);
    void TestAssignmentDouble(void);
    void TestAssignmentFloat(void);
    void TestAssignmentInt(void);

    /*! Test access methods */
    template<class _elementType>
        void TestAccessMethods(void);
    void TestAccessMethodsDouble(void);
    void TestAccessMethodsFloat(void);
    void TestAccessMethodsInt(void);

    /*! Test SoVi operations */
    template<class _elementType>
        void TestSoViOperations(void);
    void TestSoViOperationsDouble(void);
    void TestSoViOperationsFloat(void);
    void TestSoViOperationsInt(void);

    /*! Test SoViVi operations */
    template<class _elementType>
        void TestSoViViOperations(void);
    void TestSoViViOperationsDouble(void);
    void TestSoViViOperationsFloat(void);
    void TestSoViViOperationsInt(void);

    /*! Test VioVi operations */
    template<class _elementType>
        void TestVioViOperations(void);
    void TestVioViOperationsDouble(void);
    void TestVioViOperationsFloat(void);
    void TestVioViOperationsInt(void);

    /*! Test VoViVi operations */
    template<class _elementType>
        void TestVoViViOperations(void);
    void TestVoViViOperationsDouble(void);
    void TestVoViViOperationsFloat(void);
    void TestVoViViOperationsInt(void);

    /*! Test cross product */
    template<class _elementType>
        void TestCrossProduct(void);
    void TestCrossProductDouble(void);
    void TestCrossProductFloat(void);
    void TestCrossProductInt(void);

    /*! Test dor product */
    template<class _elementType>
        void TestDotProduct(void);
    void TestDotProductDouble(void);
    void TestDotProductFloat(void);
    void TestDotProductInt(void);

    /*! Test VoVi operations */
    template<class _elementType>
        void TestVoViOperations(void);
    void TestVoViOperationsDouble(void);
    void TestVoViOperationsFloat(void);
    void TestVoViOperationsInt(void);

    /*! Test VoViSi operations */
    template<class _elementType>
        void TestVoViSiOperations(void);
    void TestVoViSiOperationsDouble(void);
    void TestVoViSiOperationsFloat(void);
    void TestVoViSiOperationsInt(void);

    /*! Test VoSiVi operations */
    template<class _elementType>
        void TestVoSiViOperations(void);
    void TestVoSiViOperationsDouble(void);
    void TestVoSiViOperationsFloat(void);
    void TestVoSiViOperationsInt(void);

    /*! Test VioSi operations */
    template<class _elementType>
        void TestVioSiOperations(void);
    void TestVioSiOperationsDouble(void);
    void TestVioSiOperationsFloat(void);
    void TestVioSiOperationsInt(void);

    /*! Test Vio operations */
    template<class _elementType>
        void TestVioOperations(void);
    void TestVioOperationsDouble(void);
    void TestVioOperationsFloat(void);
    void TestVioOperationsInt(void);

    /*! Test SoViSi operations */
    template<class _elementType>
        void TestSoViSiOperations(void);
    void TestSoViSiOperationsDouble(void);
    void TestSoViSiOperationsFloat(void);
    void TestSoViSiOperationsInt(void);

    /*! Test iterators */
    template<class _elementType>
        void TestIterators(void);
    void TestIteratorsDouble(void);
    void TestIteratorsFloat(void);
    void TestIteratorsInt(void);

    /*! Test STL Functions */
    template<class _elementType>
        void TestSTLFunctions(void);
    void TestSTLFunctionsDouble(void);
    void TestSTLFunctionsFloat(void);
    void TestSTLFunctionsInt(void);

    /*! Test Normalization */
    template<class _elementType>
        void TestNormalization(void);
    void TestNormalizationDouble(void);
    void TestNormalizationFloat(void);

    /*! Test randomization of temporary vector refs */
    template<class _elementType>
        void TestRandomTemporaryRef(void);
    void TestRandomTemporaryRefDouble(void);
    void TestRandomTemporaryRefFloat(void);
    void TestRandomTemporaryRefInt(void);
};