pdf-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[pdf-devel] torture utils and test data files


From: jemarch
Subject: [pdf-devel] torture utils and test data files
Date: Tue, 25 Nov 2008 23:31:17 +0100
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/23.0.60 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

Hi.

I have committed several new facilities for the testing of the
library.

Now we have a place to put the data files needed by the tests:

    torture/testdata/TD00001
                     TD00002
                     ...

The data files can be obtained in

   http://www.gnupdf.org/prmgt/testdata/gnupdf-testdata-RELEASE.tar.gz

where RELEASE is the applicable version of the library. The data files
corresponding to the 'trunk' branch are in:

              gnupdf-testdata-trunk.tar.gz

To ease the download of the right tarball there is a shell script in 

    prmgt/get-test-data.sh

When executed it will download the appropriate tarball automatically,
and untar the files in torture/datafiles.

The meaning and contents of each data files is documented in a new
chapter of the Test Specification Document: "Test Data Files":

@table @file
@item TD00001
JBIG2 global segment for the page @file{TD00002}.
@item TD00002
JBIG2 page using global segment @file{TD00001}.
@item TD00003
Decoded JBIG2 page bitmap from page @file{TD00002} and global
segment @file{TD00001}.
@end table

Also, unit tests using some data files should document it as in:

@deffn Test pdf_stm_read_010
Create a memory-based reading stream and attach a JBIG2 decoder to
it. Then decode a JBIG2 page using a global segment.
@table @strong
@item Success condition
The decoded bitmap should be equal to @file{TD00003}.
@item Data files
@itemize @minus
@item @file{TD00001}
@item @file{TD00002}
@item @file{TD00003}
@end itemize
@end table
@end deffn

To ease the usage of the data files in the tests there is a little
library in 'torture/tortutils/tortutils.[ch]'. The library is built
and statically linked with the 'runtests' binary. Right now it
contains a few functions like 'tortu_get_data_path' and
'tortu_cmp_data_file'. Feel free to add new functions as you need
while writing new tests (but keep it portable, since it can be used
also with nocheck!).

I wrote some notes about this issue in the hackers guide.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]