Changeset 63 for trunk/tests/MainPterTest.cxx
- Timestamp:
- 04/14/06 14:36:57 (3 years ago)
- Files:
-
- 1 modified
-
trunk/tests/MainPterTest.cxx (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/MainPterTest.cxx
r62 r63 288 288 } 289 289 290 290 291 /// 291 292 /// @brief Test page navigation. … … 490 491 CPPUNIT_ASSERT (m_View->hasImagePageView ()); 491 492 CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 492 CPPUNIT_ASSERT_DOUBLES_EQUAL (1.0 f, m_Document->getZoom (), 0.0001f);493 CPPUNIT_ASSERT_DOUBLES_EQUAL (1.0, m_Document->getZoom (), 0.0001); 493 494 494 495 m_MainPter->zoomInActivated (); 495 496 CPPUNIT_ASSERT (m_View->hasImagePageView ()); 496 497 CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 497 CPPUNIT_ASSERT_DOUBLES_EQUAL (1.2 f, m_Document->getZoom (), 0.0001f);498 CPPUNIT_ASSERT_DOUBLES_EQUAL (1.2, m_Document->getZoom (), 0.0001); 498 499 499 500 m_MainPter->zoomOutActivated (); 500 501 CPPUNIT_ASSERT (m_View->hasImagePageView ()); 501 502 CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 502 CPPUNIT_ASSERT_ EQUAL (1.0f, m_Document->getZoom ());503 CPPUNIT_ASSERT_DOUBLES_EQUAL (1.0, m_Document->getZoom (), 0.0001); 503 504 504 505 CPPUNIT_ASSERT (m_View->isSensitiveZoomIn ()); … … 523 524 CPPUNIT_ASSERT (m_View->hasImagePageView ()); 524 525 CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 525 CPPUNIT_ASSERT_DOUBLES_EQUAL (0.2 f, m_Document->getZoom (), 0.0001f);526 CPPUNIT_ASSERT_DOUBLES_EQUAL (0.2, m_Document->getZoom (), 0.0001); 526 527 // For the width it should be 75/100 = 0.75 527 528 m_MainPter->zoomWidthActivated (); 528 529 CPPUNIT_ASSERT (m_View->hasImagePageView ()); 529 530 CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 530 CPPUNIT_ASSERT_DOUBLES_EQUAL (0.75 f, m_Document->getZoom (), 0.0001f);531 CPPUNIT_ASSERT_DOUBLES_EQUAL (0.75, m_Document->getZoom (), 0.0001); 531 532 532 533 // Now rotate and try again. … … 537 538 // Since rotation is now 90 the zoom level should be 75/250 = 0.3 538 539 m_MainPter->zoomFitActivated (); 539 CPPUNIT_ASSERT_DOUBLES_EQUAL (0.3 f, m_Document->getZoom (), 0.0001f);540 CPPUNIT_ASSERT_DOUBLES_EQUAL (0.3, m_Document->getZoom (), 0.0001); 540 541 CPPUNIT_ASSERT (m_View->hasImagePageView ()); 541 542 // For the width it should be 75/250 = 0.3 also. 542 543 m_MainPter->zoomWidthActivated (); 543 CPPUNIT_ASSERT_DOUBLES_EQUAL (0.3f, m_Document->getZoom (), 0.0001f); 544 CPPUNIT_ASSERT (m_View->hasImagePageView ()); 545 } 544 CPPUNIT_ASSERT_DOUBLES_EQUAL (0.3, m_Document->getZoom (), 0.0001); 545 CPPUNIT_ASSERT (m_View->hasImagePageView ()); 546 } 547 548 /// 549 /// @brief Test to reload a normal document. 550 /// 551 /// A "normal" document is a non encrypted document. The document 552 /// should then be viewed at the same page, scale an rotation. 553 /// 554 void 555 MainPterTest::reloadNormal () 556 { 557 m_View->setOpenFileName ("/tmp/test.pdf"); 558 m_MainPter->openFileActivated (); 559 CPPUNIT_ASSERT (m_View->hasImagePageView ()); 560 561 m_MainPter->goToNextPageActivated (); 562 m_MainPter->rotateRightActivated (); 563 m_MainPter->zoomWidthActivated (); 564 CPPUNIT_ASSERT_EQUAL (2, m_View->getCurrentPage ()); 565 CPPUNIT_ASSERT_EQUAL (90, m_Document->getRotation ()); 566 CPPUNIT_ASSERT_DOUBLES_EQUAL (0.3, m_Document->getZoom (), 0.0001); 567 CPPUNIT_ASSERT (m_View->hasImagePageView ()); 568 CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 569 570 // Reload the document. 571 m_MainPter->reloadActivated (); 572 CPPUNIT_ASSERT_EQUAL (2, m_View->getCurrentPage ()); 573 CPPUNIT_ASSERT_EQUAL (90, m_Document->getRotation ()); 574 CPPUNIT_ASSERT_DOUBLES_EQUAL (0.3, m_Document->getZoom (), 0.0001); 575 CPPUNIT_ASSERT (m_View->hasImagePageView ()); 576 CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 577 }
