mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-09-05 17:44:55 -06:00
.autotests
git-svn-id: svn://ultimatepp.org/upp/trunk@7164 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
7df7017b8e
commit
0cfdc224aa
8 changed files with 44 additions and 24 deletions
|
|
@ -30,18 +30,18 @@ void Check(T haystack, T needle, int pos)
|
|||
template <class T>
|
||||
void Check()
|
||||
{
|
||||
|
||||
for(int l = 0; l < 30; l++) {
|
||||
for(int r = 0; r < 30; r++) {
|
||||
LOG(l << ":" << r);
|
||||
for(int nl = 0; nl < 30; nl++)
|
||||
for(int nr = 0; nr < 30; nr++)
|
||||
for(int nc = 1; nc < 30; nc++) {
|
||||
T needle = T('a', nl) + T('x', nc) + T('a', nr);
|
||||
Check(T('a', l) + needle + T('a', r), needle, l);
|
||||
Check(T('b', l) + needle + T('c', r), needle, l);
|
||||
}
|
||||
}
|
||||
int time0 = msecs();
|
||||
while(msecs(time0) < 60000) {
|
||||
int l = Random(40);
|
||||
int r = Random(40);
|
||||
LOG(l << ":" << r);
|
||||
for(int nl = 0; nl < 30; nl++)
|
||||
for(int nr = 0; nr < 30; nr++)
|
||||
for(int nc = 1; nc < 30; nc++) {
|
||||
T needle = T('a', nl) + T('x', nc) + T('a', nr);
|
||||
Check(T('a', l) + needle + T('a', r), needle, l);
|
||||
Check(T('b', l) + needle + T('c', r), needle, l);
|
||||
}
|
||||
}
|
||||
|
||||
ASSERT(T("test").Find("x") < 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue