.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);
SeedRandom();
for(int i = 0; i < 140000000; i++) {
if(i % 10000000 == 0)
int i = 0;
int time0 = msecs();
while(msecs(time0) < 20000) {
if(++i % 10000000 == 0)
RLOG("Created " << i);
String s = pass ? "x" : RandomString(Random(4) ? 5 : 50);
ws.Add(ns.Add(s));

View file

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

View file

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

View file

@ -30,9 +30,10 @@ 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++) {
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++)
@ -42,7 +43,6 @@ void Check()
Check(T('b', l) + needle + T('c', r), needle, l);
}
}
}
ASSERT(T("test").Find("x") < 0);
}

View file

@ -2,12 +2,6 @@
using namespace Upp;
#ifdef flagLONG
#define N 100000000
#else
#define N 1000000
#endif
String RandomString(int n)
{
String h;
@ -20,8 +14,10 @@ CONSOLE_APP_MAIN
{
StringStream ss;
String es;
for(int i = 0; i < 100000000; i++) {
if(i % 10000 == 0)
int time0 = msecs();
int i = 0;
while(msecs(time0) < 150000) {
if(++i % 10000 == 0)
Cout() << i << "\r\n";
int p = Random(1000);
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");
return;
SeedRandom();
for(int i = 0; i < 100; i++) {
int time0 = msecs();
while(msecs(time0) < 150000) {
LOG("* " << i);
XmlNode n;
XmlNode& nn = n.Add();

View file

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