Skip to content

Commit 620e671

Browse files
committed
Simplify HTMLLayout unit test
1 parent 4e208b7 commit 620e671

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

src/test/cpp/xml/xmllayouttest.cpp

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -482,9 +482,9 @@ LOGUNIT_CLASS(XMLLayoutTest)
482482
encoder->encode(html, iter, buf);
483483
LOGUNIT_ASSERT(iter == html.end());
484484
buf.flip();
485-
apr_xml_parser* parser = apr_xml_parser_create(p.getAPRPool());
485+
auto parser = apr_xml_parser_create(p.getAPRPool());
486486
LOGUNIT_ASSERT(parser != 0);
487-
apr_status_t stat = apr_xml_parser_feed(parser, buf.data(), buf.remaining());
487+
auto stat = apr_xml_parser_feed(parser, buf.data(), buf.remaining());
488488
LOGUNIT_ASSERT(stat == APR_SUCCESS);
489489
apr_xml_doc* doc = 0;
490490
stat = apr_xml_parser_done(parser, &doc);
@@ -494,19 +494,11 @@ LOGUNIT_CLASS(XMLLayoutTest)
494494

495495
int childElementCount = 0;
496496
for ( auto node = parsedResult->first_child
497-
; node != NULL
498-
; node = node->next)
497+
; node != NULL
498+
; node = node->next)
499499
{
500500
childElementCount++;
501-
502-
switch (childElementCount)
503-
{
504-
case 1:
505-
LOGUNIT_ASSERT_EQUAL(std::string("tr"), std::string(node->name));
506-
break;
507-
default:
508-
break;
509-
}
501+
LOGUNIT_ASSERT_EQUAL(std::string("tr"), std::string(node->name));
510502
}
511503
LOGUNIT_ASSERT(1 < childElementCount);
512504
}

0 commit comments

Comments
 (0)