mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-21 06:45:39 -06:00
.upptst
git-svn-id: svn://ultimatepp.org/upp/trunk@6655 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
ac0ddefb1a
commit
613ffd0d58
3 changed files with 38 additions and 15 deletions
4
upptst/FileSel/init
Normal file
4
upptst/FileSel/init
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef _FileSel_icpp_init_stub
|
||||
#define _FileSel_icpp_init_stub
|
||||
#include "CtrlLib/init"
|
||||
#endif
|
||||
|
|
@ -62,7 +62,7 @@ void InVectorTest()
|
|||
|
||||
for(int i = 0; i < 100; i++) {
|
||||
int n = Random(100) + 20;
|
||||
InVector<T>::Iterator it2, it = iv.Begin();
|
||||
typename InVector<T>::Iterator it2, it = iv.Begin();
|
||||
it += n;
|
||||
ASSERT(it - iv.Begin() == n);
|
||||
it2 = it;
|
||||
|
|
|
|||
|
|
@ -4,11 +4,19 @@ using namespace Upp;
|
|||
|
||||
template <class T>
|
||||
void Test(T& data)
|
||||
{
|
||||
{
|
||||
LOG("-----------------");
|
||||
T data2;
|
||||
String bin = StoreAsString(data);
|
||||
LoadFromString(data2, bin);
|
||||
data2.Shrink();
|
||||
ASSERT(StoreAsJson(data) == StoreAsJson(data2));
|
||||
ASSERT(StoreAsString(data) == StoreAsString(data2));
|
||||
|
||||
String xml = StoreAsXML(data);
|
||||
DUMP(xml);
|
||||
LoadFromXML(data2, xml);
|
||||
data2.Shrink();
|
||||
ASSERT(StoreAsJson(data) == StoreAsJson(data2));
|
||||
ASSERT(StoreAsString(data) == StoreAsString(data2));
|
||||
|
||||
|
|
@ -16,6 +24,7 @@ void Test(T& data)
|
|||
DUMP(json);
|
||||
data2.Clear();
|
||||
LoadFromJson(data2, json);
|
||||
data2.Shrink();
|
||||
ASSERT(StoreAsXML(data) == StoreAsXML(data2));
|
||||
ASSERT(StoreAsString(data) == StoreAsString(data2));
|
||||
}
|
||||
|
|
@ -46,30 +55,40 @@ void TestMap()
|
|||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
Test< Vector<String> >();
|
||||
Test< WithDeepCopy< Vector<String> > >();
|
||||
StdLogSetup(LOG_FILE|LOG_COUT);
|
||||
|
||||
Test< Vector<String> >();
|
||||
Test< WithDeepCopy< Vector<String> > >();
|
||||
|
||||
Test< Array<String> >();
|
||||
Test< WithDeepCopy< Array<String> > >();
|
||||
Test< Array<String> >();
|
||||
Test< WithDeepCopy< Array<String> > >();
|
||||
|
||||
Test< Index<String> >();
|
||||
Test< WithDeepCopy< Index<String> > >();
|
||||
Test< Index<String> >();
|
||||
Test< WithDeepCopy< Index<String> > >();
|
||||
|
||||
Test< ArrayIndex<String> >();
|
||||
Test< WithDeepCopy< ArrayIndex<String> > >();
|
||||
Test< ArrayIndex<String> >();
|
||||
Test< WithDeepCopy< ArrayIndex<String> > >();
|
||||
|
||||
TestMap< VectorMap<int, String> >();
|
||||
TestMap< WithDeepCopy< VectorMap<int, String> > >();
|
||||
TestMap< VectorMap<int, String> >();
|
||||
TestMap< WithDeepCopy< VectorMap<int, String> > >();
|
||||
|
||||
Test< InVector<String> >();
|
||||
Test< WithDeepCopy<InVector<String> > >();
|
||||
|
||||
Test< InArray<String> >();
|
||||
Test< WithDeepCopy<InArray<String> > >();
|
||||
|
||||
Test< SortedIndex<String> >();
|
||||
Test< WithDeepCopy<SortedIndex<String> > >();
|
||||
|
||||
TestMap< VectorMap<int, String> >();
|
||||
TestMap< WithDeepCopy< VectorMap<int, String> > >();
|
||||
|
||||
TestMap< ArrayMap<int, String> >();
|
||||
TestMap< WithDeepCopy< ArrayMap<int, String> > >();
|
||||
|
||||
TestMap< SortedVectorMap<int, String> >();
|
||||
TestMap< WithDeepCopy< SortedVectorMap<int, String> > >();
|
||||
|
||||
TestMap< SortedArrayMap<int, String> >();
|
||||
TestMap< WithDeepCopy< SortedArrayMap<int, String> > >();
|
||||
|
||||
LOG("========= EVERYTHING OK ==========");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue