1
0
mirror of https://github.com/chylex/Nextcloud-Desktop.git synced 2025-04-09 19:15:43 +02:00

Fix modernize-use-auto errors in csync tests

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
This commit is contained in:
Kevin Ottens 2020-09-01 17:51:32 +02:00 committed by Kevin Ottens (Rebase PR Action)
parent f323f8b4bc
commit 9a0713fab7
4 changed files with 21 additions and 21 deletions

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

View 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);

View 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);

View 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