octave-maintainers
[Top][All Lists]
Advanced

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

writing tests in Octave: IO functions, shared test block and test error


From: Carnë Draug
Subject: writing tests in Octave: IO functions, shared test block and test error with testif HAVE_X
Date: Fri, 12 Jul 2013 17:56:49 +0100

Hi

I'm at the moment in need to write tests for the image IO functions
(imread, imwrite and imfinfo) and have some questions:

1) When testing the writing of files where should they be written to?
Does tmpnam () works in windows as well?

2) And how can the file be removed after? imread() has a test that
writes a file, reads it back, removes the file, and only then runs the
test so the file is removed if the test fails. However, if imread
gives an error the file is never removed. I have wrapped the test in
an unwind_protect block to make sure the file is always removed.
Still, should we make this simpler somehow?

3) For testing reading files, where can test files be placed? Would be
nice to have a solution that could also be reused by packages (such
files are a nice place for easter eggs). At the moment we only have
default.img but that's not enough for all the tests that I would like
to have.

4) We have the testif #HAVE_XX to run the tests only if octave was
built with that library. How can that be used when testing for error?

Carnë


reply via email to

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