Added fix for bug.

git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@949 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
rich_sposato 2009-01-26 02:04:40 +00:00
parent 7724ac7220
commit 6968fcd422

View file

@ -1003,6 +1003,32 @@ void Compare()
*/
}
}
/// 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()
*/
int main()
{
TestBug2536490();
srand(unsigned(time(0)));
Compare();
return 0;