git-svn-id: svn://ultimatepp.org/upp/trunk@6667 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2013-12-17 19:40:22 +00:00
parent 58937d5b31
commit 4e8488b910
3 changed files with 46 additions and 0 deletions

33
upptst/Zlib/Zlib.cpp Normal file
View 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
View file

@ -0,0 +1,9 @@
uses
Core;
file
Zlib.cpp;
mainconfig
"" = "SSE2";

4
upptst/Zlib/init Normal file
View file

@ -0,0 +1,4 @@
#ifndef _Zlib_icpp_init_stub
#define _Zlib_icpp_init_stub
#include "Core/init"
#endif