From: Kevin Ottens Date: Tue, 1 Sep 2020 15:51:32 +0000 (+0200) Subject: Fix modernize-use-auto errors in csync tests X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~22^2~193^2~3 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9a0713fab79881f026faf607b4b5011ecdaf6af2;p=nextcloud-desktop.git Fix modernize-use-auto errors in csync tests Signed-off-by: Kevin Ottens --- diff --git a/test/csync/csync_tests/check_csync_exclude.cpp b/test/csync/csync_tests/check_csync_exclude.cpp index b55a72e54..18ca46d2c 100644 --- a/test/csync/csync_tests/check_csync_exclude.cpp +++ b/test/csync/csync_tests/check_csync_exclude.cpp @@ -73,7 +73,7 @@ static int setup_init(void **state) { } static int teardown(void **state) { - CSYNC *csync = (CSYNC*)*state; + auto *csync = (CSYNC*)*state; int rc = 0; auto statedb = csync->statedb; diff --git a/test/csync/csync_tests/check_csync_update.cpp b/test/csync/csync_tests/check_csync_update.cpp index a896905a2..859783950 100644 --- a/test/csync/csync_tests/check_csync_update.cpp +++ b/test/csync/csync_tests/check_csync_update.cpp @@ -146,7 +146,7 @@ static int setup_ftw(void **state) static int teardown(void **state) { - CSYNC *csync = (CSYNC*)*state; + auto *csync = (CSYNC*)*state; unlink(TESTDB); auto statedb = csync->statedb; @@ -216,7 +216,7 @@ static int failing_fn(CSYNC *ctx, /* detect a new file */ static void check_csync_detect_update(void **state) { - CSYNC *csync = (CSYNC*)*state; + auto *csync = (CSYNC*)*state; csync_file_stat_t *st = nullptr; std::unique_ptr fs; int rc = 0; @@ -239,7 +239,7 @@ static void check_csync_detect_update(void **state) */ static void check_csync_detect_update_db_none(void **state) { - CSYNC *csync = (CSYNC*)*state; + auto *csync = (CSYNC*)*state; csync_file_stat_t *st = nullptr; std::unique_ptr fs; int rc = 0; @@ -260,7 +260,7 @@ static void check_csync_detect_update_db_none(void **state) static void check_csync_detect_update_db_eval(void **state) { - CSYNC *csync = (CSYNC*)*state; + auto *csync = (CSYNC*)*state; csync_file_stat_t *st = nullptr; std::unique_ptr fs; int rc = 0; @@ -281,7 +281,7 @@ static void check_csync_detect_update_db_eval(void **state) static void check_csync_detect_update_db_rename(void **state) { - CSYNC *csync = (CSYNC*)*state; + auto *csync = (CSYNC*)*state; // csync_file_stat_t *st; std::unique_ptr fs; @@ -306,7 +306,7 @@ static void check_csync_detect_update_db_rename(void **state) static void check_csync_detect_update_db_new(void **state) { - CSYNC *csync = (CSYNC*)*state; + auto *csync = (CSYNC*)*state; csync_file_stat_t *st = nullptr; std::unique_ptr fs; int rc = 0; @@ -327,7 +327,7 @@ static void check_csync_detect_update_db_new(void **state) static void check_csync_ftw(void **state) { - CSYNC *csync = (CSYNC*)*state; + auto *csync = (CSYNC*)*state; int rc = 0; rc = csync_ftw(csync, "/tmp", csync_walker, MAX_DEPTH); @@ -336,7 +336,7 @@ static void check_csync_ftw(void **state) static void check_csync_ftw_empty_uri(void **state) { - CSYNC *csync = (CSYNC*)*state; + auto *csync = (CSYNC*)*state; int rc = 0; rc = csync_ftw(csync, "", csync_walker, MAX_DEPTH); @@ -345,7 +345,7 @@ static void check_csync_ftw_empty_uri(void **state) static void check_csync_ftw_failing_fn(void **state) { - CSYNC *csync = (CSYNC*)*state; + auto *csync = (CSYNC*)*state; int rc = 0; rc = csync_ftw(csync, "/tmp", failing_fn, MAX_DEPTH); diff --git a/test/csync/vio_tests/check_vio.cpp b/test/csync/vio_tests/check_vio.cpp index 674dab008..c38e1022f 100644 --- a/test/csync/vio_tests/check_vio.cpp +++ b/test/csync/vio_tests/check_vio.cpp @@ -75,7 +75,7 @@ static int setup_dir(void **state) { } static int teardown(void **state) { - CSYNC *csync = (CSYNC*)*state; + auto *csync = (CSYNC*)*state; int rc = 0; auto statedb = csync->statedb; @@ -99,7 +99,7 @@ static int teardown(void **state) { static void check_csync_vio_opendir(void **state) { - CSYNC *csync = (CSYNC*)*state; + auto *csync = (CSYNC*)*state; csync_vio_handle_t *dh = nullptr; int rc = 0; @@ -112,7 +112,7 @@ static void check_csync_vio_opendir(void **state) static void check_csync_vio_opendir_perm(void **state) { - CSYNC *csync = (CSYNC*)*state; + auto *csync = (CSYNC*)*state; csync_vio_handle_t *dh = nullptr; int rc = 0; mbchar_t *dir = c_utf8_path_to_locale(CSYNC_TEST_DIR); @@ -132,7 +132,7 @@ static void check_csync_vio_opendir_perm(void **state) static void check_csync_vio_closedir_null(void **state) { - CSYNC *csync = (CSYNC*)*state; + auto *csync = (CSYNC*)*state; int rc = 0; rc = csync_vio_closedir(csync, nullptr); diff --git a/test/csync/vio_tests/check_vio_ext.cpp b/test/csync/vio_tests/check_vio_ext.cpp index 88e300ccc..a45fff61d 100644 --- a/test/csync/vio_tests/check_vio_ext.cpp +++ b/test/csync/vio_tests/check_vio_ext.cpp @@ -94,7 +94,7 @@ static int setup_testenv(void **state) { c_free_locale_string(dir); /* --- initialize csync */ - statevar *mystate = (statevar*)malloc( sizeof(statevar) ); + auto *mystate = (statevar*)malloc( sizeof(statevar) ); mystate->result = nullptr; mystate->csync = new CSYNC("/tmp/check_csync1", new OCC::SyncJournalDb("")); @@ -118,7 +118,7 @@ static void output( const char *text ) } static int teardown(void **state) { - statevar *sv = (statevar*) *state; + auto *sv = (statevar*) *state; CSYNC *csync = sv->csync; int rc = 0; @@ -187,7 +187,7 @@ static void traverse_dir(void **state, const char *dir, int *cnt) { csync_vio_handle_t *dh = nullptr; std::unique_ptr dirent; - statevar *sv = (statevar*) *state; + auto *sv = (statevar*) *state; CSYNC *csync = sv->csync; char *subdir = nullptr; char *subdir_out = nullptr; @@ -304,7 +304,7 @@ static void create_file( const char *path, const char *name, const char *content static void check_readdir_shorttree(void **state) { - statevar *sv = (statevar*) *state; + auto *sv = (statevar*) *state; const char *t1 = "alibaba/und/die/vierzig/räuber/"; create_dirs( t1 ); @@ -323,7 +323,7 @@ static void check_readdir_shorttree(void **state) static void check_readdir_with_content(void **state) { - statevar *sv = (statevar*) *state; + auto *sv = (statevar*) *state; int files_cnt = 0; const char *t1 = "warum/nur/40/Räuber/"; @@ -347,7 +347,7 @@ static void check_readdir_with_content(void **state) static void check_readdir_longtree(void **state) { - statevar *sv = (statevar*) *state; + auto *sv = (statevar*) *state; /* Strange things here: Compilers only support strings with length of 4k max. * The expected result string is longer, so it needs to be split up in r1, r2 and r3 @@ -424,7 +424,7 @@ static void check_readdir_longtree(void **state) // https://github.com/owncloud/client/issues/3128 https://github.com/owncloud/client/issues/2777 static void check_readdir_bigunicode(void **state) { - statevar *sv = (statevar*) *state; + auto *sv = (statevar*) *state; // 1: ? ASCII: 239 - EF // 2: ? ASCII: 187 - BB // 3: ? ASCII: 191 - BF