/* * Copyright (c) 2010 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ #include #include #include #include #include using namespace Swift; class IBBParserTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(IBBParserTest); CPPUNIT_TEST(testParse_Data); CPPUNIT_TEST_SUITE_END(); public: void testParse_Data() { PayloadsParserTester parser; CPPUNIT_ASSERT(parser.parse( "\n" "\t YWJjZGVmZ2loamtsbW5vcHFyc3R1dnd4eXpBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWjEyMzQ1\n" "\t Njc4OTAK\n" "" )); IBB::ref ibb = parser.getPayload(); CPPUNIT_ASSERT(ibb->getAction() == IBB::Data); CPPUNIT_ASSERT(createByteArray("abcdefgihjklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890\x0a") == ibb->getData()); CPPUNIT_ASSERT_EQUAL(4, ibb->getSequenceNumber()); } }; CPPUNIT_TEST_SUITE_REGISTRATION(IBBParserTest);