Changeset 54
- Timestamp:
- 04/14/06 05:08:13 (2 years ago)
- Location:
- trunk
- Files:
-
- 4 modified
-
configure.ac (modified) (1 diff)
-
src/IDocument.h (modified) (1 diff)
-
tests/MainPterTest.cxx (modified) (12 diffs)
-
tests/MainPterTest.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/configure.ac
r49 r54 1 1 dnl Process this file with autoconf to produce a configure script. 2 AC_INIT([ePDFView], [0.1. 0], [jordi@emma-soft.com])2 AC_INIT([ePDFView], [0.1.1], [jordi@emma-soft.com]) 3 3 AC_PREREQ([2.13]) 4 4 AC_CONFIG_HEADER([config.h]) -
trunk/src/IDocument.h
r49 r54 24 24 namespace ePDFView 25 25 { 26 // Forward declarations. 27 class DocumentPage; 28 class DocumentIndex; 29 26 30 /// 27 31 /// @brief Defines the possible errors loading a document. -
trunk/tests/MainPterTest.cxx
r36 r54 16 16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 18 #include <epdfview.h> 18 #include <glib.h> 19 #include <IDocument.h> 20 #include <IMainView.h> 21 #include <MainPter.h> 19 22 #include "DumbDocument.h" 20 23 #include "DumbMainView.h" … … 46 49 // We only need to delete the presenter, as all other 47 50 // classes are deleted by it. 48 // delete m_MainPter; 49 } 51 delete m_MainPter; 52 } 53 50 54 51 55 /// … … 295 299 CPPUNIT_ASSERT_EQUAL (1, m_View->getCurrentPage ()); 296 300 CPPUNIT_ASSERT (m_View->hasImagePageView ()); 301 // This is to check that after calling this function, it returns false 302 // because no page can be shown between the two... (I didn't called 303 // the presenter or the view, yet) 297 304 CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 298 305 // Going to the next page should make all actions sensitive. … … 305 312 CPPUNIT_ASSERT (m_View->isSensitiveGoToPreviousPage ()); 306 313 CPPUNIT_ASSERT (m_View->hasImagePageView ()); 307 CPPUNIT_ASSERT (!m_View->hasImagePageView ());308 314 // Going to the last will make some unsensitive. 309 315 m_MainPter->goToLastPageActivated (); … … 315 321 CPPUNIT_ASSERT (m_View->isSensitiveGoToPreviousPage ()); 316 322 CPPUNIT_ASSERT (m_View->hasImagePageView ()); 317 CPPUNIT_ASSERT (!m_View->hasImagePageView ());318 323 // Again to the last won't harm (just in case...) nor going next. 319 324 m_MainPter->goToLastPageActivated (); … … 358 363 CPPUNIT_ASSERT (m_View->hasImagePageView ()); 359 364 CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 365 } 366 367 /// 368 /// @brief Test the page navigation using the entry on the toolbar. 369 /// 370 /// The application has a text entry that the user can use to to a 371 /// page just by writting the number. Any non number after the first number 372 /// character will be discarded. 373 /// 374 void 375 MainPterTest::pageNavigationEntry () 376 { 377 m_View->setOpenFileName ("/tmp/test.pdf"); 378 m_Document->setNumPages (4); 379 m_MainPter->openFileActivated (); 380 // Check that sets the correct number of pages and the current page. 381 CPPUNIT_ASSERT_EQUAL (4, m_View->getTotalPages ()); 382 CPPUNIT_ASSERT_EQUAL (1, m_View->getCurrentPage ()); 383 CPPUNIT_ASSERT (m_View->hasImagePageView ()); 360 384 361 385 // Now try again using the page entry on toolbar. 362 m_View->setGoToPageText ("2 ");386 m_View->setGoToPageText ("2 of 4"); 363 387 m_MainPter->goToPageActivated (); 364 388 CPPUNIT_ASSERT_EQUAL (2, m_View->getCurrentPage ()); … … 371 395 CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 372 396 373 m_View->setGoToPageText ("4 ");397 m_View->setGoToPageText ("4 of 4"); 374 398 m_MainPter->goToPageActivated (); 375 399 CPPUNIT_ASSERT_EQUAL (4, m_View->getCurrentPage ()); … … 382 406 CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 383 407 384 m_View->setGoToPageText ("1 ");408 m_View->setGoToPageText ("1 of 4"); 385 409 m_MainPter->goToPageActivated (); 386 410 CPPUNIT_ASSERT_EQUAL (1, m_View->getCurrentPage ()); … … 394 418 395 419 // Invalid values. 396 m_View->setGoToPageText ("123123 ");420 m_View->setGoToPageText ("123123 of 1"); 397 421 m_MainPter->goToPageActivated (); 398 422 CPPUNIT_ASSERT_EQUAL (4, m_View->getCurrentPage ()); … … 405 429 CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 406 430 407 m_View->setGoToPageText ("0 ");431 m_View->setGoToPageText ("0 of 12"); 408 432 m_MainPter->goToPageActivated (); 409 433 CPPUNIT_ASSERT_EQUAL (1, m_View->getCurrentPage ()); … … 417 441 418 442 m_MainPter->goToNextPageActivated (); 419 m_View->setGoToPageText ("Jejej ");443 m_View->setGoToPageText ("Jejej :-)"); 420 444 m_MainPter->goToPageActivated (); 421 445 CPPUNIT_ASSERT_EQUAL (1, m_View->getCurrentPage ()); … … 527 551 CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 528 552 } 553 -
trunk/tests/MainPterTest.h
r31 r54 34 34 CPPUNIT_TEST (goodPassword); 35 35 CPPUNIT_TEST (pageNavigation); 36 CPPUNIT_TEST (pageNavigationEntry); 36 37 CPPUNIT_TEST (pageRotate); 37 38 CPPUNIT_TEST (pageZoom); … … 50 51 void goodPassword (void); 51 52 void pageNavigation (void); 53 void pageNavigationEntry (void); 52 54 void pageRotate (void); 53 55 void pageZoom (void);
