Subversion Repositories gelsvn

Rev

Rev 660 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 660 Rev 661
Line 210... Line 210...
210
    success += x2[0] == xii1 - xi1 && x2[1] == xii2 - xi2;    
210
    success += x2[0] == xii1 - xi1 && x2[1] == xii2 - xi2;    
211
  }
211
  }
212
  if(success != 8)
212
  if(success != 8)
213
  {
213
  {
214
    cout << "Failure in test of Vec2d Assignment operators";
214
    cout << "Failure in test of Vec2d Assignment operators";
-
 
215
    system ("pause");
215
    return 1;
216
    return 1;
216
  }
217
  }
217
  success = 0;
218
  success = 0;
218
 
219
 
219
  // Unary operators
220
  // Unary operators
Line 224... Line 225...
224
    success += x1[0] == -xi1 && x1[1] == -xi2;
225
    success += x1[0] == -xi1 && x1[1] == -xi2;
225
  }
226
  }
226
  if(success != 1)
227
  if(success != 1)
227
  {
228
  {
228
    cout << "Failure in test of Vec2d Unary operators";
229
    cout << "Failure in test of Vec2d Unary operators";
-
 
230
    system ("pause");
229
    return 1;
231
    return 1;
230
  }
232
  }
231
  success = 0;
233
  success = 0;
232
 
234
 
233
  // Binary operators
235
  // Binary operators
Line 280... Line 282...
280
    success += abs(x3[0] - xi1/xi3) < 1.0e-15 && abs(x3[1] - xi2/xi3) < 1.0e-15;
282
    success += abs(x3[0] - xi1/xi3) < 1.0e-15 && abs(x3[1] - xi2/xi3) < 1.0e-15;
281
  } 
283
  } 
282
  if(success != 11)
284
  if(success != 11)
283
  {
285
  {
284
    cout << "Failure in test of Vec2d Binary operators";
286
    cout << "Failure in test of Vec2d Binary operators";
-
 
287
    system ("pause");
285
    return 1;
288
    return 1;
286
  }
289
  }
287
  success = 0;
290
  success = 0;
288
 
291
 
289
  // Vector operations
292
  // Vector operations
Line 347... Line 350...
347
               && abs(z - (xi1*xiii2 - xi2*xiii1)/x) < 1.0e-15;
350
               && abs(z - (xi1*xiii2 - xi2*xiii1)/x) < 1.0e-15;
348
  }
351
  }
349
  if(success != 11)
352
  if(success != 11)
350
  {
353
  {
351
    cout << "Failure in test of Vec2d Vector operations";
354
    cout << "Failure in test of Vec2d Vector operations";
-
 
355
    system ("pause");
352
    return 1;
356
    return 1;
353
  }
357
  }
354
  success = 0;
358
  success = 0;
355
  
359
  
356
  ////////////////////////////////////////////////
360
  ////////////////////////////////////////////////
Line 382... Line 386...
382
    success += x5[0] == xiiii && x5[1] == xiiii;
386
    success += x5[0] == xiiii && x5[1] == xiiii;
383
  }
387
  }
384
  if(success != 5)
388
  if(success != 5)
385
  {
389
  {
386
    cout << "Failure in test of Vec2f Constructors";
390
    cout << "Failure in test of Vec2f Constructors";
-
 
391
    system ("pause");
387
    return 1;
392
    return 1;
388
  }
393
  }
389
  success = 0;
394
  success = 0;
390
 
395
 
391
  // Data manipulation
396
  // Data manipulation
Line 414... Line 419...
414
    success += temp == x1.max_coord();
419
    success += temp == x1.max_coord();
415
  }
420
  }
416
  if(success != 5)
421
  if(success != 5)
417
  {
422
  {
418
    cout << "Failure in test of Vec2f Data manipulation";
423
    cout << "Failure in test of Vec2f Data manipulation";
-
 
424
    system ("pause");
419
    return 1;
425
    return 1;
420
  }
426
  }
421
  success = 0;
427
  success = 0;
422
 
428
 
423
  // Comparison operators
429
  // Comparison operators
Line 462... Line 468...
462
    }
468
    }
463
  }
469
  }
464
  if(success != 14)
470
  if(success != 14)
465
  {
471
  {
466
    cout << "Failure in test of Vec2f Comparison operators";
472
    cout << "Failure in test of Vec2f Comparison operators";
-
 
473
    system ("pause");
467
    return 1;
474
    return 1;
468
  }
475
  }
469
  success = 0;
