[PATCH] Additional tests for assign
Paolo Carlini
pcarlini@unitus.it
Sun Dec 16 03:57:00 GMT 2001
Hi,
I would like to enrich 21_strings/assign.cc of the following tests, which, IMO,
better test for the issues with overlapping ranges originally evidenced by
libstdc++/4354.
Both of them are passed by the current mainline and fails with gcc-3_0 library.
Ok?
Cheers,
Paolo.
/////////////
2001-12-16 Paolo Carlini <pcarlini@unitus.it>
* testsuite/21_strings/assign.cc (test01): New tests.
--- assign.cc.orig Sun Dec 16 12:04:30 2001
+++ assign.cc Sun Dec 16 12:45:56 2001
@@ -37,6 +37,13 @@ test01()
if (i != string::npos)
aux.assign(aux, i + 1, string::npos);
VERIFY(aux == "Hawaii");
+
+ aux = strlit;
+ i = aux.rfind("r/");
+ if (i != string::npos)
+ aux.assign(aux, i + 1, string::npos);
+ VERIFY (aux.c_str()[9] == 'B');
+ VERIFY (aux == "/Hanalei Bay/Kauai/Hawaii");
}
// assign(const basic_string& __str, size_type __pos, size_type __n)
More information about the Libstdc++
mailing list