repr-action-test.cpp revision 89949341e299d2857fc2435d5a8758845947dc0a
#include <stdlib.h>
#include <glib.h>
#include "repr.h"
#include "event-fns.h"
utest_start("XML Transactions");
UTEST_TEST("rollback of node addition") {
root->appendChild(a);
}
UTEST_TEST("rollback of node removal") {
root->appendChild(a);
sp_repr_unparent(a);
}
sp_repr_unparent(a);
UTEST_TEST("rollback of node reordering") {
root->appendChild(a);
root->appendChild(b);
root->appendChild(c);
UTEST_ASSERT(sp_repr_next(a) == b);
UTEST_ASSERT(sp_repr_next(b) == c);
root->changeOrder(b, c);
UTEST_ASSERT(sp_repr_next(a) == c);
UTEST_ASSERT(sp_repr_next(c) == b);
UTEST_ASSERT(sp_repr_next(a) == b);
UTEST_ASSERT(sp_repr_next(b) == c);
}
sp_repr_unparent(a);
sp_repr_unparent(b);
sp_repr_unparent(c);
/* lots more tests needed ... */
return utest_end() ? 0 : 1;
}