[Top][All Lists]

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

Re: base64, encoding and tests

From: Sergey Poznyakoff
Subject: Re: base64, encoding and tests
Date: Tue, 26 Nov 2002 17:22:39 +0200

> I'm facing some problems with the base64 encoder, which seems to
> truncate files during conversion. I've spotted a few problems in the
> code, but I need to test my fixes...
>   - is this a known problem ?

What problem do you mean? Could you describe it please?

>   - what is the standard layout of the tests ? (I've never used
>     dejagnu, only the simpler TESTS =3D ... target of automake)

The testsute for each module is located in the subdirectory
<module_dir>/testsuite. The Makefile.am in this directory
is responsible for building site.exp and remote.exp files, and
for distributing all the subdirectories and data files if any.
The usual layout of the testsute subdirectory is:

    config/         Directory containing configuration files (at least
    lib/            Directory containing any library procedures needed
                    to test this particular library/utility
    <module_name>/  This directory contains actual testcases.

The distribution of any files in any subdirectories is controlled by
the file DISTFILES. It's format is a filename per line, no comments
and no empty lines.

Basic test procedures are kept in mailutils/testsuite/lib/mailutils.exp
This file is usually loaded either directly by a testcase or
indirectly via a file in lib/ subdirectory. Please, read this file
before writing your own tests. 

Sample data for testing are kept in

    mailutils/testsuite/spool/          Sample mailboxes
    mailutils/testsuite/etc             Sample configuration files.

Usual startup routine for a testcase is:

# 1. set up global variables
# 2. initialize the testsuite library:


# 3. Obtain information about this particular build:

# etc...

If the utility being tested is not interactive (e.g. lioibmailbox
itself), mu_prepare_spools is used in step 2.

The testcases for libmailbox usually run some interactive helper
program from the mailutils/examples, feed some data to it and
check its output. Both input and output is controlled by a
data file that resides in mailbox/testsuite subdirectory. Take
a look at mailbox/testsuite/Addr and
mailbox/testsuite/mailbox/address.exp for an example.

If you are not familiar with DejaGNU and TCL, I can help you in
writing the testcase.

>   - in code I fix, is it ok to write
>     if (a)=20
>       {
>         b ();
>       }

I guess it's ok. 


reply via email to

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