summaryrefslogtreecommitdiffstats
blob: e13c94b1aa4dcc22e87d24c40319df70c9490193 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>

#include "Swiften/Application/Application.h"
#include "Swiften/Application/Platform/PlatformApplication.h"

using namespace Swift;

class ApplicationTest : public CppUnit::TestFixture
{
		CPPUNIT_TEST_SUITE(ApplicationTest);
		CPPUNIT_TEST(testGetSettingsDir);
		CPPUNIT_TEST_SUITE_END();

	public:
		ApplicationTest() {}

		void setUp() {
			testling_ = new PlatformApplication("SwiftTest");
		}

		void tearDown() {
      delete testling_;
		}

		void testGetSettingsDir() {
			boost::filesystem::path dir = testling_->getSettingsDir();

			CPPUNIT_ASSERT(boost::filesystem::exists(dir));
			CPPUNIT_ASSERT(boost::filesystem::is_directory(dir));

			boost::filesystem::remove(dir);
		}
	
	private:
		Application* testling_;
};

CPPUNIT_TEST_SUITE_REGISTRATION(ApplicationTest);