[Pkg-owncloud-commits] [owncloud-client] 102/333: Remove the check_csync_treewalk

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu Apr 17 23:16:40 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 114c8de8148c014937e365667acf279677e79144
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Thu Mar 6 15:29:57 2014 +0100

    Remove the check_csync_treewalk
    
    because it runs csync_update which need to browse the owncloud directory
    And there is no server
---
 csync/tests/CMakeLists.txt                     |   3 -
 csync/tests/csync_tests/check_csync_treewalk.c | 141 -------------------------
 2 files changed, 144 deletions(-)

diff --git a/csync/tests/CMakeLists.txt b/csync/tests/CMakeLists.txt
index a43bb27..22394f2 100644
--- a/csync/tests/CMakeLists.txt
+++ b/csync/tests/CMakeLists.txt
@@ -46,9 +46,6 @@ add_cmocka_test(check_csync_init csync_tests/check_csync_init.c ${TEST_TARGET_LI
 add_cmocka_test(check_csync_statedb_query csync_tests/check_csync_statedb_query.c ${TEST_TARGET_LIBRARIES})
 add_cmocka_test(check_csync_commit csync_tests/check_csync_commit.c ${TEST_TARGET_LIBRARIES})
 
-# treewalk
-add_cmocka_test(check_csync_treewalk csync_tests/check_csync_treewalk.c ${TEST_TARGET_LIBRARIES})
-
 # vio
 add_cmocka_test(check_vio_file_stat vio_tests/check_vio_file_stat.c ${TEST_TARGET_LIBRARIES})
 add_cmocka_test(check_vio vio_tests/check_vio.c ${TEST_TARGET_LIBRARIES})
diff --git a/csync/tests/csync_tests/check_csync_treewalk.c b/csync/tests/csync_tests/check_csync_treewalk.c
deleted file mode 100644
index 31d0ee4..0000000
--- a/csync/tests/csync_tests/check_csync_treewalk.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * libcsync -- a library to sync a directory with another
- *
- * Copyright (c) 2008-2013 by Andreas Schneider <asn at cryptomilk.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include <string.h>
-
-#include "torture.h"
-
-#define CSYNC_TEST 1
-#include "csync_private.h"
-
-static void setup_local(void **state) {
-    CSYNC *csync;
-    int rc;
-
-    rc = system("mkdir -p /tmp/check_csync1");
-    assert_int_equal(rc, 0);
-
-    rc = system("mkdir -p /tmp/check_csync2");
-    assert_int_equal(rc, 0);
-
-    rc = system("mkdir -p /tmp/check_csync");
-    assert_int_equal(rc, 0);
-
-    rc = system("echo \"This is test data\" > /tmp/check_csync1/testfile1.txt");
-    assert_int_equal(rc, 0);
-
-    rc = system("echo \"This is also test data\" > /tmp/check_csync1/testfile2.txt");
-    assert_int_equal(rc, 0);
-
-    rc = csync_create(&csync, "/tmp/check_csync1", "/tmp/check_csync2");
-    assert_int_equal(rc, 0);
-
-    rc = csync_set_config_dir(csync, "/tmp/check_csync/");
-    assert_int_equal(rc, 0);
-
-    rc = csync_init(csync);
-    assert_int_equal(rc, 0);
-
-    *state = csync;
-}
-
-static void teardown_local(void **state) {
-    CSYNC *csync = (CSYNC *)*state;
-
-    csync_destroy(csync);
-    system("rm -rf /tmp/check_csync1");
-    system("rm -rf /tmp/check_csync2");
-    system("rm -rf /tmp/check_csync");
-}
-
-static int visitor(TREE_WALK_FILE* file, void *userdata)
-{
-    int *file_count;
-
-    assert_non_null(userdata);
-    assert_non_null(file);
-
-    file_count = (int *)userdata;
-
-    (*file_count)++;
-
-    return 0;
-}
-
-static void check_csync_treewalk_local(void **state)
-{
-    CSYNC *csync = (CSYNC *)*state;
-    int file_count = 0;
-    int rc;
-
-    csync_set_userdata(csync, (void *)&file_count);
-
-    rc = csync_walk_local_tree(csync, &visitor, 0);
-    assert_int_equal(rc, 0);
-    assert_int_equal(file_count, 0);
-
-    rc = csync_update(csync);
-    assert_int_equal(rc, 0);
-
-    rc = csync_walk_local_tree(csync, &visitor, 0);
-    assert_int_equal(rc, 0);
-    assert_int_equal(file_count, 2);
-}
-
-static void check_csync_treewalk_local_with_filter(void **state)
-{
-    CSYNC *csync = (CSYNC *)*state;
-    int file_count = 0;
-    int rc;
-
-    csync_set_userdata(csync, &file_count);
-
-    rc = csync_walk_local_tree(csync, &visitor, 0);
-    assert_int_equal(rc, 0);
-    assert_int_equal(file_count, 0);
-
-    rc = csync_update(csync);
-    assert_int_equal(rc, 0);
-
-    rc = csync_walk_local_tree(csync, &visitor, CSYNC_INSTRUCTION_NEW);
-    assert_int_equal(rc, 0);
-    assert_int_equal(file_count, 2 );
-
-    file_count = 0;
-    rc = csync_walk_local_tree(csync,
-                               &visitor,
-                               CSYNC_INSTRUCTION_NEW|CSYNC_INSTRUCTION_REMOVE);
-    assert_int_equal(rc, 0);
-    assert_int_equal(file_count, 2);
-
-    file_count = 0;
-    rc = csync_walk_local_tree(csync, &visitor, CSYNC_INSTRUCTION_RENAME);
-    assert_int_equal(rc, 0);
-    assert_int_equal(file_count, 0);
-}
-
-int torture_run_tests(void)
-{
-  const UnitTest tests[] = {
-    unit_test_setup_teardown(check_csync_treewalk_local, setup_local, teardown_local ),
-    unit_test_setup_teardown(check_csync_treewalk_local_with_filter, setup_local, teardown_local)
-  };
-
-  return run_tests(tests);
-}

-- 
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