tests from Node's operator bool()

This commit is contained in:
jez 2007-01-02 11:33:29 +00:00
parent ed46fc0f01
commit 8c89727a06
2 changed files with 7 additions and 0 deletions

View file

@ -25,9 +25,11 @@ class DOMImplementationTest : public TestCase
{
DOM::DOMImplementation<string_type> di;
assert(di == 0);
assert(!di);
DOM::DOMImplementation<string_type> di2 = SimpleDOM::DOMImplementation<string_type, string_adaptor>::getDOMImplementation();
assert(di2 != 0);
assert(di2);
assert(di != di2);
assert(di2 != di);

View file

@ -32,21 +32,26 @@ class DocumentTest : public TestCase
assert(d == 0);
assert(n == 0);
assert(n == d);
assert(!d);
assert(!n);
} // testNull
void testAssignment()
{
DOM::Document<string_type> d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0);
assert(d != 0);
assert(d);
assert(d.getNodeName() == SA::construct_from_utf8("#document"));
assert(d.getNodeValue() == SA::construct_from_utf8(""));
DOM::Node<string_type> n;
assert(n == 0);
assert(!n);
assert(n != d);
n = d;
assert(n);
assert(n == d);
assert(d == DOM::Document<string_type>(n));