.autotests

git-svn-id: svn://ultimatepp.org/upp/trunk@7164 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2014-04-04 17:12:41 +00:00
parent 7df7017b8e
commit 0cfdc224aa
8 changed files with 44 additions and 24 deletions

View file

@ -30,8 +30,10 @@ CONSOLE_APP_MAIN
ns.ZeroTerminated(sz); ns.ZeroTerminated(sz);
SeedRandom(); SeedRandom();
for(int i = 0; i < 140000000; i++) { int i = 0;
if(i % 10000000 == 0) int time0 = msecs();
while(msecs(time0) < 20000) {
if(++i % 10000000 == 0)
RLOG("Created " << i); RLOG("Created " << i);
String s = pass ? "x" : RandomString(Random(4) ? 5 : 50); String s = pass ? "x" : RandomString(Random(4) ? 5 : 50);
ws.Add(ns.Add(s)); ws.Add(ns.Add(s));

View file

@ -17,6 +17,7 @@ CONSOLE_APP_MAIN
out.Put64(big, sz); out.Put64(big, sz);
LOG("Saved"); LOG("Saved");
} }
ASSERT(GetFileLength(path) == sz);
{ {
FileIn in(path); FileIn in(path);
for(int64 i = 0; i < sz; i++) for(int64 i = 0; i < sz; i++)
@ -31,5 +32,6 @@ CONSOLE_APP_MAIN
for(int64 i = 0; i < sz; i++) for(int64 i = 0; i < sz; i++)
ASSERT(big[i] == i % 123); ASSERT(big[i] == i % 123);
} }
DeleteFile(path);
LOG("Test passed OK"); LOG("Test passed OK");
} }

View file

@ -1,3 +1,5 @@
description "#WAIT: 20\377";
uses uses
Core; Core;

View file

@ -30,18 +30,18 @@ void Check(T haystack, T needle, int pos)
template <class T> template <class T>
void Check() void Check()
{ {
int time0 = msecs();
for(int l = 0; l < 30; l++) { while(msecs(time0) < 60000) {
for(int r = 0; r < 30; r++) { int l = Random(40);
LOG(l << ":" << r); int r = Random(40);
for(int nl = 0; nl < 30; nl++) LOG(l << ":" << r);
for(int nr = 0; nr < 30; nr++) for(int nl = 0; nl < 30; nl++)
for(int nc = 1; nc < 30; nc++) { for(int nr = 0; nr < 30; nr++)
T needle = T('a', nl) + T('x', nc) + T('a', nr); for(int nc = 1; nc < 30; nc++) {
Check(T('a', l) + needle + T('a', r), needle, l); T needle = T('a', nl) + T('x', nc) + T('a', nr);
Check(T('b', l) + needle + T('c', r), needle, l); 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); ASSERT(T("test").Find("x") < 0);

View file

@ -2,12 +2,6 @@
using namespace Upp; using namespace Upp;
#ifdef flagLONG
#define N 100000000
#else
#define N 1000000
#endif
String RandomString(int n) String RandomString(int n)
{ {
String h; String h;
@ -20,8 +14,10 @@ CONSOLE_APP_MAIN
{ {
StringStream ss; StringStream ss;
String es; String es;
for(int i = 0; i < 100000000; i++) { int time0 = msecs();
if(i % 10000 == 0) int i = 0;
while(msecs(time0) < 150000) {
if(++i % 10000 == 0)
Cout() << i << "\r\n"; Cout() << i << "\r\n";
int p = Random(1000); int p = Random(1000);
String h = RandomString(p); String h = RandomString(p);

14
autotest/XmlStream/3.xml Normal file
View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<TcEventSources>
<Source>
<Id>551</Id>
<Event>
<Id>201</Id>
<!-- Rumpftyp : NC-Programm, additional ID 23 bis 30 -->
<Message LcId="2052">
<!-- &#37;1 '&#37;13' @CH:&#37;2 @KLASSE:&#37;3/&#37;4 @N:&#37;23 @PRG:&#37;24 @DATEI:&#37;25 @V1:&#37;14 @V2:&#37;15 @V3:&#37;16 @V4: @V5: @K1:&#37;19 @K2:&#37;20 @K3:&#37;21 @K4:&#37;22 @TYP:&#37;12 @PFAD:&#37;29 @FOFFS:&#37;26 @BOFFS:&#37;27 @TOFFS:&#37;28 @PINFO:&#37;30 @MODUL:&#37;5 @ZEILE:&#37;6 @MID:&#37;7 @BF:&#37;8 @COM:&#37;9 @VER:&#37;11 @ZEIT:&#37;10 -->
&#37;1 '&#37;13' @CH:&#37;2 @CLASS:&#37;3/&#37;4 @N:&#37;23 @PRG:&#37;24 @FILE:&#37;25 @V1:&#37;14 @V2:&#37;15 @V3:&#37;16 @V4:&#37;17 @V5:&#37;18 @K1:&#37;19 @K2:&#37;20 @K3:&#37;21 @K4:&#37;22 @TYPE:&#37;12 @PATH:&#37;29 @FOFFS:&#37;26 @BOFFS:&#37;27 @TOFFS:&#37;28 @PINFO:&#37;30 @MODUL:&#37;5 @LINE:&#37;6 @MID:&#37;7 @BF:&#37;8 @COM:&#37;9 @VER:&#37;11 @TIME:&#37;10
</Message>
</Event>
</Source>
</TcEventSources>

View file

@ -73,9 +73,12 @@ CONSOLE_APP_MAIN
LOG("----- Fixed files OK"); LOG("----- Fixed files OK");
return;
SeedRandom(); SeedRandom();
for(int i = 0; i < 100; i++) { int time0 = msecs();
while(msecs(time0) < 150000) {
LOG("* " << i); LOG("* " << i);
XmlNode n; XmlNode n;
XmlNode& nn = n.Add(); XmlNode& nn = n.Add();

View file

@ -5,7 +5,8 @@ file
XmlStream.cpp, XmlStream.cpp,
0.xml, 0.xml,
1.xml, 1.xml,
2.xml; 2.xml,
3.xml;
mainconfig mainconfig
"" = "SSE2 TEST_XML"; "" = "SSE2 TEST_XML";