This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
testsuite on targets that lack file IO(e.g. arm-sim)
- From: Øyvind Harboe <oyvind dot harboe at zylin dot com>
- To: libstdc++ at gcc dot gnu dot org
- Date: Mon, 18 Apr 2005 12:35:52 +0200
- Subject: testsuite on targets that lack file IO(e.g. arm-sim)
Q: Does the libstdc++ testsuite have a "graceful"(i.e. non-crashing) way
of handling the lack of IO on a target?
Q: Is there a way to test only those libstdc++ testcases that do not
involve IO?
I've failed to find any documentation or postings that talk about these
issues.
Take the following failure:
FAIL: ext/stdio_sync_filebuf/char/12048-1.cc execution test
Obviously this fails because fopen() will return NULL on the e.g. the
arm-sim target, but there is no error handling in the testsuite code(see
below).
Wouldn't this result in the 'file' handle being passed to e.g. getc(),
which does not support file==NULL, which, depending on particular target
being tested, results in either a VERIFY() failure or crash?
-----
void test02()
{
bool test __attribute__((unused)) = true;
const char* name = "cin_unget-1.txt";
std::FILE* file = std::fopen(name, "r");
__gnu_cxx::stdio_sync_filebuf<char> sbuf(file);
int c1 = sbuf.sbumpc();
VERIFY( c1 != EOF );
----
--
Øyvind Harboe
http://www.zylin.com