#include "compare.hh" #include #include void test1(); void test2(); int main(int argc, char *argv[]) { test1(); test2(); } void test1() { xmlNodePtr m = xmlNewNode(0, reinterpret_cast("node")); xmlNodePtr n = xmlNewNode(0, reinterpret_cast("node")); int c = compare(m, n, true); assert(!c); xmlFree(n); xmlFree(m); } void test2() { xmlNodePtr m = xmlNewNode(0, reinterpret_cast("node")); xmlSetProp(m, reinterpret_cast("with"), reinterpret_cast("attr")); xmlNodePtr n = xmlNewNode(0, reinterpret_cast("node")); xmlSetProp(n, reinterpret_cast("with"), reinterpret_cast("other value")); int c = compare(m, n, true); assert(c < 0); xmlFree(n); xmlFree(m); }