+2000-06-13 Brent Verner <brent@rcfile.org>
+
+ * bits/string.tcc (string::rfind): Fix.
+ * testsuite/21_strings/rfind.cc: New file.
+
+2000-06-26 Anthony Williams <anthony@anthonyw.cjb.net>
+
+ * testsuite/21_strings/ctor_copy_dtor.cc: Fixed logic error.
+
2000-06-26 Branko Cibej <branko.cibej@hermes.si>
- * mkcheck.in: Make the *.txt and *.tst files writable
- after copying them to $TEST_DIR.
+ * testsuite/27_io/filebuf_members.cc (test_01): Fixed typos.
+
+ * mkcheck.in: Make the *.txt and *.tst files writable after
+ copying them to $TEST_DIR.
+ * testsuite/27_io/ostream_inserter_arith.cc: Renamed
+ __TEST_NUMPUT_VERBOSE to TEST_NUMPUT_VERBOSE.
+ Define TEST_NUMPUT_VERBOSE only if DEBUG_ASSERT.
+
2000-06-23 Benjamin Kosnik <bkoz@purist.soma.redhat.com>
* bits/fstream.tcc (basic_filebuf::basic_filebuf(fd)): Use it.
size_type __size = this->size();
if (__n <= __size)
{
- size_t __xpos = __size - __n;
- if (__xpos > __pos)
- __xpos = __pos;
-
- for (++__xpos; __xpos-- > 0; )
- if (traits_type::eq(_M_data()[__xpos], *__s)
- && traits_type::compare(_M_data() + __xpos, __s, __n) == 0)
- return __xpos;
+ __pos = std::min(__size - __n ,__pos);
+ const _CharT* __data = _M_data();
+ do
+ {
+ if (traits_type::compare(__data + __pos, __s, __n) == 0)
+ return __pos;
+ }
+ while (__pos-- > 0);
}
return npos;
}
// 1999-06-04 bkoz
-// Copyright (C) 1999 Free Software Foundation, Inc.
+// Copyright (C) 1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// NB: As strlen(str_lit01) != csz01, this test is undefined. It
// should not crash, but what gets constructed is a bit arbitrary.
+ // The "maverick's" of all string objects.
try {
- std::string str04(str_lit01, npos); // the "maverick's" of all string objects.
+ std::string str04(str_lit01, npos);
test &= true;
}
catch(std::length_error& fail) {
test &= false;
}
+ // Build a maxsize-1 lengthed string consisting of all A's
try {
- std::string str03(str_lit01, csz01 - 1);
- test &= str03.size() != 0;
+ std::string str03(csz01 - 1, 'A');
+ test &= str03.size() == csz01 - 1;
test &= str03.size() <= str03.capacity();
}
// NB: bad_alloc is regrettable but entirely kosher for
int close_num;
// read (ext)
- int fd = open(name01, O_RDONLY);
+ int fd = open(name_01, O_RDONLY);
test &= fd >= 0;
{
// read (standard)
- FILE* f = fopen(name01, "r");
+ FILE* f = fopen(name_01, "r");
test &= !f;
{
- std::ifstream ifstream1(name02);
+ std::ifstream ifstream1(name_01);
test &= ifstream1.is_open();
std::ios_base::iostate st01 = ifstream1.rdstate();
test &= st01 == std::ios_base::goodbit;
using namespace std;
-#define __TEST_NUMPUT_VERBOSE 1
+#ifndef DEBUG_ASSERT
+# define TEST_NUMPUT_VERBOSE 1
+#endif
struct _TestCase
{
for (int j=0; j<sizeof(testcases)/sizeof(testcases[0]); j++)
{
_TestCase & tc = testcases[j];
-#ifdef __TEST_NUMPUT_VERBOSE
+#ifdef TEST_NUMPUT_VERBOSE
cout << "expect: " << tc.result << endl;
#endif
// test double with char type
os.imbue(__loc);
apply_formatting(tc, os);
os << tc.val;
-#ifdef __TEST_NUMPUT_VERBOSE
+#ifdef TEST_NUMPUT_VERBOSE
cout << "result: " << os.str() << endl;
#endif
assert(os && os.str() == tc.result);
os.imbue(__loc);
apply_formatting(tc, os);
os << (long double)tc.val;
-#ifdef __TEST_NUMPUT_VERBOSE
+#ifdef TEST_NUMPUT_VERBOSE
cout << "result: " << os.str() << endl;
#endif
assert(os && os.str() == tc.result);
char largebuf[512];
sprintf(largebuf, "%.*Le", prec, val);
-#ifdef __TEST_NUMPUT_VERBOSE
+#ifdef TEST_NUMPUT_VERBOSE
cout << "expect: " << largebuf << endl;
cout << "result: " << os.str() << endl;
#endif
{
test01();
test02();
-#ifdef __TEST_NUMPUT_VERBOSE
+#ifdef TEST_NUMPUT_VERBOSE
cout << "Test passed!" << endl;
#endif
return 0;