diff options
Diffstat (limited to 'tests/test_document.cpp')
-rw-r--r-- | tests/test_document.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_document.cpp b/tests/test_document.cpp index c34eb42..c75ed8f 100644 --- a/tests/test_document.cpp +++ b/tests/test_document.cpp @@ -1220,3 +1220,18 @@ TEST(document_load_stream_truncated) } } #endif + +TEST(document_alignment) +{ + char buf[256 + sizeof(xml_document)]; + + for (size_t offset = 0; offset < 256; offset += sizeof(void*)) + { + xml_document* doc = new (buf + offset) xml_document; + + CHECK(doc->load(STR("<node />"))); + CHECK_NODE(*doc, STR("<node />")); + + doc->~xml_document(); + } +} |