My favorites | Sign in
Project Home Downloads Source
Checkout   Browse   Changes    
 
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);
}

Change log

r4418 by cxl on Jan 14, 2012   Diff
.developign svo_value
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 834 bytes, 41 lines
Powered by Google Project Hosting