476
  success = 0;
470
  
477
  
471
  // Assignment operators
478
  // Assignment operators
Line 515... Line 522...
515
    success += x2[0] == xii1 - xi1 && x2[1] == xii2 - xi2;    
522
    success += x2[0] == xii1 - xi1 && x2[1] == xii2 - xi2;    
516
  }
523
  }
517
  if(success != 8)
524
  if(success != 8)
518
  {
525
  {
519
    cout << "Failure in test of Vec2f Assignment operators";
526
    cout << "Failure in test of Vec2f Assignment operators";
-
 
527
    system ("pause");
520
    return 1;
528
    return 1;
521
  }
529
  }
522
  success = 0;
530
  success = 0;
523
 
531
 
524
  // Unary operators
532
  // Unary operators
Line 529... Line 537...
529
    success += x1[0] == -xi1 && x1[1] == -xi2;
537
    success += x1[0] == -xi1 && x1[1] == -xi2;
530
  }
538
  }
531
  if(success != 1)
539
  if(success != 1)
532
  {
540
  {
533
    cout << "Failure in test of Vec2f Unary operators";
541
    cout << "Failure in test of Vec2f Unary operators";
-
 
542
    system ("pause");
534
    return 1;
543
    return 1;
535
  }
544
  }
536
  success = 0;
545
  success = 0;
537
 
546
 
538
  // Binary operators
547
  // Binary operators
Line 585... Line 594...
585
    success += abs(x3[0] - xi1/xi3) < 1.0e-15 && abs(x3[1] - xi2/xi3) < 1.0e-15;
594
    success += abs(x3[0] - xi1/xi3) < 1.0e-15 && abs(x3[1] - xi2/xi3) < 1.0e-15;
586
  } 
595
  } 
587
  if(success != 11)
596
  if(success != 11)
588
  {
597
  {
589
    cout << "Failure in test of Vec2f Binary operators";
598
    cout << "Failure in test of Vec2f Binary operators";
-
 
599
    system ("pause");
590
    return 1;
600
    return 1;
591
  }
601
  }
592
  success = 0;
602
  success = 0;
593
 
603
 
594
  // Vector operations
604
  // Vector operations
Line 652... Line 662...
652
               && abs(z - (xi1*xiii2 - xi2*xiii1)/x) < 1.0e-15;
662
               && abs(z - (xi1*xiii2 - xi2*xiii1)/x) < 1.0e-15;
653
  }
663
  }
654
  if(success != 11)
664
  if(success != 11)
655
  {
665
  {
656
    cout << "Failure in test of Vec2f Vector operations";
666
    cout << "Failure in test of Vec2f Vector operations";
-
 
667
    system ("pause");
657
    return 1;
668
    return 1;
658
  }
669
  }
659
  success = 0;
670
  success = 0;
660
 
671
 
661
  ////////////////////////////////////////////////
672
  ////////////////////////////////////////////////
Line 696... Line 707...
696
*/
707
*/
697
  }
708
  }
698
  if(success != 2)
709
  if(success != 2)
699
  {
710
  {
700
    cout << "Failure in test of Vec2i Constructors";
711
    cout << "Failure in test of Vec2i Constructors";
-
 
712
    system ("pause");
701
    return 1;
713
    return 1;
702
  }
714
  }
703
  success = 0;
715
  success = 0;
704
 
716
 
705
  // Data manipulation
717
  // Data manipulation
Line 728... Line 740...
728
    success += temp == x1.max_coord();
740
    success += temp == x1.max_coord();
729
  }
741
  }
730
  if(success != 5)
742
  if(success != 5)
731
  {
743
  {
732
    cout << "Failure in test of Vec2i Data manipulation";
744
    cout << "Failure in test of Vec2i Data manipulation";
-
 
745
    system ("pause");
733
    return 1;
746
    return 1;
734
  }
747
  }
735
  success = 0;
748
  success = 0;
736
 
749
 
737
  // Comparison operators
750
  // Comparison operators
Line 776... Line 789...
776
    }
789
    }
777
  }
790
  }
778
  if(success != 14)
791
  if(success != 14)
779
  {
792
  {
780
    cout << "Failure in test of Vec2i Comparison operators";
793
    cout << "Failure in test of Vec2i Comparison operators";
-
 
794
    system ("pause");
781
    return 1;
795
    return 1;
782
  }
796
  }
783
  success = 0;
797
  success = 0;
784
  
798
  
785
  // Assignment operators
799
  // Assignment operators