diff --git a/upptst/FileOutLocking/FileOutLocking.cpp b/upptst/FileOutLocking/FileOutLocking.cpp new file mode 100644 index 000000000..992d04785 --- /dev/null +++ b/upptst/FileOutLocking/FileOutLocking.cpp @@ -0,0 +1,18 @@ +#include + +using namespace Upp; + +CONSOLE_APP_MAIN +{ + for(;;) { + Cout() << "Press ENTER to open FileOut\n"; + ReadStdIn(); + FileOut out(ConfigFile("testfile")); + if(out) { + Cout() << "file opened\nPress ENTER to close\n"; + ReadStdIn(); + } + else + Cout() << "NOT opened\n"; + } +} diff --git a/upptst/FileOutLocking/FileOutLocking.upp b/upptst/FileOutLocking/FileOutLocking.upp new file mode 100644 index 000000000..c38fc0d84 --- /dev/null +++ b/upptst/FileOutLocking/FileOutLocking.upp @@ -0,0 +1,11 @@ +description "Testing the locking of FileOut\377"; + +uses + Core; + +file + FileOutLocking.cpp; + +mainconfig + "" = "SSE2"; + diff --git a/upptst/FileOutLocking/init b/upptst/FileOutLocking/init new file mode 100644 index 000000000..f5c1c22da --- /dev/null +++ b/upptst/FileOutLocking/init @@ -0,0 +1,4 @@ +#ifndef _FileOutLocking_icpp_init_stub +#define _FileOutLocking_icpp_init_stub +#include "Core/init" +#endif diff --git a/upptst/StringStream/StringStream.cpp b/upptst/StringStream/StringStream.cpp new file mode 100644 index 000000000..77c8b4e7e --- /dev/null +++ b/upptst/StringStream/StringStream.cpp @@ -0,0 +1,35 @@ +#include + +using namespace Upp; + +String RandomString(int n) +{ + String h; + while(n-- > 0) + h.Cat((byte)Random()); + return h; +} + +CONSOLE_APP_MAIN +{ + StringStream ss; + String es; + for(int i = 0; i < 100000000; i++) { + if(i % 10000 == 0) + Cout() << i << "\r\n"; + int p = Random(1000); + String h = RandomString(p); + ss.Put(h); + es.Cat(h); + + if(Random(15) == 0) { + h = ss.GetResult(); + ASSERT(h == es); + } + if(Random(15) == 0) { + ss.Create(); + es.Clear(); + } +// LOGHEXDUMP(es, es.GetCount()); + } +} diff --git a/upptst/StringStream/StringStream.upp b/upptst/StringStream/StringStream.upp new file mode 100644 index 000000000..f17c9dc1d --- /dev/null +++ b/upptst/StringStream/StringStream.upp @@ -0,0 +1,11 @@ +description "String stream unit testing\377"; + +uses + Core; + +file + StringStream.cpp; + +mainconfig + "" = "SSE2"; + diff --git a/upptst/StringStream/init b/upptst/StringStream/init new file mode 100644 index 000000000..28b4bb1a3 --- /dev/null +++ b/upptst/StringStream/init @@ -0,0 +1,4 @@ +#ifndef _StringStream_icpp_init_stub +#define _StringStream_icpp_init_stub +#include "Core/init" +#endif