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/PayloadParsers/UnitTest/CommandParserTest.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/PayloadParsers/UnitTest/CommandParserTest.cpp')
-rw-r--r-- | Swiften/Parser/PayloadParsers/UnitTest/CommandParserTest.cpp | 118 |
1 files changed, 59 insertions, 59 deletions
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/CommandParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/CommandParserTest.cpp index c47682c..fa8d014 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/CommandParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/CommandParserTest.cpp @@ -13,74 +13,74 @@ using namespace Swift; class CommandParserTest : public CppUnit::TestFixture { - CPPUNIT_TEST_SUITE(CommandParserTest); - CPPUNIT_TEST(testParse); - CPPUNIT_TEST(testParse_Result); - CPPUNIT_TEST(testParse_Form); - CPPUNIT_TEST_SUITE_END(); + CPPUNIT_TEST_SUITE(CommandParserTest); + CPPUNIT_TEST(testParse); + CPPUNIT_TEST(testParse_Result); + CPPUNIT_TEST(testParse_Form); + CPPUNIT_TEST_SUITE_END(); - public: - void testParse() { - PayloadsParserTester parser; + public: + void testParse() { + PayloadsParserTester parser; - CPPUNIT_ASSERT(parser.parse( - "<command xmlns='http://jabber.org/protocol/commands' node='list' action='prev' sessionid='myid'/>" - )); + CPPUNIT_ASSERT(parser.parse( + "<command xmlns='http://jabber.org/protocol/commands' node='list' action='prev' sessionid='myid'/>" + )); - Command::ref payload = parser.getPayload<Command>(); - CPPUNIT_ASSERT_EQUAL(Command::Prev, payload->getAction()); - CPPUNIT_ASSERT_EQUAL(std::string("list"), payload->getNode()); - CPPUNIT_ASSERT_EQUAL(std::string("myid"), payload->getSessionID()); - } + Command::ref payload = parser.getPayload<Command>(); + CPPUNIT_ASSERT_EQUAL(Command::Prev, payload->getAction()); + CPPUNIT_ASSERT_EQUAL(std::string("list"), payload->getNode()); + CPPUNIT_ASSERT_EQUAL(std::string("myid"), payload->getSessionID()); + } - void testParse_Result() { - PayloadsParserTester parser; + void testParse_Result() { + PayloadsParserTester parser; - CPPUNIT_ASSERT(parser.parse( - "<command xmlns='http://jabber.org/protocol/commands' node='config' status='completed' sessionid='myid'>" - "<note type='warn'>Service 'httpd' has been configured.</note>" - "<note type='error'>I lied.</note>" - "<actions execute='next'>" - "<prev/>" - "<next/>" - "</actions>" - "</command>" - )); + CPPUNIT_ASSERT(parser.parse( + "<command xmlns='http://jabber.org/protocol/commands' node='config' status='completed' sessionid='myid'>" + "<note type='warn'>Service 'httpd' has been configured.</note>" + "<note type='error'>I lied.</note>" + "<actions execute='next'>" + "<prev/>" + "<next/>" + "</actions>" + "</command>" + )); - Command::ref payload = parser.getPayload<Command>(); - CPPUNIT_ASSERT_EQUAL(Command::Completed, payload->getStatus()); - std::vector<Command::Note> notes = payload->getNotes(); - CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(notes.size())); - CPPUNIT_ASSERT_EQUAL(Command::Note::Warn, notes[0].type); - CPPUNIT_ASSERT_EQUAL(std::string("Service 'httpd' has been configured."), notes[0].note); - CPPUNIT_ASSERT_EQUAL(Command::Note::Error, notes[1].type); - CPPUNIT_ASSERT_EQUAL(std::string("I lied."), notes[1].note); - std::vector<Command::Action> actions = payload->getAvailableActions(); - CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(actions.size())); - CPPUNIT_ASSERT_EQUAL(Command::Prev, actions[0]); - CPPUNIT_ASSERT_EQUAL(Command::Next, actions[1]); - CPPUNIT_ASSERT_EQUAL(Command::Next, payload->getExecuteAction()); - } + Command::ref payload = parser.getPayload<Command>(); + CPPUNIT_ASSERT_EQUAL(Command::Completed, payload->getStatus()); + std::vector<Command::Note> notes = payload->getNotes(); + CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(notes.size())); + CPPUNIT_ASSERT_EQUAL(Command::Note::Warn, notes[0].type); + CPPUNIT_ASSERT_EQUAL(std::string("Service 'httpd' has been configured."), notes[0].note); + CPPUNIT_ASSERT_EQUAL(Command::Note::Error, notes[1].type); + CPPUNIT_ASSERT_EQUAL(std::string("I lied."), notes[1].note); + std::vector<Command::Action> actions = payload->getAvailableActions(); + CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(actions.size())); + CPPUNIT_ASSERT_EQUAL(Command::Prev, actions[0]); + CPPUNIT_ASSERT_EQUAL(Command::Next, actions[1]); + CPPUNIT_ASSERT_EQUAL(Command::Next, payload->getExecuteAction()); + } - void testParse_Form() { - PayloadsParserTester parser; + void testParse_Form() { + PayloadsParserTester parser; - CPPUNIT_ASSERT(parser.parse( - "<command xmlns='http://jabber.org/protocol/commands' node='config' status='completed'>" - "<x type=\"result\" xmlns=\"jabber:x:data\">" - "<title>Bot Configuration</title>" - "<instructions>Hello!</instructions>" - "<instructions>Fill out this form to configure your new bot!</instructions>" - "</x>" - "</command>" - )); + CPPUNIT_ASSERT(parser.parse( + "<command xmlns='http://jabber.org/protocol/commands' node='config' status='completed'>" + "<x type=\"result\" xmlns=\"jabber:x:data\">" + "<title>Bot Configuration</title>" + "<instructions>Hello!</instructions>" + "<instructions>Fill out this form to configure your new bot!</instructions>" + "</x>" + "</command>" + )); - Command::ref payload = parser.getPayload<Command>(); - Form::ref form = payload->getForm(); - CPPUNIT_ASSERT_EQUAL(std::string("Bot Configuration"), form->getTitle()); - CPPUNIT_ASSERT_EQUAL(std::string("Hello!\nFill out this form to configure your new bot!"), form->getInstructions()); - CPPUNIT_ASSERT_EQUAL(Form::ResultType, form->getType()); - } + Command::ref payload = parser.getPayload<Command>(); + Form::ref form = payload->getForm(); + CPPUNIT_ASSERT_EQUAL(std::string("Bot Configuration"), form->getTitle()); + CPPUNIT_ASSERT_EQUAL(std::string("Hello!\nFill out this form to configure your new bot!"), form->getInstructions()); + CPPUNIT_ASSERT_EQUAL(Form::ResultType, form->getType()); + } }; CPPUNIT_TEST_SUITE_REGISTRATION(CommandParserTest); |