Changeset 101

Show
Ignore:
Timestamp:
04/21/06 03:54:04 (2 years ago)
Author:
jordi
Message:

Added the Utils file that has common util function for test suites, like getTestFile().

Location:
trunk/tests
Files:
2 added
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/tests/DocumentOutlineTest.cxx

    r78 r101  
    1717 
    1818#include <epdfview.h> 
     19#include "Utils.h" 
    1920#include "DocumentOutlineTest.h" 
    2021 
     
    2324// Register the test suite into the `registry'. 
    2425CPPUNIT_TEST_SUITE_REGISTRATION (DocumentOutlineTest); 
    25  
    26 /// 
    27 /// @brief Returns the path to the test data file. 
    28 /// 
    29 /// It assumes that TEST_DIR is defined to the relative 
    30 /// tests directory and that the checks are executed from the 
    31 /// test build dir. 
    32 /// 
    33 static gchar * 
    34 getTestFile (const gchar *fileName) 
    35 { 
    36     gchar *currentDir = g_get_current_dir (); 
    37     gchar *filePath = g_build_filename (currentDir, TEST_DIR, fileName, NULL); 
    38  
    39     return filePath; 
    40 } 
    4126 
    4227/// 
  • trunk/tests/Makefile.am

    r92 r101  
    2020    MainPterTest.h          \ 
    2121    PDFDocumentTest.cxx     \ 
    22     PDFDocumentTest.h 
     22    PDFDocumentTest.h       \ 
     23    Utils.cxx               \ 
     24    Utils.h 
    2325 
    2426test_epdfview_CXXFLAGS =                        \ 
  • trunk/tests/PDFDocumentTest.cxx

    r91 r101  
    1717 
    1818#include <epdfview.h> 
     19#include "Utils.h" 
    1920#include "PDFDocumentTest.h" 
    2021 
     
    2425// Register the test suite into the `registry'. 
    2526CPPUNIT_TEST_SUITE_REGISTRATION (PDFDocumentTest); 
    26  
    27 /// 
    28 /// @brief Returns the path to the test data file. 
    29 /// 
    30 /// It assumes that TEST_DIR is defined to the relative 
    31 /// tests directory and that the checks are executed from the 
    32 /// test build dir. 
    33 /// 
    34 static gchar * 
    35 getTestFile (const gchar *fileName) 
    36 { 
    37     gchar *currentDir = g_get_current_dir (); 
    38     gchar *filePath = g_build_filename (currentDir, TEST_DIR, fileName, NULL); 
    39     g_free (currentDir); 
    40  
    41     return filePath; 
    42 } 
    4327 
    4428///