mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
.autotest
git-svn-id: svn://ultimatepp.org/upp/trunk@11743 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
4938356808
commit
7e253638c7
2 changed files with 63 additions and 0 deletions
54
autotest/Index/Index.cpp
Normal file
54
autotest/Index/Index.cpp
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
#include <Core/Core.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
StdLogSetup(LOG_COUT|LOG_FILE);
|
||||
|
||||
Index<String> m;
|
||||
String s = "hello";
|
||||
DUMP(s);
|
||||
m.Add(pick(s));
|
||||
DUMP(s);
|
||||
DUMP(m);
|
||||
ASSERT(s.GetCount() == 0);
|
||||
|
||||
s = "alfa";
|
||||
int w = m.FindAdd(pick(s));
|
||||
DUMP(m);
|
||||
DUMP(w);
|
||||
DUMP(s);
|
||||
ASSERT(w == 1);
|
||||
ASSERT(s.GetCount() == 0);
|
||||
|
||||
m.Unlink(0);
|
||||
s = "aaa";
|
||||
w = m.Put(pick(s));
|
||||
DUMP(m);
|
||||
DUMP(s);
|
||||
DUMP(w);
|
||||
ASSERT(w == 0);
|
||||
ASSERT(s.GetCount() == 0);
|
||||
ASSERT(m[0] == "aaa");
|
||||
|
||||
m.Unlink(0);
|
||||
s = "alfa";
|
||||
ASSERT(m.FindPut(pick(s)) == 1);
|
||||
|
||||
s = "beta";
|
||||
ASSERT(m.FindPut(pick(s)) == 0);
|
||||
ASSERT(s.GetCount() == 0);
|
||||
|
||||
s = "gamma";
|
||||
m.Set(0, pick(s));
|
||||
ASSERT(s.GetCount() == 0);
|
||||
ASSERT(m[0] == "gamma");
|
||||
|
||||
s = "delta";
|
||||
m << pick(s);
|
||||
DUMP(m);
|
||||
ASSERT(s.GetCount() == 0);
|
||||
|
||||
LOG("============= OK");
|
||||
}
|
||||
9
autotest/Index/Index.upp
Normal file
9
autotest/Index/Index.upp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
uses
|
||||
Core;
|
||||
|
||||
file
|
||||
Index.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "";
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue