diff options
author | Tobias Markmann <tm@ayena.de> | 2016-03-31 14:57:35 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2016-03-31 14:57:35 (GMT) |
commit | cfbdb43d2cadd40aa87338d41548e4bf89e146e6 (patch) | |
tree | 18d94153a302445196fc0c18586abf44a1ce4a38 /Swiften/Parser/UnitTest/BOSHBodyExtractorTest.cpp | |
parent | 1d545a4a7fb877f021508094b88c1f17b30d8b4e (diff) | |
download | swift-cfbdb43d2cadd40aa87338d41548e4bf89e146e6.zip swift-cfbdb43d2cadd40aa87338d41548e4bf89e146e6.tar.bz2 |
Convert tabs to 4 spaces for all source files
Removed trailing spaces and whitespace on empty lines
in the process.
Changed CheckTabs.py tool to disallow hard tabs in source
files.
Test-Information:
Manually checked 30 random files that the conversion worked
as expected.
Change-Id: I874f99d617bd3d2bb55f02d58f22f58f9b094480
Diffstat (limited to 'Swiften/Parser/UnitTest/BOSHBodyExtractorTest.cpp')
-rw-r--r-- | Swiften/Parser/UnitTest/BOSHBodyExtractorTest.cpp | 172 |
1 files changed, 86 insertions, 86 deletions
diff --git a/Swiften/Parser/UnitTest/BOSHBodyExtractorTest.cpp b/Swiften/Parser/UnitTest/BOSHBodyExtractorTest.cpp index a72f5aa..f7ed80f 100644 --- a/Swiften/Parser/UnitTest/BOSHBodyExtractorTest.cpp +++ b/Swiften/Parser/UnitTest/BOSHBodyExtractorTest.cpp @@ -13,92 +13,92 @@ using namespace Swift; class BOSHBodyExtractorTest : public CppUnit::TestFixture { - CPPUNIT_TEST_SUITE(BOSHBodyExtractorTest); - CPPUNIT_TEST(testGetBody); - CPPUNIT_TEST(testGetBody_EmptyContent); - CPPUNIT_TEST(testGetBody_EmptyContent2); - CPPUNIT_TEST(testGetBody_EmptyElementEmptyContent); - CPPUNIT_TEST(testGetBody_InvalidStartTag); - CPPUNIT_TEST(testGetBody_InvalidStartTag2); - CPPUNIT_TEST(testGetBody_IncompleteStartTag); - CPPUNIT_TEST(testGetBody_InvalidEndTag); - CPPUNIT_TEST(testGetBody_InvalidEndTag2); - CPPUNIT_TEST_SUITE_END(); - - public: - void testGetBody() { - BOSHBodyExtractor testling(&parserFactory, createByteArray( - "<body a1='a\"1' a2=\"a'2\" boo='bar' >" - "foo <message> <body> bar" - "</body > ")); - - CPPUNIT_ASSERT(testling.getBody()); - CPPUNIT_ASSERT_EQUAL(std::string("a\"1"), testling.getBody()->attributes.getAttribute("a1")); - CPPUNIT_ASSERT_EQUAL(std::string("foo <message> <body> bar"), testling.getBody()->content); - } - - void testGetBody_EmptyContent() { - BOSHBodyExtractor testling(&parserFactory, createByteArray( - "<body foo='bar'/>")); - - CPPUNIT_ASSERT(testling.getBody()); - CPPUNIT_ASSERT_EQUAL(std::string("bar"), testling.getBody()->attributes.getAttribute("foo")); - CPPUNIT_ASSERT(testling.getBody()->content.empty()); - } - - void testGetBody_EmptyContent2() { - BOSHBodyExtractor testling(&parserFactory, createByteArray( - "<body foo='bar'></body>")); - - CPPUNIT_ASSERT(testling.getBody()); - CPPUNIT_ASSERT_EQUAL(std::string("bar"), testling.getBody()->attributes.getAttribute("foo")); - CPPUNIT_ASSERT(testling.getBody()->content.empty()); - } - - void testGetBody_EmptyElementEmptyContent() { - BOSHBodyExtractor testling(&parserFactory, createByteArray( - "<body/>")); - - CPPUNIT_ASSERT(testling.getBody()); - } - - void testGetBody_InvalidStartTag() { - BOSHBodyExtractor testling(&parserFactory, createByteArray( - "<bodi></body>")); - - CPPUNIT_ASSERT(!testling.getBody()); - } - - void testGetBody_InvalidStartTag2() { - BOSHBodyExtractor testling(&parserFactory, createByteArray( - "<bodyy></body>")); - - CPPUNIT_ASSERT(!testling.getBody()); - } - - void testGetBody_IncompleteStartTag() { - BOSHBodyExtractor testling(&parserFactory, createByteArray( - "<body")); - - CPPUNIT_ASSERT(!testling.getBody()); - } - - void testGetBody_InvalidEndTag() { - BOSHBodyExtractor testling(&parserFactory, createByteArray( - "<body></bodi>")); - - CPPUNIT_ASSERT(!testling.getBody()); - } - - void testGetBody_InvalidEndTag2() { - BOSHBodyExtractor testling(&parserFactory, createByteArray( - "<body><b/body>")); - - CPPUNIT_ASSERT(!testling.getBody()); - } - - private: - PlatformXMLParserFactory parserFactory; + CPPUNIT_TEST_SUITE(BOSHBodyExtractorTest); + CPPUNIT_TEST(testGetBody); + CPPUNIT_TEST(testGetBody_EmptyContent); + CPPUNIT_TEST(testGetBody_EmptyContent2); + CPPUNIT_TEST(testGetBody_EmptyElementEmptyContent); + CPPUNIT_TEST(testGetBody_InvalidStartTag); + CPPUNIT_TEST(testGetBody_InvalidStartTag2); + CPPUNIT_TEST(testGetBody_IncompleteStartTag); + CPPUNIT_TEST(testGetBody_InvalidEndTag); + CPPUNIT_TEST(testGetBody_InvalidEndTag2); + CPPUNIT_TEST_SUITE_END(); + + public: + void testGetBody() { + BOSHBodyExtractor testling(&parserFactory, createByteArray( + "<body a1='a\"1' a2=\"a'2\" boo='bar' >" + "foo <message> <body> bar" + "</body > ")); + + CPPUNIT_ASSERT(testling.getBody()); + CPPUNIT_ASSERT_EQUAL(std::string("a\"1"), testling.getBody()->attributes.getAttribute("a1")); + CPPUNIT_ASSERT_EQUAL(std::string("foo <message> <body> bar"), testling.getBody()->content); + } + + void testGetBody_EmptyContent() { + BOSHBodyExtractor testling(&parserFactory, createByteArray( + "<body foo='bar'/>")); + + CPPUNIT_ASSERT(testling.getBody()); + CPPUNIT_ASSERT_EQUAL(std::string("bar"), testling.getBody()->attributes.getAttribute("foo")); + CPPUNIT_ASSERT(testling.getBody()->content.empty()); + } + + void testGetBody_EmptyContent2() { + BOSHBodyExtractor testling(&parserFactory, createByteArray( + "<body foo='bar'></body>")); + + CPPUNIT_ASSERT(testling.getBody()); + CPPUNIT_ASSERT_EQUAL(std::string("bar"), testling.getBody()->attributes.getAttribute("foo")); + CPPUNIT_ASSERT(testling.getBody()->content.empty()); + } + + void testGetBody_EmptyElementEmptyContent() { + BOSHBodyExtractor testling(&parserFactory, createByteArray( + "<body/>")); + + CPPUNIT_ASSERT(testling.getBody()); + } + + void testGetBody_InvalidStartTag() { + BOSHBodyExtractor testling(&parserFactory, createByteArray( + "<bodi></body>")); + + CPPUNIT_ASSERT(!testling.getBody()); + } + + void testGetBody_InvalidStartTag2() { + BOSHBodyExtractor testling(&parserFactory, createByteArray( + "<bodyy></body>")); + + CPPUNIT_ASSERT(!testling.getBody()); + } + + void testGetBody_IncompleteStartTag() { + BOSHBodyExtractor testling(&parserFactory, createByteArray( + "<body")); + + CPPUNIT_ASSERT(!testling.getBody()); + } + + void testGetBody_InvalidEndTag() { + BOSHBodyExtractor testling(&parserFactory, createByteArray( + "<body></bodi>")); + + CPPUNIT_ASSERT(!testling.getBody()); + } + + void testGetBody_InvalidEndTag2() { + BOSHBodyExtractor testling(&parserFactory, createByteArray( + "<body><b/body>")); + + CPPUNIT_ASSERT(!testling.getBody()); + } + + private: + PlatformXMLParserFactory parserFactory; }; CPPUNIT_TEST_SUITE_REGISTRATION(BOSHBodyExtractorTest); |