This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Stop awk from complaining about 27_io/ostream_inserter_arith.cc
- To: libstdc++ at sourceware dot cygnus dot com
- Subject: Stop awk from complaining about 27_io/ostream_inserter_arith.cc
- From: Branko Čibej <branko dot cibej at hermes dot si>
- Date: Mon, 26 Jun 2000 22:11:44 +0200
- Organization: HERMES SoftLab
- References: <3957A54F.6258F014@hermes.si>
Oh yes, another thing has been bugging me: 27_io/ostream_inserter_arith.cc
writes a load of output which gets slurped up into $E_TIME_TEXT in mkcheck.
Then awk tries to find the time field:
awk: record `expect: 1.2 result: ...' has too many fields
I think all that stuff doesn't need to be printed when the testsuite is
running, as the output is checked explicitly, anyway. So I changed the
testcase so that it prints things only if DEBUG_ASSERT isn't defined.
(It's defined by default in mkcheck; but perhaps we should have another
flag for such things?)
I also took the opportunity to rename __TEST_NUMPUT_VERBOSE to
TEST_NUMPUT_VERBOSE; a testcase isn't the implementation, after all,
and shouldn't use that identifier.
So now I get a Really Completely Clean Test Run (... except for the bus
errors from the static lib ...).
Brane
--
Branko Čibej <branko.cibej@hermes.si>
HERMES SoftLab, Litijska 51, 1000 Ljubljana, Slovenia
voice: (+386 1) 586 53 49 fax: (+386 1) 586 52 70
2000-06-26 Branko Cibej <branko.cibej@hermes.si>
* testsuite/27_io/ostream_inserter_arith.cc: Renamed
__TEST_NUMPUT_VERBOSE to TEST_NUMPUT_VERBOSE.
Define TEST_NUMPUT_VERBOSE only if DEBUG_ASSERT.
Index: testsuite/27_io/ostream_inserter_arith.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc,v
retrieving revision 1.2
diff -c -p -r1.2 ostream_inserter_arith.cc
*** ostream_inserter_arith.cc 2000/06/13 23:48:29 1.2
--- ostream_inserter_arith.cc 2000/06/26 20:01:34
***************
*** 28,34 ****
using namespace std;
! #define __TEST_NUMPUT_VERBOSE 1
struct _TestCase
{
--- 28,36 ----
using namespace std;
! #ifndef DEBUG_ASSERT
! # define TEST_NUMPUT_VERBOSE 1
! #endif
struct _TestCase
{
*************** void test01()
*** 190,196 ****
for (int j=0; j<sizeof(testcases)/sizeof(testcases[0]); j++)
{
_TestCase & tc = testcases[j];
! #ifdef __TEST_NUMPUT_VERBOSE
cout << "expect: " << tc.result << endl;
#endif
// test double with char type
--- 192,198 ----
for (int j=0; j<sizeof(testcases)/sizeof(testcases[0]); j++)
{
_TestCase & tc = testcases[j];
! #ifdef TEST_NUMPUT_VERBOSE
cout << "expect: " << tc.result << endl;
#endif
// test double with char type
*************** void test01()
*** 201,207 ****
os.imbue(__loc);
apply_formatting(tc, os);
os << tc.val;
! #ifdef __TEST_NUMPUT_VERBOSE
cout << "result: " << os.str() << endl;
#endif
assert(os && os.str() == tc.result);
--- 203,209 ----
os.imbue(__loc);
apply_formatting(tc, os);
os << tc.val;
! #ifdef TEST_NUMPUT_VERBOSE
cout << "result: " << os.str() << endl;
#endif
assert(os && os.str() == tc.result);
*************** void test01()
*** 214,220 ****
os.imbue(__loc);
apply_formatting(tc, os);
os << (long double)tc.val;
! #ifdef __TEST_NUMPUT_VERBOSE
cout << "result: " << os.str() << endl;
#endif
assert(os && os.str() == tc.result);
--- 216,222 ----
os.imbue(__loc);
apply_formatting(tc, os);
os << (long double)tc.val;
! #ifdef TEST_NUMPUT_VERBOSE
cout << "result: " << os.str() << endl;
#endif
assert(os && os.str() == tc.result);
*************** void test02()
*** 257,263 ****
char largebuf[512];
sprintf(largebuf, "%.*Le", prec, val);
! #ifdef __TEST_NUMPUT_VERBOSE
cout << "expect: " << largebuf << endl;
cout << "result: " << os.str() << endl;
#endif
--- 259,265 ----
char largebuf[512];
sprintf(largebuf, "%.*Le", prec, val);
! #ifdef TEST_NUMPUT_VERBOSE
cout << "expect: " << largebuf << endl;
cout << "result: " << os.str() << endl;
#endif
*************** int main()
*** 298,304 ****
{
test01();
test02();
! #ifdef __TEST_NUMPUT_VERBOSE
cout << "Test passed!" << endl;
#endif
return 0;
--- 300,306 ----
{
test01();
test02();
! #ifdef TEST_NUMPUT_VERBOSE
cout << "Test passed!" << endl;
#endif
return 0;