You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.3 KiB
53 lines
1.3 KiB
15 years ago
|
// tdiffer.cpp -- Regression test program, differential commit tests
|
||
|
// $Id$
|
||
|
// This is part of Metakit, see http://www.equi4.com/metakit/
|
||
|
|
||
|
#include "regress.h"
|
||
|
|
||
|
void TestDiffer()
|
||
|
{
|
||
|
B(d01, Commit aside, 0) W(d01a); W(d01b);
|
||
|
{
|
||
|
c4_IntProp p1 ("p1");
|
||
|
{
|
||
|
c4_Storage s1 ("d01a", 1);
|
||
|
A(s1.Strategy().FileSize() == 0);
|
||
|
c4_View v1 = s1.GetAs("a[p1:I]");
|
||
|
v1.Add(p1 [123]);
|
||
|
s1.Commit();
|
||
|
}
|
||
|
{
|
||
|
c4_Storage s1 ("d01a", 0);
|
||
|
c4_Storage s2 ("d01b", 1);
|
||
|
s1.SetAside(s2);
|
||
|
c4_View v1 = s1.View("a");
|
||
|
A(v1.GetSize() == 1);
|
||
|
A(p1 (v1[0]) == 123);
|
||
|
v1.Add(p1 [456]);
|
||
|
A(v1.GetSize() == 2);
|
||
|
A(p1 (v1[0]) == 123);
|
||
|
A(p1 (v1[1]) == 456);
|
||
|
s1.Commit();
|
||
|
A(v1.GetSize() == 2);
|
||
|
A(p1 (v1[0]) == 123);
|
||
|
A(p1 (v1[1]) == 456);
|
||
|
s2.Commit();
|
||
|
A(v1.GetSize() == 2);
|
||
|
A(p1 (v1[0]) == 123);
|
||
|
A(p1 (v1[1]) == 456);
|
||
|
}
|
||
|
{
|
||
|
c4_Storage s1 ("d01a", 0);
|
||
|
c4_View v1 = s1.View("a");
|
||
|
A(v1.GetSize() == 1);
|
||
|
A(p1 (v1[0]) == 123);
|
||
|
c4_Storage s2 ("d01b", 0);
|
||
|
s1.SetAside(s2);
|
||
|
c4_View v2 = s1.View("a");
|
||
|
A(v2.GetSize() == 2);
|
||
|
A(p1 (v2[0]) == 123);
|
||
|
A(p1 (v2[1]) == 456);
|
||
|
}
|
||
|
} D(d01a); D(d01b); R(d01a); R(d01b); E;
|
||
|
}
|