diff options
Diffstat (limited to 'Swiften/QA/StorageTest/FileWriteBytestreamTest.cpp')
-rw-r--r-- | Swiften/QA/StorageTest/FileWriteBytestreamTest.cpp | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/Swiften/QA/StorageTest/FileWriteBytestreamTest.cpp b/Swiften/QA/StorageTest/FileWriteBytestreamTest.cpp index 3686cf9..e847c28 100644 --- a/Swiften/QA/StorageTest/FileWriteBytestreamTest.cpp +++ b/Swiften/QA/StorageTest/FileWriteBytestreamTest.cpp @@ -17,42 +17,42 @@ using namespace Swift; class FileWriteBytestreamTest : public CppUnit::TestFixture { - CPPUNIT_TEST_SUITE(FileWriteBytestreamTest); - CPPUNIT_TEST(testSuccessfulWrite); - CPPUNIT_TEST(testFailingWrite); - CPPUNIT_TEST_SUITE_END(); + CPPUNIT_TEST_SUITE(FileWriteBytestreamTest); + CPPUNIT_TEST(testSuccessfulWrite); + CPPUNIT_TEST(testFailingWrite); + CPPUNIT_TEST_SUITE_END(); - public: - void setUp() { - onWriteWasCalled = false; - } + public: + void setUp() { + onWriteWasCalled = false; + } - void testSuccessfulWrite() { - boost::filesystem::path filename = boost::filesystem::unique_path("write_file_bytestream_test_%%%%%%%%%%%%%%%%.bin"); - boost::shared_ptr<WriteBytestream> writeBytestream = boost::make_shared<FileWriteBytestream>(filename.string()); - writeBytestream->onWrite.connect(boost::bind(&FileWriteBytestreamTest::handleOnWrite, this, _1)); + void testSuccessfulWrite() { + boost::filesystem::path filename = boost::filesystem::unique_path("write_file_bytestream_test_%%%%%%%%%%%%%%%%.bin"); + boost::shared_ptr<WriteBytestream> writeBytestream = boost::make_shared<FileWriteBytestream>(filename.string()); + writeBytestream->onWrite.connect(boost::bind(&FileWriteBytestreamTest::handleOnWrite, this, _1)); - CPPUNIT_ASSERT_EQUAL(true, writeBytestream->write(createByteArray("Some data."))); - CPPUNIT_ASSERT_EQUAL(true, onWriteWasCalled); + CPPUNIT_ASSERT_EQUAL(true, writeBytestream->write(createByteArray("Some data."))); + CPPUNIT_ASSERT_EQUAL(true, onWriteWasCalled); - boost::filesystem::remove(filename); - } + boost::filesystem::remove(filename); + } - void testFailingWrite() { - boost::shared_ptr<WriteBytestream> writeBytestream = boost::make_shared<FileWriteBytestream>(""); - writeBytestream->onWrite.connect(boost::bind(&FileWriteBytestreamTest::handleOnWrite, this, _1)); + void testFailingWrite() { + boost::shared_ptr<WriteBytestream> writeBytestream = boost::make_shared<FileWriteBytestream>(""); + writeBytestream->onWrite.connect(boost::bind(&FileWriteBytestreamTest::handleOnWrite, this, _1)); - CPPUNIT_ASSERT_EQUAL(false, writeBytestream->write(createByteArray("Some data."))); - CPPUNIT_ASSERT_EQUAL(false, onWriteWasCalled); - } + CPPUNIT_ASSERT_EQUAL(false, writeBytestream->write(createByteArray("Some data."))); + CPPUNIT_ASSERT_EQUAL(false, onWriteWasCalled); + } - void handleOnWrite(const std::vector<unsigned char>& /*data*/) { - onWriteWasCalled = true; - } + void handleOnWrite(const std::vector<unsigned char>& /*data*/) { + onWriteWasCalled = true; + } - private: - bool onWriteWasCalled; + private: + bool onWriteWasCalled; }; CPPUNIT_TEST_SUITE_REGISTRATION(FileWriteBytestreamTest); |