Fix modernize-use-auto errors in csync tests
authorKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 1 Sep 2020 15:51:32 +0000 (17:51 +0200)
committerKevin Ottens (Rebase PR Action) <er-vin@users.noreply.github.com>
Wed, 2 Sep 2020 06:12:46 +0000 (06:12 +0000)
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
test/csync/csync_tests/check_csync_exclude.cpp
test/csync/csync_tests/check_csync_update.cpp
test/csync/vio_tests/check_vio.cpp
test/csync/vio_tests/check_vio_ext.cpp

index b55a72e54ed49a1575c3a236cd5aab14cee6bed2..18ca46d2cd52b9abc7f6e75ee9ce640ed2bfe08d 100644 (file)
@@ -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;
index a896905a2b7e0a5e5b61f0d65735483d70b8a2e0..859783950dab1bf5e4aa391aabdc922e6326be8a 100644 (file)
@@ -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<csync_file_stat_t> 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<csync_file_stat_t> 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<csync_file_stat_t> 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<csync_file_stat_t> 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<csync_file_stat_t> 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);
index 674dab00856b2a167dc9b6155c7f6ffea8558965..c38e1022f2e8f5471d2a9dc854d8436769fabf4c 100644 (file)
@@ -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);
index 88e300ccc9a07ed72e2e8f9b2ca93e29e871c166..a45fff61d3b56d13dd87ecdffa9c0e0d6832f989 100644 (file)
@@ -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<csync_file_stat_t> 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