Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaniel Molkentin <danimo@owncloud.com>2014-08-27 11:15:31 +0400
committerDaniel Molkentin <danimo@owncloud.com>2014-08-27 12:27:29 +0400
commit2c6324e3e5096af5199bd11e533921d106802ae6 (patch)
tree36fba64220f80709b6c278fca0acbd2b20297f00 /test
parente442ba863aacc83b483ae19dc900dea5295f5230 (diff)
Fix tests
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt8
-rw-r--r--test/owncloud_add_test.cmake7
-rw-r--r--test/testfolder.h47
3 files changed, 57 insertions, 5 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 37ac1e83b..597fb2e31 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -8,16 +8,16 @@ owncloud_add_test(OwncloudPropagator "")
owncloud_add_test(Utility "")
owncloud_add_test(Updater "")
-SET(FolderWatcher_SRC ../src/mirall/folderwatcher.cpp)
+SET(FolderWatcher_SRC ../src/gui/folderwatcher.cpp)
IF( NOT WIN32 AND NOT APPLE )
-list(APPEND FolderWatcher_SRC ../src/mirall/folderwatcher_linux.cpp)
+list(APPEND FolderWatcher_SRC ../src/gui/folderwatcher_linux.cpp)
ENDIF()
IF( WIN32 )
-list(APPEND FolderWatcher_SRC ../src/mirall/folderwatcher_win.cpp)
+list(APPEND FolderWatcher_SRC ../src/gui/folderwatcher_win.cpp)
ENDIF()
IF( APPLE )
-list(APPEND FolderWatcher_SRC ../src/mirall/folderwatcher_mac.cpp)
+list(APPEND FolderWatcher_SRC ../src/gui/folderwatcher_mac.cpp)
ENDIF()
owncloud_add_test(FolderWatcher "${FolderWatcher_SRC}")
diff --git a/test/owncloud_add_test.cmake b/test/owncloud_add_test.cmake
index 698e9dc8b..14ee6285d 100644
--- a/test/owncloud_add_test.cmake
+++ b/test/owncloud_add_test.cmake
@@ -1,5 +1,10 @@
macro(owncloud_add_test test_class additional_cpp)
- include_directories(${QT_INCLUDES} "${PROJECT_SOURCE_DIR}/src" ${CMAKE_CURRENT_BINARY_DIR})
+ include_directories(${QT_INCLUDES}
+ "${PROJECT_SOURCE_DIR}/src/gui"
+ "${PROJECT_SOURCE_DIR}/src/libsync"
+ "${CMAKE_BINARY_DIR}/src/libsync"
+ "${CMAKE_CURRENT_BINARY_DIR}"
+ )
set(OWNCLOUD_TEST_CLASS ${test_class})
set(CMAKE_AUTOMOC TRUE)
diff --git a/test/testfolder.h b/test/testfolder.h
new file mode 100644
index 000000000..9f3f8f8d5
--- /dev/null
+++ b/test/testfolder.h
@@ -0,0 +1,47 @@
+/*
+ * This software is in the public domain, furnished "as is", without technical
+ * support, and with no warranty, express or implied, as to its usefulness for
+ * any purpose.
+ *
+ */
+
+#ifndef MIRALL_TESTFOLDER_H
+#define MIRALL_TESTFOLDER_H
+
+#include <QtTest>
+
+#include "utility.h"
+#include "folder.h"
+
+using namespace Mirall;
+
+class TestFolder: public QObject
+{
+ Q_OBJECT
+private slots:
+ void testFolder()
+ {
+ QFETCH(QString, folder);
+ QFETCH(QString, expectedFolder);
+ Folder *f = new Folder("alias", folder, "http://foo.bar.net");
+ QCOMPARE(f->path(), expectedFolder);
+ delete f;
+ }
+
+ void testFolder_data()
+ {
+ QTest::addColumn<QString>("folder");
+ QTest::addColumn<QString>("expectedFolder");
+
+ QTest::newRow("unixcase") << "/foo/bar" << "/foo/bar";
+ QTest::newRow("doubleslash") << "/foo//bar" << "/foo/bar";
+ QTest::newRow("tripleslash") << "/foo///bar" << "/foo/bar";
+ QTest::newRow("mixedslash") << "/foo/\\bar" << "/foo/bar";
+ QTest::newRow("windowsfwslash") << "C:/foo/bar" << "C:/foo/bar";
+ QTest::newRow("windowsbwslash") << "C:\\foo" << "C:/foo";
+ QTest::newRow("windowsbwslash2") << "C:\\foo\\bar" << "C:/foo/bar";
+ }
+
+};
+
+#endif