diff options
author | Rob Savoye <rob@welcomehome.org> | 2001-05-26 05:55:28 +0000 |
---|---|---|
committer | Rob Savoye <rob@welcomehome.org> | 2001-05-26 05:55:28 +0000 |
commit | 4330bafff46c45742dc65b79a7e06196f0d89336 (patch) | |
tree | 37f7b37ad0a0f2ed4b94c848d7d0d9c2487d077f /testsuite | |
parent | 93d1d8d757dfbf0738f9fcb72ea6f04050772da4 (diff) | |
download | dejagnu-4330bafff46c45742dc65b79a7e06196f0d89336.zip dejagnu-4330bafff46c45742dc65b79a7e06196f0d89336.tar.gz dejagnu-4330bafff46c45742dc65b79a7e06196f0d89336.tar.bz2 |
* acinclude.m4: Add DJ_AC_STL, which figures out if we're running
libstdc++ version 2 or 3.
* aclocal.m4: Regenerated.
* configure.in: Add DJ_AC_STL.
* configure: Regenerated.
* dejagnu.h: Add the use of the std namespace, so we work with
libstdc++ version 2 or 3.
* testsuite/libdejagnu/unit.cc: Use setbuf() or pubsetbuff(),
depending on the version.
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/libdejagnu/unit.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/testsuite/libdejagnu/unit.cc b/testsuite/libdejagnu/unit.cc index 9f070aa..6f3918a 100644 --- a/testsuite/libdejagnu/unit.cc +++ b/testsuite/libdejagnu/unit.cc @@ -1,13 +1,14 @@ // unit.cc -- This is a test case for the Dejagnu.h classes. #include <iostream> -#include <dejagnu.h> - #include <regex.h> #include <string> #include <fstream> #include <set> #include <sys/types.h> +#include <dejagnu.h> + +using namespace std; TestState runtest; TestState test; @@ -48,9 +49,12 @@ main (int argc, char *argv[]) { // Replace the output buffer for cout, so we can examine it to // see what was displayed. Otherwise, there is no way we can test // the logging functions completely. - streambuf *sb = cout.rdbuf(); char bbuuff[5120]; - sb->setbuf(bbuuff, 5120); +#ifdef HAVE_STL3 + cout.rdbuf()->pubsetbuf(bbuuff, 5120); +#else + cout.rdbuf()->setbuf(bbuuff, 5120); +#endif testClass1.tname = "testType1"; testClass1.tnum = 1; @@ -108,7 +112,6 @@ main (int argc, char *argv[]) { } else { runtest.fail ("Totals message"); } - } |