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

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2017-12-14 17:36:19 +0300
committerDominik Schmidt <dev@dominik-schmidt.de>2018-01-13 15:58:17 +0300
commitd948ed11a185be55ff414a7eb3ab9968801d01dc (patch)
tree547153e52d1d0783d379185a16750f54ed96d62f /test
parent257d8142b1af06e1a3892be5110b7b69e38a0659 (diff)
Csync: use QElapsedTimer and qCInfo instead of CSYNC_LOG and its own csync time function
This allow to remove all the csync time manipulation routne which are now unused
Diffstat (limited to 'test')
-rw-r--r--test/csync/CMakeLists.txt2
-rw-r--r--test/csync/std_tests/check_std_c_time.c101
2 files changed, 1 insertions, 102 deletions
diff --git a/test/csync/CMakeLists.txt b/test/csync/CMakeLists.txt
index 5cb0590e4..75cee7b7d 100644
--- a/test/csync/CMakeLists.txt
+++ b/test/csync/CMakeLists.txt
@@ -24,7 +24,7 @@ add_cmocka_test(check_std_c_alloc std_tests/check_std_c_alloc.c ${TEST_TARGET_LI
add_cmocka_test(check_std_c_jhash std_tests/check_std_c_jhash.c ${TEST_TARGET_LIBRARIES})
add_cmocka_test(check_std_c_path std_tests/check_std_c_path.c ${TEST_TARGET_LIBRARIES})
add_cmocka_test(check_std_c_str std_tests/check_std_c_str.c ${TEST_TARGET_LIBRARIES})
-add_cmocka_test(check_std_c_time std_tests/check_std_c_time.c ${TEST_TARGET_LIBRARIES})
+
# csync tests
# This will be rewritten soon anyway.
diff --git a/test/csync/std_tests/check_std_c_time.c b/test/csync/std_tests/check_std_c_time.c
deleted file mode 100644
index db8e72ff6..000000000
--- a/test/csync/std_tests/check_std_c_time.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * libcsync -- a library to sync a directory with another
- *
- * Copyright (c) 2008-2013 by Andreas Schneider <asn@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 "csync_time.h"
-#include "std/c_time.h"
-#include <unistd.h>
-
-#include "torture.h"
-
-static void check_c_tspecdiff(void **state)
-{
- struct timespec start, finish, diff;
-
- (void) state; /* unused */
-
- csync_gettime(&start);
- csync_gettime(&finish);
-
- diff = c_tspecdiff(finish, start);
-
- assert_int_equal(diff.tv_sec, 0);
- assert_true(diff.tv_nsec >= 0);
-}
-
-static void check_c_tspecdiff_five(void **state)
-{
- struct timespec start, finish, diff;
-
- (void) state; /* unused */
-
- csync_gettime(&start);
- sleep(5);
- csync_gettime(&finish);
-
- diff = c_tspecdiff(finish, start);
-
- assert_int_equal(diff.tv_sec, 5);
- assert_true(diff.tv_nsec > 0);
-}
-
-static void check_c_secdiff(void **state)
-{
- struct timespec start, finish;
- double diff;
-
- (void) state; /* unused */
-
- csync_gettime(&start);
- csync_gettime(&finish);
-
- diff = c_secdiff(finish, start);
-
- assert_true(diff >= 0.00 && diff < 1.00);
-}
-
-static void check_c_secdiff_three(void **state)
-{
- struct timespec start, finish;
- double diff;
-
- (void) state; /* unused */
-
- csync_gettime(&start);
- sleep(3);
- csync_gettime(&finish);
-
- diff = c_secdiff(finish, start);
-
- assert_true(diff > 3.00 && diff < 4.00);
-}
-
-int torture_run_tests(void)
-{
- const struct CMUnitTest tests[] = {
- cmocka_unit_test(check_c_tspecdiff),
- cmocka_unit_test(check_c_tspecdiff_five),
- cmocka_unit_test(check_c_secdiff),
- cmocka_unit_test(check_c_secdiff_three),
- };
-
- return cmocka_run_group_tests(tests, NULL, NULL);
-}
-