diff options
Diffstat (limited to 'lib/tdb2/test')
-rw-r--r-- | lib/tdb2/test/api-82-lockattr.c | 4 | ||||
-rw-r--r-- | lib/tdb2/test/run-15-append.c | 4 | ||||
-rw-r--r-- | lib/tdb2/test/run-56-open-during-transaction.c | 6 | ||||
-rw-r--r-- | lib/tdb2/test/run-tdb_errorstr.c | 26 |
4 files changed, 20 insertions, 20 deletions
diff --git a/lib/tdb2/test/api-82-lockattr.c b/lib/tdb2/test/api-82-lockattr.c index 4a68702fe1..8dc4e2fa4e 100644 --- a/lib/tdb2/test/api-82-lockattr.c +++ b/lib/tdb2/test/api-82-lockattr.c @@ -35,9 +35,9 @@ static int mylock(int fd, int rw, off_t off, off_t len, bool waitflag, } static int trav_err; -static int trav(struct tdb_context *tdb, TDB_DATA k, TDB_DATA d, int *err) +static int trav(struct tdb_context *tdb, TDB_DATA k, TDB_DATA d, int *terr) { - *err = trav_err; + *terr = trav_err; return 0; } diff --git a/lib/tdb2/test/run-15-append.c b/lib/tdb2/test/run-15-append.c index 53fe66bcf7..8102d3967d 100644 --- a/lib/tdb2/test/run-15-append.c +++ b/lib/tdb2/test/run-15-append.c @@ -9,7 +9,7 @@ static tdb_off_t tdb_offset(struct tdb_context *tdb, struct tdb_data key) { tdb_off_t off; - struct tdb_used_record rec; + struct tdb_used_record urec; struct hash_info h; if (tdb_get_flags(tdb) & TDB_VERSION1) { @@ -18,7 +18,7 @@ static tdb_off_t tdb_offset(struct tdb_context *tdb, struct tdb_data key) &rec); } - off = find_and_lock(tdb, key, F_RDLCK, &h, &rec, NULL); + off = find_and_lock(tdb, key, F_RDLCK, &h, &urec, NULL); if (TDB_OFF_IS_ERR(off)) return 0; tdb_unlock_hashes(tdb, h.hlock_start, h.hlock_range, F_RDLCK); diff --git a/lib/tdb2/test/run-56-open-during-transaction.c b/lib/tdb2/test/run-56-open-during-transaction.c index d2115f63cb..1ac970119f 100644 --- a/lib/tdb2/test/run-56-open-during-transaction.c +++ b/lib/tdb2/test/run-56-open-during-transaction.c @@ -44,14 +44,14 @@ static bool is_same(const char *snapshot, const char *latest, off_t len) static bool compare_file(int fd, const char *snapshot, off_t snapshot_len) { char *contents; - bool same; + bool ret; /* over-length read serves as length check. */ contents = malloc(snapshot_len+1); - same = pread(fd, contents, snapshot_len+1, 0) == snapshot_len + ret = pread(fd, contents, snapshot_len+1, 0) == snapshot_len && is_same(snapshot, contents, snapshot_len); free(contents); - return same; + return ret; } static void check_file_intact(int fd) diff --git a/lib/tdb2/test/run-tdb_errorstr.c b/lib/tdb2/test/run-tdb_errorstr.c index 94aab89d32..7a2da251aa 100644 --- a/lib/tdb2/test/run-tdb_errorstr.c +++ b/lib/tdb2/test/run-tdb_errorstr.c @@ -3,50 +3,50 @@ int main(int argc, char *argv[]) { - enum TDB_ERROR err; + enum TDB_ERROR e; plan_tests(TDB_ERR_RDONLY*-1 + 2); - for (err = TDB_SUCCESS; err >= TDB_ERR_RDONLY; err--) { - switch (err) { + for (e = TDB_SUCCESS; e >= TDB_ERR_RDONLY; e--) { + switch (e) { case TDB_SUCCESS: - ok1(!strcmp(tdb_errorstr(err), + ok1(!strcmp(tdb_errorstr(e), "Success")); break; case TDB_ERR_IO: - ok1(!strcmp(tdb_errorstr(err), + ok1(!strcmp(tdb_errorstr(e), "IO Error")); break; case TDB_ERR_LOCK: - ok1(!strcmp(tdb_errorstr(err), + ok1(!strcmp(tdb_errorstr(e), "Locking error")); break; case TDB_ERR_OOM: - ok1(!strcmp(tdb_errorstr(err), + ok1(!strcmp(tdb_errorstr(e), "Out of memory")); break; case TDB_ERR_EXISTS: - ok1(!strcmp(tdb_errorstr(err), + ok1(!strcmp(tdb_errorstr(e), "Record exists")); break; case TDB_ERR_EINVAL: - ok1(!strcmp(tdb_errorstr(err), + ok1(!strcmp(tdb_errorstr(e), "Invalid parameter")); break; case TDB_ERR_NOEXIST: - ok1(!strcmp(tdb_errorstr(err), + ok1(!strcmp(tdb_errorstr(e), "Record does not exist")); break; case TDB_ERR_RDONLY: - ok1(!strcmp(tdb_errorstr(err), + ok1(!strcmp(tdb_errorstr(e), "write not permitted")); break; case TDB_ERR_CORRUPT: - ok1(!strcmp(tdb_errorstr(err), + ok1(!strcmp(tdb_errorstr(e), "Corrupt database")); break; } } - ok1(!strcmp(tdb_errorstr(err), "Invalid error code")); + ok1(!strcmp(tdb_errorstr(e), "Invalid error code")); return exit_status(); } |