[Pkg-owncloud-commits] [owncloud-client] 104/115: Excludes: Fix unit tests for the new exclude load interface.
Sandro Knauß
hefee-guest at moszumanska.debian.org
Fri Aug 29 22:04:06 UTC 2014
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit e06e5fe55f16e664e639868cd7e224b15383e38f
Author: Klaas Freitag <freitag at owncloud.com>
Date: Thu Aug 21 13:12:05 2014 +0200
Excludes: Fix unit tests for the new exclude load interface.
Also removed some commented lines.
---
csync/tests/csync_tests/check_csync_exclude.c | 31 ++++++---------------------
1 file changed, 7 insertions(+), 24 deletions(-)
diff --git a/csync/tests/csync_tests/check_csync_exclude.c b/csync/tests/csync_tests/check_csync_exclude.c
index f1fcb37..50c8780 100644
--- a/csync/tests/csync_tests/check_csync_exclude.c
+++ b/csync/tests/csync_tests/check_csync_exclude.c
@@ -25,6 +25,8 @@
#define CSYNC_TEST 1
#include "csync_exclude.c"
+#define EXCLUDE_LIST_FILE SOURCEDIR"/../sync-exclude.lst"
+
static void setup(void **state) {
CSYNC *csync;
int rc;
@@ -42,7 +44,7 @@ static void setup_init(void **state) {
rc = csync_create(&csync, "/tmp/check_csync1", "/tmp/check_csync2");
assert_int_equal(rc, 0);
- rc = csync_exclude_load(csync, SOURCEDIR "/../sync-exclude.lst");
+ rc = csync_exclude_load(EXCLUDE_LIST_FILE, &(csync->excludes));
assert_int_equal(rc, 0);
*state = csync;
@@ -66,7 +68,7 @@ static void teardown(void **state) {
static void check_csync_exclude_add(void **state)
{
CSYNC *csync = *state;
- _csync_exclude_add(csync, (const char *) "/tmp/check_csync1/*");
+ _csync_exclude_add(&(csync->excludes), "/tmp/check_csync1/*");
assert_string_equal(csync->excludes->vector[0], "/tmp/check_csync1/*");
}
@@ -75,10 +77,11 @@ static void check_csync_exclude_load(void **state)
CSYNC *csync = *state;
int rc;
- rc = csync_exclude_load(csync, SOURCEDIR "/../sync-exclude.lst");
+ rc = csync_exclude_load(EXCLUDE_LIST_FILE, &(csync->excludes) );
assert_int_equal(rc, 0);
assert_string_equal(csync->excludes->vector[0], "*.filepart");
+ assert_int_not_equal(csync->excludes->count, 0);
}
static void check_csync_excluded(void **state)
@@ -106,15 +109,9 @@ static void check_csync_excluded(void **state)
rc = csync_excluded(csync, "foo/bar/.apdisk", CSYNC_FTW_TYPE_DIR);
assert_int_equal(rc, CSYNC_FILE_EXCLUDE_LIST);
- /*
- * Pattern: .java/
- * A file wont be excluded but a directory .java will be.
- */
- /* rc = csync_excluded(csync, ".java", CSYNC_FTW_TYPE_DIR);
- assert_int_equal(rc, CSYNC_FILE_EXCLUDE_LIST);
rc = csync_excluded(csync, ".java", CSYNC_FTW_TYPE_FILE);
assert_int_equal(rc, CSYNC_NOT_EXCLUDED);
-*/
+
/* Files in the ignored dir .java will also be ignored. */
rc = csync_excluded(csync, ".apdisk/totally_amazing.jar", CSYNC_FTW_TYPE_FILE);
assert_int_equal(rc, CSYNC_FILE_EXCLUDE_LIST);
@@ -141,20 +138,6 @@ static void check_csync_excluded(void **state)
/* Not excluded because the pattern .netscape/cache requires directory. */
rc = csync_excluded(csync, ".netscape/cache", CSYNC_FTW_TYPE_FILE);
assert_int_equal(rc, CSYNC_NOT_EXCLUDED);
-/*
- rc = csync_excluded(csync, ".netscape/cache", CSYNC_FTW_TYPE_DIR);
- assert_int_equal(rc, CSYNC_FILE_EXCLUDE_LIST);*/
-
- /* Excluded because the parent dir .netscape/cache is ingored. */
-/* rc = csync_excluded(csync, ".netscape/cache/foo", CSYNC_FTW_TYPE_FILE);
- assert_int_equal(rc, CSYNC_FILE_EXCLUDE_LIST);
-
- rc = csync_excluded(csync, ".netscape/cache/bar.txt", CSYNC_FTW_TYPE_FILE);
- assert_int_equal(rc, CSYNC_FILE_EXCLUDE_LIST);
-
- rc = csync_excluded(csync, ".netscape/cache/longrun", CSYNC_FTW_TYPE_DIR);
- assert_int_equal(rc, CSYNC_FILE_EXCLUDE_LIST);
-*/
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list