My favorites
▼
|
Sign in
upp-mirror
U++ is the C++ development platform
Project Home
Downloads
Source
Checkout
Browse
Changes
Source path:
svn
/
trunk
/
upptst
/
SvoValue
/
Raw.cpp
r5005
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "SvoValue.h"
void CheckRawValue()
{
typedef Tuple2<int, int> T;
T x = MakeTuple(11, 22);
Value v = RawToValue(x);
const T& x2 = v.To<T>();
ASSERT(x2 == x);
}
void CheckRawPickValue()
{
Vector<int> x;
x.Add(123);
Value v = RawPickToValue(x);
ASSERT(v.Is< Vector<int> >());
const Vector<int>& xx = v.To< Vector<int> >();
ASSERT(xx.GetCount() == 1);
ASSERT(xx[0] == 123);
x.Clear();
x.Add(321);
v = RawDeepToValue(x);
const Vector<int>& x2 = v.To< Vector<int> >();
ASSERT(x2.GetCount() == 1);
ASSERT(x2[0] == 321);
ASSERT(x.GetCount() == 1);
ASSERT(x[0] == 321);
}
void CheckCreateRawValue()
{
Value v;
Vector<int>& x = CreateRawValue< Vector<int> >(v);
x.Add(123);
ASSERT(v.Is< Vector<int> >());
const Vector<int>& xx = v.To< Vector<int> >();
ASSERT(xx.GetCount() == 1);
ASSERT(xx[0] == 123);
}
Show details
Hide details
Change log
r4418
by cxl on Jan 14, 2012
Diff
.developign svo_value
Go to:
/trunk/upptst/SvoValue/Checks.cpp
/trunk/upptst/SvoValue/Raw.cpp
/trunk/upptst/SvoValue/SvoValue.cpp
/trunk/upptst/SvoValue/SvoValue.h
/trunk/upptst/SvoValue/SvoValue.upp
Project members,
sign in
to write a code review
Older revisions
All revisions of this file
File info
Size: 834 bytes, 41 lines
View raw file
Powered by
Google Project Hosting