[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: writing tests in Octave: IO functions, shared test block and test er
From: |
PhilipNienhuis |
Subject: |
Re: writing tests in Octave: IO functions, shared test block and test error with testif HAVE_X |
Date: |
Fri, 12 Jul 2013 11:37:00 -0700 (PDT) |
Carnë Draug-4 wrote
> 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 teting for error?
For 1 - 3, perhaps some of the tests in textread.m and textscan.m can give
you some inspiration.
Philip
--
View this message in context:
http://octave.1599824.n4.nabble.com/writing-tests-in-Octave-IO-functions-shared-test-block-and-test-error-with-testif-HAVE-X-tp4655563p4655569.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.