* Changed some unit tests so that they're clearer about where the failures come from.
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 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797
diff --git a/test/FTCharmap-Test.cpp b/test/FTCharmap-Test.cpp
index a29a7db..5cfb8f5 100644
--- a/test/FTCharmap-Test.cpp
+++ b/test/FTCharmap-Test.cpp
@@ -42,8 +42,8 @@ class FTCharmapTest : public CppUnit::TestCase
void testConstructor()
{
- CPPUNIT_ASSERT( charmap->Error() == 0);
- CPPUNIT_ASSERT( charmap->Encoding() == ft_encoding_unicode);
+ CPPUNIT_ASSERT_EQUAL(0, charmap->Error());
+ CPPUNIT_ASSERT_EQUAL(ft_encoding_unicode, charmap->Encoding());
}
@@ -51,13 +51,13 @@ class FTCharmapTest : public CppUnit::TestCase
{
CPPUNIT_ASSERT( charmap->CharMap( ft_encoding_unicode));
- CPPUNIT_ASSERT( charmap->Error() == 0);
- CPPUNIT_ASSERT( charmap->Encoding() == ft_encoding_unicode);
+ CPPUNIT_ASSERT_EQUAL(0, charmap->Error());
+ CPPUNIT_ASSERT_EQUAL(ft_encoding_unicode, charmap->Encoding());
CPPUNIT_ASSERT( !charmap->CharMap( ft_encoding_johab));
- CPPUNIT_ASSERT( charmap->Error() == 0x06); // invalid argument
- CPPUNIT_ASSERT( charmap->Encoding() == ft_encoding_unicode);
+ CPPUNIT_ASSERT_EQUAL(0x06, charmap->Error()); // invalid argument
+ CPPUNIT_ASSERT_EQUAL(ft_encoding_unicode, charmap->Encoding());
}
@@ -65,23 +65,23 @@ class FTCharmapTest : public CppUnit::TestCase
{
charmap->CharMap( ft_encoding_johab);
- CPPUNIT_ASSERT( charmap->Error() == 0x06); // invalid argument
- CPPUNIT_ASSERT( charmap->GlyphListIndex( CHARACTER_CODE_A) == 0);
- CPPUNIT_ASSERT( charmap->GlyphListIndex( BIG_CHARACTER_CODE) == 0);
- CPPUNIT_ASSERT( charmap->GlyphListIndex( NULL_CHARACTER_CODE) == 0);
+ CPPUNIT_ASSERT_EQUAL(0x06, charmap->Error()); // invalid argument
+ CPPUNIT_ASSERT_EQUAL(0U, charmap->GlyphListIndex( CHARACTER_CODE_A));
+ CPPUNIT_ASSERT_EQUAL(0U, charmap->GlyphListIndex( BIG_CHARACTER_CODE));
+ CPPUNIT_ASSERT_EQUAL(0U, charmap->GlyphListIndex( NULL_CHARACTER_CODE));
charmap->CharMap( ft_encoding_unicode);
- CPPUNIT_ASSERT( charmap->Error() == 0);
- CPPUNIT_ASSERT( charmap->GlyphListIndex( CHARACTER_CODE_A) == 0);
- CPPUNIT_ASSERT( charmap->GlyphListIndex( BIG_CHARACTER_CODE) == 0);
- CPPUNIT_ASSERT( charmap->GlyphListIndex( NULL_CHARACTER_CODE) == 0);
+ CPPUNIT_ASSERT_EQUAL(0, charmap->Error());
+ CPPUNIT_ASSERT_EQUAL(0U, charmap->GlyphListIndex( CHARACTER_CODE_A));
+ CPPUNIT_ASSERT_EQUAL(0U, charmap->GlyphListIndex( BIG_CHARACTER_CODE));
+ CPPUNIT_ASSERT_EQUAL(0U, charmap->GlyphListIndex( NULL_CHARACTER_CODE));
// Check that the error flag is reset.
charmap->CharMap( ft_encoding_johab);
- CPPUNIT_ASSERT( charmap->Error() == 0x06); // invalid argument
+ CPPUNIT_ASSERT_EQUAL(0x06, charmap->Error()); // invalid argument
charmap->CharMap( ft_encoding_unicode);
- CPPUNIT_ASSERT( charmap->Error() == 0);
+ CPPUNIT_ASSERT_EQUAL(0, charmap->Error());
}
@@ -89,32 +89,32 @@ class FTCharmapTest : public CppUnit::TestCase
{
charmap->CharMap( ft_encoding_johab);
- CPPUNIT_ASSERT( charmap->Error() == 0x06); // invalid argument
- CPPUNIT_ASSERT( charmap->FontIndex( CHARACTER_CODE_A) == FONT_INDEX_OF_A);
- CPPUNIT_ASSERT( charmap->FontIndex( BIG_CHARACTER_CODE) == BIG_FONT_INDEX);
- CPPUNIT_ASSERT( charmap->FontIndex( NULL_CHARACTER_CODE) == NULL_FONT_INDEX);
+ CPPUNIT_ASSERT_EQUAL(0x06, charmap->Error()); // invalid argument
+ CPPUNIT_ASSERT_EQUAL(FONT_INDEX_OF_A, charmap->FontIndex( CHARACTER_CODE_A));
+ CPPUNIT_ASSERT_EQUAL(BIG_FONT_INDEX, charmap->FontIndex( BIG_CHARACTER_CODE));
+ CPPUNIT_ASSERT_EQUAL(NULL_FONT_INDEX, charmap->FontIndex( NULL_CHARACTER_CODE));
charmap->CharMap( ft_encoding_unicode);
- CPPUNIT_ASSERT( charmap->Error() == 0);
+ CPPUNIT_ASSERT_EQUAL(0, charmap->Error());
- CPPUNIT_ASSERT( charmap->FontIndex( CHARACTER_CODE_A) == FONT_INDEX_OF_A);
- CPPUNIT_ASSERT( charmap->FontIndex( BIG_CHARACTER_CODE) == BIG_FONT_INDEX);
- CPPUNIT_ASSERT( charmap->FontIndex( NULL_CHARACTER_CODE) == NULL_FONT_INDEX);
+ CPPUNIT_ASSERT_EQUAL(FONT_INDEX_OF_A, charmap->FontIndex( CHARACTER_CODE_A));
+ CPPUNIT_ASSERT_EQUAL(BIG_FONT_INDEX, charmap->FontIndex( BIG_CHARACTER_CODE));
+ CPPUNIT_ASSERT_EQUAL(NULL_FONT_INDEX, charmap->FontIndex( NULL_CHARACTER_CODE));
}
void testInsertCharacterIndex()
{
- CPPUNIT_ASSERT( charmap->GlyphListIndex( CHARACTER_CODE_A) == 0);
- CPPUNIT_ASSERT( charmap->FontIndex( CHARACTER_CODE_A) == FONT_INDEX_OF_A);
+ CPPUNIT_ASSERT_EQUAL(0U, charmap->GlyphListIndex( CHARACTER_CODE_A));
+ CPPUNIT_ASSERT_EQUAL(FONT_INDEX_OF_A, charmap->FontIndex( CHARACTER_CODE_A));
- charmap->InsertIndex( CHARACTER_CODE_A, 69);
- CPPUNIT_ASSERT( charmap->FontIndex( CHARACTER_CODE_A) == FONT_INDEX_OF_A);
- CPPUNIT_ASSERT( charmap->GlyphListIndex( CHARACTER_CODE_A) == 69);
+ charmap->InsertIndex(69, CHARACTER_CODE_A);
+ CPPUNIT_ASSERT_EQUAL(FONT_INDEX_OF_A, charmap->FontIndex( CHARACTER_CODE_A));
+ CPPUNIT_ASSERT_EQUAL(69U, charmap->GlyphListIndex( CHARACTER_CODE_A));
- charmap->InsertIndex( CHARACTER_CODE_G, 999);
- CPPUNIT_ASSERT( charmap->GlyphListIndex( CHARACTER_CODE_G) == 999);
+ charmap->InsertIndex(999, CHARACTER_CODE_G);
+ CPPUNIT_ASSERT_EQUAL(999U, charmap->GlyphListIndex( CHARACTER_CODE_G));
}
void setUp()
diff --git a/test/FTFace-Test.cpp b/test/FTFace-Test.cpp
index 0f09355..bc2fcd3 100644
--- a/test/FTFace-Test.cpp
+++ b/test/FTFace-Test.cpp
@@ -28,70 +28,70 @@ class FTFaceTest : public CppUnit::TestCase
void testOpenFace()
{
FTFace face1( BAD_FONT_FILE);
- CPPUNIT_ASSERT( face1.Error() == 0x06);
+ CPPUNIT_ASSERT_EQUAL( face1.Error(), 0x06);
FTFace face2( GOOD_FONT_FILE);
- CPPUNIT_ASSERT( face2.Error() == 0);
+ CPPUNIT_ASSERT_EQUAL( face2.Error(), 0);
}
void testOpenFaceFromMemory()
{
FTFace face1( (unsigned char*)100, 0);
- CPPUNIT_ASSERT( face1.Error() == 0x02);
+ CPPUNIT_ASSERT_EQUAL( face1.Error(), 0x02);
FTFace face2( HPGCalc_pfb.dataBytes, HPGCalc_pfb.numBytes);
- CPPUNIT_ASSERT( face2.Error() == 0);
+ CPPUNIT_ASSERT_EQUAL( face2.Error(), 0);
}
void testAttachFile()
{
CPPUNIT_ASSERT( !testFace->Attach( TYPE1_AFM_FILE));
- CPPUNIT_ASSERT( testFace->Error() == 0x07); // unimplemented feature
+ CPPUNIT_ASSERT_EQUAL( testFace->Error(), 0x07); // unimplemented feature
FTFace test( TYPE1_FONT_FILE);
- CPPUNIT_ASSERT( test.Error() == 0);
+ CPPUNIT_ASSERT_EQUAL( test.Error(), 0);
CPPUNIT_ASSERT( test.Attach( TYPE1_AFM_FILE));
- CPPUNIT_ASSERT( test.Error() == 0);
+ CPPUNIT_ASSERT_EQUAL( test.Error(), 0);
}
void testAttachMemoryData()
{
CPPUNIT_ASSERT( !testFace->Attach((unsigned char*)100, 0));
- CPPUNIT_ASSERT( testFace->Error() == 0x07); // unimplemented feature
+ CPPUNIT_ASSERT_EQUAL( testFace->Error(), 0x07); // unimplemented feature
FTFace test( TYPE1_FONT_FILE);
- CPPUNIT_ASSERT( test.Error() == 0);
+ CPPUNIT_ASSERT_EQUAL( test.Error(), 0);
CPPUNIT_ASSERT( test.Attach( HPGCalc_afm.dataBytes, HPGCalc_afm.numBytes));
- CPPUNIT_ASSERT( test.Error() == 0);
+ CPPUNIT_ASSERT_EQUAL( test.Error(), 0);
}
void testGlyphCount()
{
- CPPUNIT_ASSERT( testFace->GlyphCount() == 14099);
+ CPPUNIT_ASSERT_EQUAL( testFace->GlyphCount(), 14099U);
}
void testSetFontSize()
{
FTSize size = testFace->Size( FONT_POINT_SIZE, RESOLUTION);
- CPPUNIT_ASSERT( testFace->Error() == 0);
+ CPPUNIT_ASSERT_EQUAL( testFace->Error(), 0);
}
void testGetCharmapList()
{
- CPPUNIT_ASSERT( testFace->CharMapCount() == 2);
+ CPPUNIT_ASSERT_EQUAL( testFace->CharMapCount(), 2U);
FT_Encoding* charmapList = testFace->CharMapList();
- CPPUNIT_ASSERT( charmapList[0] == ft_encoding_unicode);
- CPPUNIT_ASSERT( charmapList[1] == ft_encoding_adobe_standard);
+ CPPUNIT_ASSERT_EQUAL( charmapList[0], ft_encoding_unicode);
+ CPPUNIT_ASSERT_EQUAL( charmapList[1], ft_encoding_adobe_standard);
}
@@ -99,14 +99,14 @@ class FTFaceTest : public CppUnit::TestCase
{
FTFace test(ARIAL_FONT_FILE);
FTPoint kerningVector = test.KernAdvance( 'A', 'A');
- CPPUNIT_ASSERT( kerningVector.X() == 0);
- CPPUNIT_ASSERT( kerningVector.Y() == 0);
- CPPUNIT_ASSERT( kerningVector.Z() == 0);
+ CPPUNIT_ASSERT_EQUAL( kerningVector.X(), 0.);
+ CPPUNIT_ASSERT_EQUAL( kerningVector.Y(), 0.);
+ CPPUNIT_ASSERT_EQUAL( kerningVector.Z(), 0.);
kerningVector = test.KernAdvance( 0x6FB3, 0x9580);
- CPPUNIT_ASSERT( kerningVector.X() == 0);
- CPPUNIT_ASSERT( kerningVector.Y() == 0);
- CPPUNIT_ASSERT( kerningVector.Z() == 0);
+ CPPUNIT_ASSERT_EQUAL( kerningVector.X(), 0.);
+ CPPUNIT_ASSERT_EQUAL( kerningVector.Y(), 0.);
+ CPPUNIT_ASSERT_EQUAL( kerningVector.Z(), 0.);
}
diff --git a/test/FTFont-Test.cpp b/test/FTFont-Test.cpp
index 8ad9f21..52e44b8 100644
--- a/test/FTFont-Test.cpp
+++ b/test/FTFont-Test.cpp
@@ -108,34 +108,34 @@ class FTFontTest : public CppUnit::TestCase
void testOpenFont()
{
TestFont badFont( BAD_FONT_FILE);
- CPPUNIT_ASSERT( badFont.Error() == 0x06); // invalid argument
+ CPPUNIT_ASSERT_EQUAL( badFont.Error(), 0x06); // invalid argument
TestFont goodFont( GOOD_FONT_FILE);
- CPPUNIT_ASSERT( goodFont.Error() == 0);
+ CPPUNIT_ASSERT_EQUAL( goodFont.Error(), 0);
}
void testOpenFontFromMemory()
{
TestFont badFont( (unsigned char*)100, 0);
- CPPUNIT_ASSERT( badFont.Error() == 0x02);
+ CPPUNIT_ASSERT_EQUAL( badFont.Error(), 0x02);
TestFont goodFont( HPGCalc_pfb.dataBytes, HPGCalc_pfb.numBytes);
- CPPUNIT_ASSERT( goodFont.Error() == 0);
+ CPPUNIT_ASSERT_EQUAL( goodFont.Error(), 0);
}
void testAttachFile()
{
testFont->Attach( TYPE1_AFM_FILE);
- CPPUNIT_ASSERT( testFont->Error() == 0x07); // unimplemented feature
+ CPPUNIT_ASSERT_EQUAL( testFont->Error(), 0x07); // unimplemented feature
}
void testAttachData()
{
testFont->Attach( (unsigned char*)100, 0);
- CPPUNIT_ASSERT( testFont->Error() == 0x07); // unimplemented feature
+ CPPUNIT_ASSERT_EQUAL( testFont->Error(), 0x07); // unimplemented feature
}
@@ -146,21 +146,21 @@ class FTFontTest : public CppUnit::TestCase
CPPUNIT_ASSERT_DOUBLES_EQUAL( 0, testFont->LineHeight(), 0.01);
float advance = testFont->Advance( GOOD_UNICODE_TEST_STRING);
- CPPUNIT_ASSERT( advance == 0);
+ CPPUNIT_ASSERT_EQUAL( advance, 0.f);
CPPUNIT_ASSERT( testFont->FaceSize( FONT_POINT_SIZE));
- CPPUNIT_ASSERT( testFont->Error() == 0);
+ CPPUNIT_ASSERT_EQUAL( testFont->Error(), 0);
- CPPUNIT_ASSERT( testFont->FaceSize() == FONT_POINT_SIZE);
+ CPPUNIT_ASSERT_EQUAL( testFont->FaceSize(), FONT_POINT_SIZE);
CPPUNIT_ASSERT_DOUBLES_EQUAL( 52, testFont->Ascender(), 0.01);
CPPUNIT_ASSERT_DOUBLES_EQUAL( -15, testFont->Descender(), 0.01);
CPPUNIT_ASSERT_DOUBLES_EQUAL( 81.86, testFont->LineHeight(), 0.01);
CPPUNIT_ASSERT( testFont->FaceSize( FONT_POINT_SIZE * 2));
- CPPUNIT_ASSERT( testFont->Error() == 0);
+ CPPUNIT_ASSERT_EQUAL( testFont->Error(), 0);
- CPPUNIT_ASSERT( testFont->FaceSize() == FONT_POINT_SIZE * 2);
+ CPPUNIT_ASSERT_EQUAL( testFont->FaceSize(), FONT_POINT_SIZE * 2);
CPPUNIT_ASSERT_DOUBLES_EQUAL( 104, testFont->Ascender(), 0.01);
CPPUNIT_ASSERT_DOUBLES_EQUAL( -29, testFont->Descender(), 0.01);
@@ -171,27 +171,27 @@ class FTFontTest : public CppUnit::TestCase
void testSetCharMap()
{
CPPUNIT_ASSERT( true == testFont->CharMap( ft_encoding_unicode));
- CPPUNIT_ASSERT( testFont->Error() == 0);
+ CPPUNIT_ASSERT_EQUAL( testFont->Error(), 0);
CPPUNIT_ASSERT( false == testFont->CharMap( ft_encoding_johab));
- CPPUNIT_ASSERT( testFont->Error() == 0x06); // invalid argument
+ CPPUNIT_ASSERT_EQUAL( testFont->Error(), 0x06); // invalid argument
}
void testGetCharmapList()
{
- CPPUNIT_ASSERT( testFont->CharMapCount() == 2);
+ CPPUNIT_ASSERT_EQUAL( testFont->CharMapCount(), 2U);
FT_Encoding* charmapList = testFont->CharMapList();
- CPPUNIT_ASSERT( charmapList[0] == ft_encoding_unicode);
- CPPUNIT_ASSERT( charmapList[1] == ft_encoding_adobe_standard);
+ CPPUNIT_ASSERT_EQUAL( charmapList[0], ft_encoding_unicode);
+ CPPUNIT_ASSERT_EQUAL( charmapList[1], ft_encoding_adobe_standard);
}
void testBoundingBox()
{
CPPUNIT_ASSERT( testFont->FaceSize( FONT_POINT_SIZE));
- CPPUNIT_ASSERT( testFont->Error() == 0);
+ CPPUNIT_ASSERT_EQUAL( testFont->Error(), 0);
float llx, lly, llz, urx, ury, urz;
@@ -252,7 +252,7 @@ class FTFontTest : public CppUnit::TestCase
void testAdvance()
{
CPPUNIT_ASSERT( testFont->FaceSize( FONT_POINT_SIZE));
- CPPUNIT_ASSERT( testFont->Error() == 0);
+ CPPUNIT_ASSERT_EQUAL( testFont->Error(), 0);
float advance = testFont->Advance( GOOD_ASCII_TEST_STRING);
CPPUNIT_ASSERT_DOUBLES_EQUAL( 312.10, advance, 0.01);
@@ -270,7 +270,7 @@ class FTFontTest : public CppUnit::TestCase
void testRender()
{
testFont->Render(GOOD_ASCII_TEST_STRING);
- CPPUNIT_ASSERT( testFont->Error() == 0);
+ CPPUNIT_ASSERT_EQUAL( testFont->Error(), 0);
}
diff --git a/test/FTGLBitmapFont-Test.cpp b/test/FTGLBitmapFont-Test.cpp
index 5926c17..3fe4e84 100644
--- a/test/FTGLBitmapFont-Test.cpp
+++ b/test/FTGLBitmapFont-Test.cpp
@@ -34,9 +34,9 @@ class FTGLBitmapFontTest : public CppUnit::TestCase
buildGLContext();
FTGLBitmapFont* bitmapFont = new FTGLBitmapFont( FONT_FILE);
- CPPUNIT_ASSERT( bitmapFont->Error() == 0);
+ CPPUNIT_ASSERT_EQUAL( bitmapFont->Error(), 0);
- CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+ CPPUNIT_ASSERT_EQUAL(GL_NO_ERROR, (int)glGetError());
}
void testRender()
@@ -46,14 +46,14 @@ class FTGLBitmapFontTest : public CppUnit::TestCase
FTGLBitmapFont* bitmapFont = new FTGLBitmapFont( FONT_FILE);
bitmapFont->Render(GOOD_ASCII_TEST_STRING);
- CPPUNIT_ASSERT( bitmapFont->Error() == 0);
- CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+ CPPUNIT_ASSERT_EQUAL( bitmapFont->Error(), 0);
+ CPPUNIT_ASSERT_EQUAL(GL_NO_ERROR, (int)glGetError());
bitmapFont->FaceSize(18);
bitmapFont->Render(GOOD_ASCII_TEST_STRING);
- CPPUNIT_ASSERT( bitmapFont->Error() == 0);
- CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+ CPPUNIT_ASSERT_EQUAL( bitmapFont->Error(), 0);
+ CPPUNIT_ASSERT_EQUAL(GL_NO_ERROR, (int)glGetError());
}
@@ -93,7 +93,7 @@ class FTGLBitmapFontTest : public CppUnit::TestCase
glEndList();
- CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+ CPPUNIT_ASSERT_EQUAL(GL_NO_ERROR, (int)glGetError());
}
void setUp()
diff --git a/test/FTGLExtrdFont-Test.cpp b/test/FTGLExtrdFont-Test.cpp
index 971bcfe..5fe8f1d 100644
--- a/test/FTGLExtrdFont-Test.cpp
+++ b/test/FTGLExtrdFont-Test.cpp
@@ -34,9 +34,9 @@ class FTGLExtrdFontTest : public CppUnit::TestCase
buildGLContext();
FTGLExtrdFont* extrudedFont = new FTGLExtrdFont( FONT_FILE);
- CPPUNIT_ASSERT( extrudedFont->Error() == 0);
+ CPPUNIT_ASSERT_EQUAL( extrudedFont->Error(), 0);
- CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+ CPPUNIT_ASSERT_EQUAL(GL_NO_ERROR, (int)glGetError());
}
void testRender()
@@ -46,14 +46,14 @@ class FTGLExtrdFontTest : public CppUnit::TestCase
FTGLExtrdFont* extrudedFont = new FTGLExtrdFont( FONT_FILE);
extrudedFont->Render(GOOD_ASCII_TEST_STRING);
- CPPUNIT_ASSERT( extrudedFont->Error() == 0x97); // Invalid pixels per em
- CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+ CPPUNIT_ASSERT_EQUAL( extrudedFont->Error(), 0x97); // Invalid pixels per em
+ CPPUNIT_ASSERT_EQUAL(GL_NO_ERROR, (int)glGetError());
extrudedFont->FaceSize(18);
extrudedFont->Render(GOOD_ASCII_TEST_STRING);
- CPPUNIT_ASSERT( extrudedFont->Error() == 0);
- CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+ CPPUNIT_ASSERT_EQUAL( extrudedFont->Error(), 0);
+ CPPUNIT_ASSERT_EQUAL(GL_NO_ERROR, (int)glGetError());
}
void testBadDisplayList()
@@ -70,7 +70,7 @@ class FTGLExtrdFontTest : public CppUnit::TestCase
glEndList();
- CPPUNIT_ASSERT( glGetError() == GL_INVALID_OPERATION);
+ CPPUNIT_ASSERT_EQUAL( (int)glGetError(), GL_INVALID_OPERATION);
}
void testGoodDisplayList()
@@ -88,7 +88,7 @@ class FTGLExtrdFontTest : public CppUnit::TestCase
glEndList();
- CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+ CPPUNIT_ASSERT_EQUAL(GL_NO_ERROR, (int)glGetError());
}
void setUp()
diff --git a/test/FTGLOutlineFont-Test.cpp b/test/FTGLOutlineFont-Test.cpp
index ed8b50d..ef4ca2a 100644
--- a/test/FTGLOutlineFont-Test.cpp
+++ b/test/FTGLOutlineFont-Test.cpp
@@ -34,9 +34,9 @@ class FTGLOutlineFontTest : public CppUnit::TestCase
buildGLContext();
FTGLOutlineFont* outlineFont = new FTGLOutlineFont( FONT_FILE);
- CPPUNIT_ASSERT( outlineFont->Error() == 0);
+ CPPUNIT_ASSERT_EQUAL( outlineFont->Error(), 0);
- CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+ CPPUNIT_ASSERT_EQUAL(GL_NO_ERROR, (int)glGetError());
}
void testRender()
@@ -46,14 +46,14 @@ class FTGLOutlineFontTest : public CppUnit::TestCase
FTGLOutlineFont* outlineFont = new FTGLOutlineFont( FONT_FILE);
outlineFont->Render(GOOD_ASCII_TEST_STRING);
- CPPUNIT_ASSERT( outlineFont->Error() == 0x97); // Invalid pixels per em
- CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+ CPPUNIT_ASSERT_EQUAL( outlineFont->Error(), 0x97); // Invalid pixels per em
+ CPPUNIT_ASSERT_EQUAL(GL_NO_ERROR, (int)glGetError());
outlineFont->FaceSize(18);
outlineFont->Render(GOOD_ASCII_TEST_STRING);
- CPPUNIT_ASSERT( outlineFont->Error() == 0);
- CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+ CPPUNIT_ASSERT_EQUAL( outlineFont->Error(), 0);
+ CPPUNIT_ASSERT_EQUAL(GL_NO_ERROR, (int)glGetError());
}
void testBadDisplayList()
@@ -70,7 +70,7 @@ class FTGLOutlineFontTest : public CppUnit::TestCase
glEndList();
- CPPUNIT_ASSERT( glGetError() == GL_INVALID_OPERATION);
+ CPPUNIT_ASSERT_EQUAL( (int)glGetError(), GL_INVALID_OPERATION);
}
void testGoodDisplayList()
@@ -88,7 +88,7 @@ class FTGLOutlineFontTest : public CppUnit::TestCase
glEndList();
- CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+ CPPUNIT_ASSERT_EQUAL(GL_NO_ERROR, (int)glGetError());
}
void setUp()
diff --git a/test/FTGLPixmapFont-Test.cpp b/test/FTGLPixmapFont-Test.cpp
index 4c82148..2e3071d 100644
--- a/test/FTGLPixmapFont-Test.cpp
+++ b/test/FTGLPixmapFont-Test.cpp
@@ -33,9 +33,9 @@ class FTGLPixmapFontTest : public CppUnit::TestCase
buildGLContext();
FTGLPixmapFont* pixmapFont = new FTGLPixmapFont( FONT_FILE);
- CPPUNIT_ASSERT( pixmapFont->Error() == 0);
+ CPPUNIT_ASSERT_EQUAL( pixmapFont->Error(), 0);
- CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+ CPPUNIT_ASSERT_EQUAL(GL_NO_ERROR, (int)glGetError());
}
void testRender()
@@ -45,14 +45,14 @@ class FTGLPixmapFontTest : public CppUnit::TestCase
FTGLPixmapFont* pixmapFont = new FTGLPixmapFont( FONT_FILE);
pixmapFont->Render(GOOD_ASCII_TEST_STRING);
- CPPUNIT_ASSERT( pixmapFont->Error() == 0x97); // Invalid pixels per em
- CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+ CPPUNIT_ASSERT_EQUAL( pixmapFont->Error(), 0x97); // Invalid pixels per em
+ CPPUNIT_ASSERT_EQUAL(GL_NO_ERROR, (int)glGetError());
pixmapFont->FaceSize(18);
pixmapFont->Render(GOOD_ASCII_TEST_STRING);
- CPPUNIT_ASSERT( pixmapFont->Error() == 0);
- CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+ CPPUNIT_ASSERT_EQUAL( pixmapFont->Error(), 0);
+ CPPUNIT_ASSERT_EQUAL(GL_NO_ERROR, (int)glGetError());
}
void testDisplayList()
@@ -69,7 +69,7 @@ class FTGLPixmapFontTest : public CppUnit::TestCase
glEndList();
- CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+ CPPUNIT_ASSERT_EQUAL(GL_NO_ERROR, (int)glGetError());
}
void setUp()
diff --git a/test/FTGLPolygonFont-Test.cpp b/test/FTGLPolygonFont-Test.cpp
index 08a40e2..e53bf8b 100644
--- a/test/FTGLPolygonFont-Test.cpp
+++ b/test/FTGLPolygonFont-Test.cpp
@@ -34,9 +34,9 @@ class FTGLPolygonFontTest : public CppUnit::TestCase
buildGLContext();
FTGLPolygonFont* polygonFont = new FTGLPolygonFont( FONT_FILE);
- CPPUNIT_ASSERT( polygonFont->Error() == 0);
+ CPPUNIT_ASSERT_EQUAL( polygonFont->Error(), 0);
- CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+ CPPUNIT_ASSERT_EQUAL(GL_NO_ERROR, (int)glGetError());
}
void testRender()
@@ -47,14 +47,14 @@ class FTGLPolygonFontTest : public CppUnit::TestCase
polygonFont->Render(GOOD_ASCII_TEST_STRING);
- CPPUNIT_ASSERT( polygonFont->Error() == 0x97); // Invalid pixels per em
- CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+ CPPUNIT_ASSERT_EQUAL( polygonFont->Error(), 0x97); // Invalid pixels per em
+ CPPUNIT_ASSERT_EQUAL(GL_NO_ERROR, (int)glGetError());
polygonFont->FaceSize(18);
polygonFont->Render(GOOD_ASCII_TEST_STRING);
- CPPUNIT_ASSERT( polygonFont->Error() == 0);
- CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+ CPPUNIT_ASSERT_EQUAL( polygonFont->Error(), 0);
+ CPPUNIT_ASSERT_EQUAL(GL_NO_ERROR, (int)glGetError());
}
void testBadDisplayList()
@@ -71,7 +71,7 @@ class FTGLPolygonFontTest : public CppUnit::TestCase
glEndList();
- CPPUNIT_ASSERT( glGetError() == GL_INVALID_OPERATION);
+ CPPUNIT_ASSERT_EQUAL( (int)glGetError(), GL_INVALID_OPERATION);
}
void testGoodDisplayList()
@@ -89,7 +89,7 @@ class FTGLPolygonFontTest : public CppUnit::TestCase
glEndList();
- CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+ CPPUNIT_ASSERT_EQUAL(GL_NO_ERROR, (int)glGetError());
}
void setUp()
diff --git a/test/FTGLTextureFont-Test.cpp b/test/FTGLTextureFont-Test.cpp
index 9237806..4f129aa 100644
--- a/test/FTGLTextureFont-Test.cpp
+++ b/test/FTGLTextureFont-Test.cpp
@@ -34,8 +34,8 @@ class FTGLTextureFontTest : public CppUnit::TestCase
buildGLContext();
FTGLTextureFont* textureFont = new FTGLTextureFont( FONT_FILE);
- CPPUNIT_ASSERT( textureFont->Error() == 0);
- CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+ CPPUNIT_ASSERT_EQUAL( textureFont->Error(), 0);
+ CPPUNIT_ASSERT_EQUAL(GL_NO_ERROR, (int)glGetError());
}
void testResizeBug()
@@ -43,7 +43,7 @@ class FTGLTextureFontTest : public CppUnit::TestCase
buildGLContext();
FTGLTextureFont* textureFont = new FTGLTextureFont( FONT_FILE);
- CPPUNIT_ASSERT( textureFont->Error() == 0);
+ CPPUNIT_ASSERT_EQUAL( textureFont->Error(), 0);
textureFont->FaceSize(18);
textureFont->Render("first");
@@ -51,7 +51,7 @@ class FTGLTextureFontTest : public CppUnit::TestCase
textureFont->FaceSize(38);
textureFont->Render("second");
- CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+ CPPUNIT_ASSERT_EQUAL(GL_NO_ERROR, (int)glGetError());
}
void testRender()
@@ -61,14 +61,14 @@ class FTGLTextureFontTest : public CppUnit::TestCase
FTGLTextureFont* textureFont = new FTGLTextureFont( FONT_FILE);
textureFont->Render(GOOD_ASCII_TEST_STRING);
- CPPUNIT_ASSERT( textureFont->Error() == 0x97); // Invalid pixels per em
- CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+ CPPUNIT_ASSERT_EQUAL( textureFont->Error(), 0x97); // Invalid pixels per em
+ CPPUNIT_ASSERT_EQUAL(GL_NO_ERROR, (int)glGetError());
textureFont->FaceSize(18);
textureFont->Render(GOOD_ASCII_TEST_STRING);
- CPPUNIT_ASSERT( textureFont->Error() == 0);
- CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+ CPPUNIT_ASSERT_EQUAL( textureFont->Error(), 0);
+ CPPUNIT_ASSERT_EQUAL(GL_NO_ERROR, (int)glGetError());
}
void testDisplayList()
@@ -85,7 +85,7 @@ class FTGLTextureFontTest : public CppUnit::TestCase
glEndList();
- CPPUNIT_ASSERT( glGetError() == GL_NO_ERROR);
+ CPPUNIT_ASSERT_EQUAL(GL_NO_ERROR, (int)glGetError());
}
void setUp()
diff --git a/test/FTGlyph-Test.cpp b/test/FTGlyph-Test.cpp
index 76adc99..0344a28 100644
--- a/test/FTGlyph-Test.cpp
+++ b/test/FTGlyph-Test.cpp
@@ -39,10 +39,13 @@ class FTGlyphTest : public CppUnit::TestCase
FTPoint testPoint;
CPPUNIT_ASSERT( testPoint == testGlyph.Advance());
+ CPPUNIT_ASSERT_EQUAL( testPoint.X(), testGlyph.Advance().X());
+ CPPUNIT_ASSERT_EQUAL( testPoint.Y(), testGlyph.Advance().Y());
+ CPPUNIT_ASSERT_EQUAL( testPoint.Z(), testGlyph.Advance().Z());
CPPUNIT_ASSERT_DOUBLES_EQUAL( 0, testGlyph.BBox().upperY, 0.01);
- CPPUNIT_ASSERT( testGlyph.Error() == 0);
+ CPPUNIT_ASSERT_EQUAL( testGlyph.Error(), 0);
}
@@ -51,9 +54,12 @@ class FTGlyphTest : public CppUnit::TestCase
setUpFreetype( CHARACTER_CODE_A);
TestGlyph testGlyph(face->glyph);
- FTPoint testPoint(47.0f, 0.0f, 0.0f);
-
- CPPUNIT_ASSERT( testPoint == testGlyph.Advance());
+ FTPoint testPoint(47.0, 0.0, 0.0);
+ FTPoint nextPoint = testGlyph.Advance();
+ CPPUNIT_ASSERT( testPoint == nextPoint);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL( testPoint.X(), nextPoint.X(), 0.0001);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL( testPoint.Y(), nextPoint.Y(), 0.0001);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL( testPoint.Z(), nextPoint.Z(), 0.0001);
CPPUNIT_ASSERT_DOUBLES_EQUAL( 51.39, testGlyph.BBox().upperY, 0.01);
diff --git a/test/FTGlyphContainer-Test.cpp b/test/FTGlyphContainer-Test.cpp
index 9ade50f..1352cf2 100644
--- a/test/FTGlyphContainer-Test.cpp
+++ b/test/FTGlyphContainer-Test.cpp
@@ -62,17 +62,17 @@ class FTGlyphContainerTest : public CppUnit::TestCase
void testSetCharMap()
{
CPPUNIT_ASSERT( glyphContainer->CharMap( ft_encoding_unicode));
- CPPUNIT_ASSERT( glyphContainer->Error() == 0);
+ CPPUNIT_ASSERT_EQUAL( glyphContainer->Error(), 0);
CPPUNIT_ASSERT( !glyphContainer->CharMap( ft_encoding_johab));
- CPPUNIT_ASSERT( glyphContainer->Error() == 0x06); // invalid argument
+ CPPUNIT_ASSERT_EQUAL( glyphContainer->Error(), 0x06); // invalid argument
}
void testGlyphIndex()
{
- CPPUNIT_ASSERT( glyphContainer->FontIndex( CHARACTER_CODE_A) == FONT_INDEX_OF_A);
- CPPUNIT_ASSERT( glyphContainer->FontIndex( BIG_CHARACTER_CODE) == BIG_FONT_INDEX);
+ CPPUNIT_ASSERT_EQUAL( glyphContainer->FontIndex( CHARACTER_CODE_A), FONT_INDEX_OF_A);
+ CPPUNIT_ASSERT_EQUAL( glyphContainer->FontIndex( BIG_CHARACTER_CODE), BIG_FONT_INDEX);
}
diff --git a/test/FTVectoriser-Test.cpp b/test/FTVectoriser-Test.cpp
index af5495b..cb9a71b 100644
--- a/test/FTVectoriser-Test.cpp
+++ b/test/FTVectoriser-Test.cpp
@@ -286,9 +286,9 @@ class FTVectoriserTest : public CppUnit::TestCase
// If you hit these asserts then you have the wrong library version to run the tests.
// You can still run the tests but some will fail because the hinter changed in 2.1.4
- CPPUNIT_ASSERT( major == 2);
- CPPUNIT_ASSERT( minor == 1);
- CPPUNIT_ASSERT( patch >= 4);
+ CPPUNIT_ASSERT_EQUAL(2, major);
+ CPPUNIT_ASSERT_EQUAL(1, minor);
+ CPPUNIT_ASSERT(4 <= patch);
tearDownFreetype();
}
@@ -297,7 +297,7 @@ class FTVectoriserTest : public CppUnit::TestCase
void testNullGlyphProcess()
{
FTVectoriser vectoriser( NULL);
- CPPUNIT_ASSERT( vectoriser.ContourCount() == 0);
+ CPPUNIT_ASSERT_EQUAL((size_t)0, vectoriser.ContourCount());
}
@@ -306,7 +306,7 @@ class FTVectoriserTest : public CppUnit::TestCase
setUpFreetype( NULL_CHARACTER_INDEX);
FTVectoriser vectoriser( face->glyph);
- CPPUNIT_ASSERT( vectoriser.ContourCount() == 0);
+ CPPUNIT_ASSERT_EQUAL((size_t)0, vectoriser.ContourCount());
tearDownFreetype();
}
@@ -318,8 +318,8 @@ class FTVectoriserTest : public CppUnit::TestCase
FTVectoriser vectoriser( face->glyph);
- CPPUNIT_ASSERT( vectoriser.ContourCount() == 2);
- CPPUNIT_ASSERT( vectoriser.PointCount() == 8);
+ CPPUNIT_ASSERT_EQUAL((size_t)2, vectoriser.ContourCount());
+ CPPUNIT_ASSERT_EQUAL((size_t)8, vectoriser.PointCount());
tearDownFreetype();
}
@@ -331,8 +331,8 @@ class FTVectoriserTest : public CppUnit::TestCase
FTVectoriser vectoriser( face->glyph);
- CPPUNIT_ASSERT( vectoriser.ContourCount() == 2);
- CPPUNIT_ASSERT( vectoriser.PointCount() == 91);
+ CPPUNIT_ASSERT_EQUAL((size_t)2, vectoriser.ContourCount());
+ CPPUNIT_ASSERT_EQUAL((size_t)91, vectoriser.PointCount());
tearDownFreetype();
}
@@ -398,17 +398,17 @@ class FTVectoriserTest : public CppUnit::TestCase
int d = 0;
const FTMesh* mesh = vectoriser.GetMesh();
unsigned int tesselations = mesh->TesselationCount();
- CPPUNIT_ASSERT( tesselations == 14);
+ CPPUNIT_ASSERT_EQUAL(14U, tesselations);
for( unsigned int index = 0; index < tesselations; ++index)
{
const FTTesselation* subMesh = mesh->Tesselation( index);
unsigned int polyType = subMesh->PolygonType();
- CPPUNIT_ASSERT( testMeshPolygonTypes[index] == polyType);
+ CPPUNIT_ASSERT_EQUAL( testMeshPolygonTypes[index], polyType);
unsigned int numberOfVertices = subMesh->PointCount();
- CPPUNIT_ASSERT( testMeshPointCount[index] == numberOfVertices);
+ CPPUNIT_ASSERT_EQUAL( testMeshPointCount[index], numberOfVertices);
for( unsigned int x = 0; x < numberOfVertices; ++x)
{