ultimatepp/autotest/Stream/Stream.cpp
cxl a87d322fee .autotest
git-svn-id: svn://ultimatepp.org/upp/trunk@9985 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2016-06-28 13:13:36 +00:00

29 lines
410 B
C++

#include <Core/Core.h>
using namespace Upp;
CONSOLE_APP_MAIN
{
StdLogSetup(LOG_COUT|LOG_FILE);
SizeStream ss;
ASSERT(ss.IsStoring());
ss.Put(0);
ASSERT(ss.GetSize() == 1);
int len = 1;
SeedRandom();
for(int i = 0; i < 100; i++) {
byte h[201];
int l = Random(200);
ss.Put(h, l);
len += l;
ASSERT(len == ss.GetSize());
}
LOG("============= OK");
}