root/OpenSceneGraph/trunk/examples/osgunittests/osgunittests.cpp @ 7939

Revision 7939, 21.0 kB (checked in by robert, 7 years ago)

From Jose Delport, "attached is a version of osgunittests that does not give false alarms
for the case where q1 = -q2. The output of 'osgunittests quat' is now
much cleaner.
"

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1/* OpenSceneGraph example, osgunittests.
2*
3*  Permission is hereby granted, free of charge, to any person obtaining a copy
4*  of this software and associated documentation files (the "Software"), to deal
5*  in the Software without restriction, including without limitation the rights
6*  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7*  copies of the Software, and to permit persons to whom the Software is
8*  furnished to do so, subject to the following conditions:
9*
10*  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
11*  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12*  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
13*  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
14*  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
15*  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
16*  THE SOFTWARE.
17*/
18
19#include <osg/ArgumentParser>
20#include <osg/ApplicationUsage>
21
22#include <osg/Vec3>
23#include <osg/Matrix>
24#include <osg/Polytope>
25#include <osg/Timer>
26#include <osg/io_utils>
27
28#include <OpenThreads/Thread>
29
30#include "UnitTestFramework.h"
31#include "performance.h"
32
33#include <iostream>
34
35void testFrustum(double left,double right,double bottom,double top,double zNear,double zFar)
36{
37    osg::Matrix f;
38    f.makeFrustum(left,right,bottom,top,zNear,zFar);
39
40    double c_left=0;
41    double c_right=0;
42    double c_top=0;
43    double c_bottom=0;
44    double c_zNear=0;
45    double c_zFar=0;
46   
47   
48    std::cout << "testFrustum"<<f.getFrustum(c_left,c_right,c_bottom,c_top,c_zNear,c_zFar)<<std::endl;
49    std::cout << "  left = "<<left<<" compute "<<c_left<<std::endl;
50    std::cout << "  right = "<<right<<" compute "<<c_right<<std::endl;
51
52    std::cout << "  bottom = "<<bottom<<" compute "<<c_bottom<<std::endl;
53    std::cout << "  top = "<<top<<" compute "<<c_top<<std::endl;
54
55    std::cout << "  zNear = "<<zNear<<" compute "<<c_zNear<<std::endl;
56    std::cout << "  zFar = "<<zFar<<" compute "<<c_zFar<<std::endl;
57   
58    std::cout << std::endl;
59}
60
61void testOrtho(double left,double right,double bottom,double top,double zNear,double zFar)
62{
63    osg::Matrix f;
64    f.makeOrtho(left,right,bottom,top,zNear,zFar);
65
66    double c_left=0;
67    double c_right=0;
68    double c_top=0;
69    double c_bottom=0;
70    double c_zNear=0;
71    double c_zFar=0;
72
73    std::cout << "testOrtho "<< f.getOrtho(c_left,c_right,c_bottom,c_top,c_zNear,c_zFar) << std::endl;
74    std::cout << "  left = "<<left<<" compute "<<c_left<<std::endl;
75    std::cout << "  right = "<<right<<" compute "<<c_right<<std::endl;
76
77    std::cout << "  bottom = "<<bottom<<" compute "<<c_bottom<<std::endl;
78    std::cout << "  top = "<<top<<" compute "<<c_top<<std::endl;
79
80    std::cout << "  zNear = "<<zNear<<" compute "<<c_zNear<<std::endl;
81    std::cout << "  zFar = "<<zFar<<" compute "<<c_zFar<<std::endl;
82   
83    std::cout << std::endl;
84}
85
86void testPerspective(double fovy,double aspect,double zNear,double zFar)
87{
88    osg::Matrix f;
89    f.makePerspective(fovy,aspect,zNear,zFar);
90
91    double c_fovy=0;
92    double c_aspect=0;
93    double c_zNear=0;
94    double c_zFar=0;
95
96    std::cout << "testPerspective "<< f.getPerspective(c_fovy,c_aspect,c_zNear,c_zFar) << std::endl;
97    std::cout << "  fovy = "<<fovy<<" compute "<<c_fovy<<std::endl;
98    std::cout << "  aspect = "<<aspect<<" compute "<<c_aspect<<std::endl;
99
100    std::cout << "  zNear = "<<zNear<<" compute "<<c_zNear<<std::endl;
101    std::cout << "  zFar = "<<zFar<<" compute "<<c_zFar<<std::endl;
102   
103    std::cout << std::endl;
104}
105
106void testLookAt(const osg::Vec3& eye,const osg::Vec3& center,const osg::Vec3& up)
107{
108    osg::Matrix mv;
109    mv.makeLookAt(eye,center,up);
110   
111    osg::Vec3 c_eye,c_center,c_up;
112    mv.getLookAt(c_eye,c_center,c_up);
113   
114    std::cout << "testLookAt"<<std::endl;
115    std::cout << "  eye "<<eye<< " compute "<<c_eye<<std::endl;
116    std::cout << "  center "<<center<< " compute "<<c_center<<std::endl;
117    std::cout << "  up "<<up<< " compute "<<c_up<<std::endl;
118   
119    std::cout << std::endl;
120   
121}
122
123
124void testMatrixInvert(const osg::Matrix& matrix)
125{
126    //Invert it twice using the two inversion functions and view the results
127    osg::notify(osg::NOTICE)<<"testMatrixInvert("<<std::endl;
128    osg::notify(osg::NOTICE)<<matrix<<std::endl;
129    osg::notify(osg::NOTICE)<<")"<<std::endl;
130
131    osg::Matrix invM1_0;
132    invM1_0.invert(matrix);
133    osg::notify(osg::NOTICE)<<"Matrix::invert"<<std::endl;
134    osg::notify(osg::NOTICE)<<invM1_0<<std::endl;
135    osg::Matrix default_result = matrix*invM1_0;
136    osg::notify(osg::NOTICE)<<"matrix * invert="<<std::endl;
137    osg::notify(osg::NOTICE)<<default_result<<std::endl;;
138
139}
140
141void sizeOfTest()
142{
143  std::cout<<"sizeof(bool)=="<<sizeof(bool)<<std::endl;
144  std::cout<<"sizeof(char)=="<<sizeof(char)<<std::endl;
145  std::cout<<"sizeof(short)=="<<sizeof(short)<<std::endl;
146  std::cout<<"sizeof(short int)=="<<sizeof(short int)<<std::endl;
147  std::cout<<"sizeof(int)=="<<sizeof(int)<<std::endl;
148  std::cout<<"sizeof(long)=="<<sizeof(long)<<std::endl;
149  std::cout<<"sizeof(long int)=="<<sizeof(long int)<<std::endl;
150
151#if defined(_MSC_VER)
152  // long long isn't supported on VS6.0...
153  std::cout<<"sizeof(__int64)=="<<sizeof(__int64)<<std::endl;
154#else
155  std::cout<<"sizeof(long long)=="<<sizeof(long long)<<std::endl;
156#endif
157  std::cout<<"sizeof(float)=="<<sizeof(float)<<std::endl;
158  std::cout<<"sizeof(double)=="<<sizeof(double)<<std::endl;
159
160  std::cout<<"sizeof(std::istream::pos_type)=="<<sizeof(std::istream::pos_type)<<std::endl;
161  std::cout<<"sizeof(std::istream::off_type)=="<<sizeof(std::istream::off_type)<<std::endl;
162  std::cout<<"sizeof(OpenThreads::Mutex)=="<<sizeof(OpenThreads::Mutex)<<std::endl;
163
164  std::cout<<"sizeof(std::string)=="<<sizeof(std::string)<<std::endl;
165
166}
167
168/// Exercise the Matrix.getRotate function.
169/// Compare the output of:
170///  q1 * q2
171/// versus
172///  (mat(q1)*mat(q2)*scale).getRotate()
173/// for a range of rotations
174void testGetQuatFromMatrix(const osg::Vec3d& scale)
175{
176   
177    // Options
178   
179    // acceptable error range
180    double eps=1e-6;
181
182    // scale matrix
183    // To not test with scale, use 1,1,1
184    // Not sure if 0's or negative values are acceptable
185    osg::Matrixd scalemat;
186    scalemat.makeScale(scale);
187   
188    // range of rotations
189#if 1
190    // wide range
191    double rol1start = 0.0;
192    double rol1stop = 360.0;
193    double rol1step = 20.0;
194
195    double pit1start = 0.0;
196    double pit1stop = 90.0;
197    double pit1step = 20.0;
198
199    double yaw1start = 0.0;
200    double yaw1stop = 360.0;
201    double yaw1step = 20.0;
202
203    double rol2start = 0.0;
204    double rol2stop = 360.0;
205    double rol2step = 20.0;
206
207    double pit2start = 0.0;
208    double pit2stop = 90.0;
209    double pit2step = 20.0;
210
211    double yaw2start = 0.0;
212    double yaw2stop = 360.0;
213    double yaw2step = 20.0;
214#else
215    // focussed range
216    double rol1start = 0.0;
217    double rol1stop = 0.0;
218    double rol1step = 0.1;
219
220    double pit1start = 0.0;
221    double pit1stop = 5.0;
222    double pit1step = 5.0;
223
224    double yaw1start = 89.0;
225    double yaw1stop = 91.0;
226    double yaw1step = 0.1;
227
228    double rol2start = 0.0;
229    double rol2stop = 0.0;
230    double rol2step = 0.1;
231
232    double pit2start = 0.0;
233    double pit2stop = 0.0;
234    double pit2step = 0.1;
235
236    double yaw2start = 89.0;
237    double yaw2stop = 91.0;
238    double yaw2step = 0.1;
239#endif
240
241    std::cout << std::endl << "Starting testGetQuatFromMatrix, it can take a while ..." << std::endl;
242
243    osg::Timer_t tstart, tstop;
244    tstart = osg::Timer::instance()->tick();
245    int count=0;
246    for (double rol1 = rol1start; rol1 <= rol1stop; rol1 += rol1step) {
247        for (double pit1 = pit1start; pit1 <= pit1stop; pit1 += pit1step) {
248            for (double yaw1 = yaw1start; yaw1 <= yaw1stop; yaw1 += yaw1step) {
249                for (double rol2 = rol2start; rol2 <= rol2stop; rol2 += rol2step) {
250                    for (double pit2 = pit2start; pit2 <= pit2stop; pit2 += pit2step) {
251                        for (double yaw2 = yaw2start; yaw2 <= yaw2stop; yaw2 += yaw2step)
252                        {
253                            count++;
254                            // create two quats based on the roll, pitch and yaw values
255                            osg::Quat rot_quat1 =
256                            osg::Quat(osg::DegreesToRadians(rol1),osg::Vec3d(1,0,0),
257                                  osg::DegreesToRadians(pit1),osg::Vec3d(0,1,0),
258                                  osg::DegreesToRadians(yaw1),osg::Vec3d(0,0,1));
259
260                            osg::Quat rot_quat2 =
261                            osg::Quat(osg::DegreesToRadians(rol2),osg::Vec3d(1,0,0),
262                                  osg::DegreesToRadians(pit2),osg::Vec3d(0,1,0),
263                                  osg::DegreesToRadians(yaw2),osg::Vec3d(0,0,1));
264
265                            // create an output quat using quaternion math
266                            osg::Quat out_quat1;
267                            out_quat1 = rot_quat2 * rot_quat1;
268
269                            // create two matrices based on the input quats
270                            osg::Matrixd mat1,mat2;
271                            mat1.makeRotate(rot_quat1);
272                            mat2.makeRotate(rot_quat2);
273
274                            // create an output quat by matrix multiplication and getRotate
275                            osg::Matrixd out_mat;
276                            out_mat = mat2 * mat1;
277                            // add matrix scale for even more nastiness
278                            out_mat = out_mat * scalemat;
279                            osg::Quat out_quat2;
280                            out_quat2 = out_mat.getRotate();
281
282                            // If the quaternion W is <0, then we should reflect
283                            // to get it into the positive W.
284                            // Unfortunately, when W is very small (close to 0), the sign
285                            // does not really make sense because of precision problems
286                            // and the reflection might not work.
287                            if(out_quat1.w()<0) out_quat1 = out_quat1 * -1.0;
288                            if(out_quat2.w()<0) out_quat2 = out_quat2 * -1.0;
289
290                            // if the output quat length is not one
291                            // or if the components do not match,
292                            // something is amiss
293
294                            bool componentsOK = false;
295                            if ( ((fabs(out_quat1.x()-out_quat2.x())) < eps) &&
296                                 ((fabs(out_quat1.y()-out_quat2.y())) < eps) &&
297                                 ((fabs(out_quat1.z()-out_quat2.z())) < eps) &&
298                                 ((fabs(out_quat1.w()-out_quat2.w())) < eps) )
299                                    {
300                                componentsOK = true;
301                            }
302                            // We should also test for q = -q which is valid, so reflect
303                            // one quat.
304                            out_quat2 = out_quat2 * -1.0;
305                            if ( ((fabs(out_quat1.x()-out_quat2.x())) < eps) &&
306                                 ((fabs(out_quat1.y()-out_quat2.y())) < eps) &&
307                                 ((fabs(out_quat1.z()-out_quat2.z())) < eps) &&
308                                 ((fabs(out_quat1.w()-out_quat2.w())) < eps) )
309                            {
310                                componentsOK = true;
311                            }
312
313                            bool lengthOK = false;
314                            if (fabs(1.0-out_quat2.length()) < eps)
315                            {
316                                lengthOK = true;
317                            }
318
319                            if (!lengthOK || !componentsOK)
320                            {
321                                std::cout << "testGetQuatFromMatrix problem at: \n"
322                                      << " r1=" << rol1
323                                      << " p1=" << pit1
324                                      << " y1=" << yaw1
325                                      << " r2=" << rol2
326                                      << " p2=" << pit2
327                                      << " y2=" << yaw2 << "\n";
328                                std::cout << "quats:        " << out_quat1 << " length: " << out_quat1.length() << "\n";
329                                std::cout << "mats and get: " << out_quat2 << " length: " << out_quat2.length() << "\n\n";
330                            }
331                        }
332                    }
333                }
334            }
335        }
336    }
337    tstop = osg::Timer::instance()->tick();
338    double duration = osg::Timer::instance()->delta_s(tstart,tstop);
339    std::cout << "Time for testGetQuatFromMatrix with " << count << " iterations: " << duration << std::endl << std::endl;
340}
341
342void testQuatRotate(const osg::Vec3d& from, const osg::Vec3d& to)
343{
344    osg::Quat q_nicolas;
345    q_nicolas.makeRotate(from,to);
346   
347    osg::Quat q_original;
348    q_original.makeRotate_original(from,to);
349   
350    std::cout<<"osg::Quat::makeRotate("<<from<<", "<<to<<")"<<std::endl;
351    std::cout<<"  q_nicolas = "<<q_nicolas<<std::endl;
352    std::cout<<"  q_original = "<<q_original<<std::endl;
353    std::cout<<"  from * M4x4(q_nicolas) = "<<from * osg::Matrixd::rotate(q_nicolas)<<std::endl;
354    std::cout<<"  from * M4x4(q_original) = "<<from * osg::Matrixd::rotate(q_original)<<std::endl;
355}
356
357void testQuat(const osg::Vec3d& quat_scale)
358{
359    osg::Quat q1;
360    q1.makeRotate(osg::DegreesToRadians(30.0),0.0f,0.0f,1.0f);
361
362    osg::Quat q2;
363    q2.makeRotate(osg::DegreesToRadians(133.0),0.0f,1.0f,1.0f);
364
365    osg::Quat q1_2 = q1*q2;
366    osg::Quat q2_1 = q2*q1;
367
368    osg::Matrix m1 = osg::Matrix::rotate(q1);
369    osg::Matrix m2 = osg::Matrix::rotate(q2);
370   
371    osg::Matrix m1_2 = m1*m2;
372    osg::Matrix m2_1 = m2*m1;
373   
374    osg::Quat qm1_2;
375    qm1_2.set(m1_2);
376   
377    osg::Quat qm2_1;
378    qm2_1.set(m2_1);
379   
380    std::cout<<"q1*q2 = "<<q1_2<<std::endl;
381    std::cout<<"q2*q1 = "<<q2_1<<std::endl;
382    std::cout<<"m1*m2 = "<<qm1_2<<std::endl;
383    std::cout<<"m2*m1 = "<<qm2_1<<std::endl;
384
385
386    testQuatRotate(osg::Vec3d(1.0,0.0,0.0),osg::Vec3d(0.0,1.0,0.0));
387    testQuatRotate(osg::Vec3d(0.0,1.0,0.0),osg::Vec3d(1.0,0.0,0.0));
388    testQuatRotate(osg::Vec3d(0.0,0.0,1.0),osg::Vec3d(0.0,1.0,0.0));
389    testQuatRotate(osg::Vec3d(1.0,1.0,1.0),osg::Vec3d(1.0,0.0,0.0));
390    testQuatRotate(osg::Vec3d(1.0,0.0,0.0),osg::Vec3d(1.0,0.0,0.0));
391    testQuatRotate(osg::Vec3d(1.0,0.0,0.0),osg::Vec3d(-1.0,0.0,0.0));
392    testQuatRotate(osg::Vec3d(-1.0,0.0,0.0),osg::Vec3d(1.0,0.0,0.0));
393    testQuatRotate(osg::Vec3d(0.0,1.0,0.0),osg::Vec3d(0.0,-1.0,0.0));
394    testQuatRotate(osg::Vec3d(0.0,-1.0,0.0),osg::Vec3d(0.0,1.0,0.0));
395    testQuatRotate(osg::Vec3d(0.0,0.0,1.0),osg::Vec3d(0.0,0.0,-1.0));
396    testQuatRotate(osg::Vec3d(0.0,0.0,-1.0),osg::Vec3d(0.0,0.0,1.0));
397
398    // Test a range of rotations
399    testGetQuatFromMatrix(quat_scale);
400
401    // This is a specific test case for a matrix containing scale and rotation
402    osg::Matrix matrix(0.5, 0.0, 0.0, 0.0,
403                       0.0, 0.5, 0.0, 0.0,
404                       0.0, 0.0, 0.5, 0.0,
405                       1.0, 1.0, 1.0, 1.0);
406                       
407    osg::Quat quat;
408    matrix.get(quat);
409   
410    osg::notify(osg::NOTICE)<<"Matrix = "<<matrix<<"rotation = "<<quat<<", expected quat = (0,0,0,1)"<<std::endl;
411}
412
413class MyThread : public OpenThreads::Thread {
414public:
415  void run(void) { }
416};
417
418void testThreadInitAndExit()
419{
420    std::cout<<"******   Running thread start and delete test   ****** "<<std::endl;
421
422    {
423        MyThread thread;
424        thread.startThread();
425    }
426   
427    // add a sleep to allow the thread start to fall over it its going to.
428    OpenThreads::Thread::microSleep(500000);
429   
430    std::cout<<"pass    thread start and delete test"<<std::endl<<std::endl;
431}
432
433void testPolytope()
434{
435    osg::Polytope pt;
436    pt.setToBoundingBox(osg::BoundingBox(-1000, -1000, -1000, 1000, 1000, 1000));
437    bool bContains = pt.contains(osg::Vec3(0, 0, 0));
438    if (bContains)
439    {
440        std::cout<<"Polytope pt.contains(osg::Vec3(0, 0, 0)) has succeeded."<<std::endl;
441    }
442    else
443    {
444        std::cout<<"Polytope pt.contains(osg::Vec3(0, 0, 0)) has failed."<<std::endl;
445    }
446
447}
448
449
450int main( int argc, char** argv )
451{
452    osg::ArgumentParser arguments(&argc,argv);
453
454    // set up the usage document, in case we need to print out how to use this program.
455    arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the example which runs units tests.");
456    arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options]");
457    arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
458    arguments.getApplicationUsage()->addCommandLineOption("qt","Display qualified tests.");
459    arguments.getApplicationUsage()->addCommandLineOption("quat","Display extended quaternion tests.");
460    arguments.getApplicationUsage()->addCommandLineOption("quat_scaled sx sy sz","Display extended quaternion tests of pre scaled matrix.");
461    arguments.getApplicationUsage()->addCommandLineOption("sizeof","Display sizeof tests.");
462    arguments.getApplicationUsage()->addCommandLineOption("matrix","Display qualified tests.");
463    arguments.getApplicationUsage()->addCommandLineOption("performance","Display qualified tests.");
464 
465
466    if (arguments.argc()<=1)
467    {
468        arguments.getApplicationUsage()->write(std::cout,osg::ApplicationUsage::COMMAND_LINE_OPTION);
469        return 1;
470    }
471
472    bool printQualifiedTest = false;
473    while (arguments.read("qt")) printQualifiedTest = true;
474
475    bool printMatrixTest = false;
476    while (arguments.read("matrix")) printMatrixTest = true;
477
478    bool printSizeOfTest = false;
479    while (arguments.read("sizeof")) printSizeOfTest = true;
480
481    bool printQuatTest = false;
482    while (arguments.read("quat")) printQuatTest = true;
483
484    bool printPolytopeTest = false;
485    while (arguments.read("polytope")) printPolytopeTest = true;
486   
487    bool doTestThreadInitAndExit = false;
488    while (arguments.read("thread")) doTestThreadInitAndExit = true;
489
490    osg::Vec3d quat_scale(1.0,1.0,1.0);
491    while (arguments.read("quat_scaled", quat_scale.x(), quat_scale.y(), quat_scale.z() )) printQuatTest = true;
492
493    bool performanceTest = false;
494    while (arguments.read("p") || arguments.read("performance")) performanceTest = true;
495
496    // if user request help write it out to cout.
497    if (arguments.read("-h") || arguments.read("--help"))
498    {
499        std::cout<<arguments.getApplicationUsage()->getCommandLineUsage()<<std::endl;
500        arguments.getApplicationUsage()->write(std::cout,arguments.getApplicationUsage()->getCommandLineOptions());
501        return 1;
502    }
503
504    // any option left unread are converted into errors to write out later.
505    arguments.reportRemainingOptionsAsUnrecognized();
506
507    // report any errors if they have occurred when parsing the program arguments.
508    if (arguments.errors())
509    {
510        arguments.writeErrorMessages(std::cout);
511        return 1;
512    }
513   
514    if (printQuatTest)
515    {
516        testQuat(quat_scale);
517    }
518
519    if (printMatrixTest)
520    {
521        std::cout<<"******   Running matrix tests   ******"<<std::endl;
522
523        testFrustum(-1,1,-1,1,1,1000);
524        testFrustum(0,1,1,2,2.5,100000);
525
526        testOrtho(0,1,1,2,2.1,1000);
527        testOrtho(-1,10,1,20,2.5,100000);
528
529        testPerspective(20,1,1,1000);
530        testPerspective(90,2,1,1000);
531
532        testLookAt(osg::Vec3(10.0,4.0,2.0),osg::Vec3(10.0,4.0,2.0)+osg::Vec3(0.0,1.0,0.0),osg::Vec3(0.0,0.0,1.0));
533        testLookAt(osg::Vec3(10.0,4.0,2.0),osg::Vec3(10.0,4.0,2.0)+osg::Vec3(1.0,1.0,0.0),osg::Vec3(0.0,0.0,1.0));
534       
535        testMatrixInvert(osg::Matrix(0.999848,  -0.002700,  0.017242, -0.1715,
536                                     0,         0.987960,   0.154710,  0.207295,
537                                     -0.017452, -0.154687,  0.987809, -0.98239,
538                                     0,         0,          0,         1));
539
540        testMatrixInvert(osg::Matrix(0.999848,  -0.002700,  0.017242,   0.0,
541                                     0.0,        0.987960,   0.154710,   0.0,
542                                     -0.017452, -0.154687,  0.987809,   0.0,
543                                     -0.1715,    0.207295,  -0.98239,   1.0));
544
545    }
546   
547    if (printSizeOfTest)
548    {
549        std::cout<<"**** sizeof() tests  ******"<<std::endl;
550       
551        sizeOfTest();
552
553        std::cout<<std::endl;
554    }
555
556
557    if (performanceTest)
558    {
559        std::cout<<"**** performance tests  ******"<<std::endl;
560       
561        runPerformanceTests();
562    }
563
564    if (printPolytopeTest)
565    {
566        testPolytope();
567    }
568
569
570    if (printQualifiedTest)
571    {
572         std::cout<<"*****   Qualified Tests  ******"<<std::endl;
573
574         osgUtx::QualifiedTestPrinter printer;
575         osgUtx::TestGraph::instance().root()->accept( printer );   
576         std::cout<<std::endl;
577    }
578
579    if (doTestThreadInitAndExit)
580    {
581        testThreadInitAndExit();
582    }
583
584    std::cout<<"******   Running tests   ******"<<std::endl;
585
586    // Global Data or Context
587    osgUtx::TestContext ctx;
588    osgUtx::TestRunner runner( ctx );
589    runner.specify("root");
590
591    osgUtx::TestGraph::instance().root()->accept( runner );
592
593    return 0;
594}
Note: See TracBrowser for help on using the browser.