mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-21 06:45:39 -06:00
upptst: Stream64PutGet
git-svn-id: svn://ultimatepp.org/upp/trunk@5823 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
9e1b30113a
commit
097016ab24
3 changed files with 48 additions and 0 deletions
35
upptst/Stream64PutGet/Stream64PutGet.cpp
Normal file
35
upptst/Stream64PutGet/Stream64PutGet.cpp
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
#include <Core/Core.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
StdLogSetup(LOG_FILE|LOG_COUT);
|
||||
const int64 sz = (int64)5 * 1000 * 1000 * 1000;
|
||||
String path = GetHomeDirFile("test.bin");
|
||||
{
|
||||
Buffer<byte> big(sz);
|
||||
LOG("Allocated");
|
||||
for(int64 i = 0; i < sz; i++) {
|
||||
big[i] = i % 123;
|
||||
}
|
||||
FileOut out(path);
|
||||
out.Put64(big, sz);
|
||||
LOG("Saved");
|
||||
}
|
||||
{
|
||||
FileIn in(path);
|
||||
for(int64 i = 0; i < sz; i++)
|
||||
ASSERT(in.Get() == i % 123);
|
||||
LOG("Loaded by bytes");
|
||||
}
|
||||
{
|
||||
Buffer<byte> big(sz);
|
||||
FileIn in(path);
|
||||
ASSERT(in.GetAll64(big, sz));
|
||||
LOG("Loaded by GetAll64");
|
||||
for(int64 i = 0; i < sz; i++)
|
||||
ASSERT(big[i] == i % 123);
|
||||
}
|
||||
LOG("Test passed OK");
|
||||
}
|
||||
9
upptst/Stream64PutGet/Stream64PutGet.upp
Normal file
9
upptst/Stream64PutGet/Stream64PutGet.upp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
uses
|
||||
Core;
|
||||
|
||||
file
|
||||
Stream64PutGet.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "SSE2";
|
||||
|
||||
4
upptst/Stream64PutGet/init
Normal file
4
upptst/Stream64PutGet/init
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef _Stream64PutGet_icpp_init_stub
|
||||
#define _Stream64PutGet_icpp_init_stub
|
||||
#include "Core/init"
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue