|
From: <ric...@us...> - 2009-01-26 02:21:13
|
Revision: 949
http://loki-lib.svn.sourceforge.net/loki-lib/?rev=949&view=rev
Author: rich_sposato
Date: 2009-01-26 02:04:40 +0000 (Mon, 26 Jan 2009)
Log Message:
-----------
Added fix for bug.
Modified Paths:
--------------
trunk/test/flex_string/main.cpp
Modified: trunk/test/flex_string/main.cpp
===================================================================
--- trunk/test/flex_string/main.cpp 2009-01-26 01:55:50 UTC (rev 948)
+++ trunk/test/flex_string/main.cpp 2009-01-26 02:04:40 UTC (rev 949)
@@ -1003,6 +1003,32 @@
*/
}
}
+
+/// This function tests out a bug found by Jean-Francois Bastien in the find function.
+void TestBug2536490( void )
+{
+
+ my_string bug;
+ std::cout << "Index of '6' in \"" << bug.c_str() << "\": " << bug.find('6') << std::endl;
+ bug = "12345";
+ std::cout << "Index of '6' in \"" << bug.c_str() << "\": " << bug.find('6') << std::endl;
+ bug = "123456";
+ std::cout << "Index of '6' in \"" << bug.c_str() << "\": " << bug.find('6') << std::endl;
+ bug = "12345";
+ std::cout << "Index of '6' in \"" << bug.c_str() << "\": " << bug.find('6') << std::endl;
+
+ bug = "12345";
+ std::cout << "Index of '123' in \"" << bug.c_str() << "\": " << bug.find("123") << std::endl;
+ bug = "12345";
+ std::cout << "Index of '12345' in \"" << bug.c_str() << "\": " << bug.find("12345") << std::endl;
+ bug = "12345";
+ std::cout << "Index of '345' in \"" << bug.c_str() << "\": " << bug.find("345") << std::endl;
+ bug = "123456";
+ std::cout << "Index of '456' in \"" << bug.c_str() << "\": " << bug.find("456") << std::endl;
+ bug = "12345";
+ std::cout << "Index of '456' in \"" << bug.c_str() << "\": " << bug.find("456") << std::endl;
+}
+
/*
#include <string>
#include <limits>
@@ -1033,6 +1059,7 @@
*/
int main()
{
+ TestBug2536490();
srand(unsigned(time(0)));
Compare();
return 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|