mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
.upptst
git-svn-id: svn://ultimatepp.org/upp/trunk@6667 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
58937d5b31
commit
4e8488b910
3 changed files with 46 additions and 0 deletions
33
upptst/Zlib/Zlib.cpp
Normal file
33
upptst/Zlib/Zlib.cpp
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
#include <Core/Core.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
String RandomString(int len)
|
||||
{
|
||||
StringBuffer r;
|
||||
for(int i = 0; i < len; i++)
|
||||
if(Random(30) == 0)
|
||||
r.Cat("\r\n");
|
||||
else
|
||||
r.Cat(Random(64) + 32);
|
||||
return r;
|
||||
}
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
StdLogSetup(LOG_FILE|LOG_COUT);
|
||||
|
||||
String data = RandomString(2000000);
|
||||
|
||||
ASSERT(ZDecompress(ZCompress(data)) == data);
|
||||
ASSERT(GZDecompress(GZCompress(data)) == data);
|
||||
|
||||
String path = GetHomeDirFile("test.txt");
|
||||
SaveFile(path, data);
|
||||
GZCompressFile(path);
|
||||
GZDecompressFile(path + ".2", path + ".gz");
|
||||
|
||||
ASSERT(LoadFile(path + ".2") == data);
|
||||
|
||||
LOG("============= OK");
|
||||
}
|
||||
9
upptst/Zlib/Zlib.upp
Normal file
9
upptst/Zlib/Zlib.upp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
uses
|
||||
Core;
|
||||
|
||||
file
|
||||
Zlib.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "SSE2";
|
||||
|
||||
4
upptst/Zlib/init
Normal file
4
upptst/Zlib/init
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef _Zlib_icpp_init_stub
|
||||
#define _Zlib_icpp_init_stub
|
||||
#include "Core/init"
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue