summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/test/csuite/incr_backup/main.c
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2020-03-16 18:49:19 +1100
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-03-16 08:05:32 +0000
commitee5e377845845be9f23ca4604cf4473a96184387 (patch)
tree84faf7a4ae627ca3048041ead08f3c4bba319456 /src/third_party/wiredtiger/test/csuite/incr_backup/main.c
parent00502b11804516673266087d8d10292edb94a70a (diff)
downloadmongo-ee5e377845845be9f23ca4604cf4473a96184387.tar.gz
Import wiredtiger: 59c2abc4d95f7d29b8a4ed43c7f182cd3c515e90 from branch mongodb-4.4
ref: 187983a50c..59c2abc4d9 for: 4.3.5 WT-5240 Update test/format to perform incremental backups WT-5729 Coverity analysis defect 114078: Unchecked return value from library WT-5730 Coverity analysis defect 114077: Unchecked return value WT-5733 Coverity analysis defect 114074: Logically dead code WT-5734 Coverity analysis defect 114073: PW.MIXED_ENUM_TYPE WT-5844 Adjust error codes for when we detect files that are too small to contain a descriptor block
Diffstat (limited to 'src/third_party/wiredtiger/test/csuite/incr_backup/main.c')
-rw-r--r--src/third_party/wiredtiger/test/csuite/incr_backup/main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/third_party/wiredtiger/test/csuite/incr_backup/main.c b/src/third_party/wiredtiger/test/csuite/incr_backup/main.c
index 3b9ed1319bb..9892eaa373e 100644
--- a/src/third_party/wiredtiger/test/csuite/incr_backup/main.c
+++ b/src/third_party/wiredtiger/test/csuite/incr_backup/main.c
@@ -295,7 +295,7 @@ again:
testutil_check(
__wt_snprintf(filename, sizeof(filename), "%s/%s", dirname, prev->names[prevpos]));
VERBOSE(3, "Removing file from backup: %s\n", filename);
- remove(filename);
+ testutil_check(remove(filename));
} else {
/*
* There is something in the current list not in the prev list. Walk past it in the
@@ -366,6 +366,7 @@ table_changes(WT_SESSION *session, TABLE *table)
item.size = table->max_value_size;
key_value(change_count, key, sizeof(key), &item, &op_type);
cur->set_key(cur, key);
+ testutil_assert(op_type < _OPERATION_TYPE_COUNT);
switch (op_type) {
case INSERT:
cur->set_value(cur, &item);
@@ -388,7 +389,6 @@ table_changes(WT_SESSION *session, TABLE *table)
testutil_check(cur->update(cur));
break;
case _OPERATION_TYPE_COUNT:
- testutil_assert(false);
break;
}
}
@@ -532,7 +532,7 @@ reopen_file(int *fdp, char *buf, size_t buflen, const char *filename, int oflag)
if (strcmp(buf, filename) == 0 && *fdp != -1)
return;
if (*fdp != -1)
- close(*fdp);
+ testutil_check(close(*fdp));
*fdp = open(filename, oflag, 0666);
strncpy(buf, filename, buflen);
testutil_assert(*fdp >= 0);
@@ -653,10 +653,11 @@ check_table(WT_SESSION *session, TABLE *table)
expect_records = 0;
total_changes = table->change_count;
boundary = total_changes % KEYS_PER_TABLE;
- op_type = (OPERATION_TYPE)(total_changes % CHANGES_PER_CYCLE) / KEYS_PER_TABLE;
+ op_type = (OPERATION_TYPE)((total_changes % CHANGES_PER_CYCLE) / KEYS_PER_TABLE);
value = dcalloc(1, table->max_value_size);
VERBOSE(3, "Checking: %s\n", table->name);
+ testutil_assert(op_type < _OPERATION_TYPE_COUNT);
switch (op_type) {
case INSERT:
expect_records = total_changes % KEYS_PER_TABLE;
@@ -669,7 +670,6 @@ check_table(WT_SESSION *session, TABLE *table)
expect_records = KEYS_PER_TABLE - (total_changes % KEYS_PER_TABLE);
break;
case _OPERATION_TYPE_COUNT:
- testutil_assert(false);
break;
}