mirror of
https://github.com/jezhiggins/arabica
synced 2025-01-30 08:38:15 +01:00
tests from Node's operator bool()
This commit is contained in:
parent
ed46fc0f01
commit
8c89727a06
2 changed files with 7 additions and 0 deletions
|
@ -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);
|
||||
|
|
|
@ -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));
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue