diff options
author | Keith Bostic <keith.bostic@mongodb.com> | 2016-06-17 12:00:59 -0400 |
---|---|---|
committer | Don Anderson <dda@mongodb.com> | 2016-06-17 12:00:59 -0400 |
commit | a2a88dadb5a872010fa9930d54ebae810b8f780e (patch) | |
tree | 482503f5e26ad65d479d134ac30c1181c2f3c381 /test | |
parent | 36d657ccc67ce0fb5dd1881458ffc8a748b8aa44 (diff) | |
download | mongo-a2a88dadb5a872010fa9930d54ebae810b8f780e.tar.gz |
WT-2712 Coverity 1356928 and 1356929: ASSERT_SIDE_EFFECT (#2807)
Coverity complains:
CID 1356929: Incorrect expression (ASSERT_SIDE_EFFECT)
Assignment "tablename = strchr(opts->uri, 58)" has a side effect.
This code will work differently in a non-debug build.
90 testutil_assert((tablename = strchr(opts->uri, ':')) != 0);
I don't see it (there aren't any #ifdefs in the path to exit), my
suspicion is Coverity doesn't like side-effects in function calls
named with any variant of "assert".
Diffstat (limited to 'test')
-rw-r--r-- | test/csuite/wt2447_join_main_table/main.c | 3 | ||||
-rw-r--r-- | test/csuite/wt2592_join_schema/main.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/test/csuite/wt2447_join_main_table/main.c b/test/csuite/wt2447_join_main_table/main.c index a797a4223a2..0402a682c28 100644 --- a/test/csuite/wt2447_join_main_table/main.c +++ b/test/csuite/wt2447_join_main_table/main.c @@ -101,7 +101,8 @@ main(int argc, char *argv[]) testutil_check(testutil_parse_opts(argc, argv, opts)); testutil_make_work_dir(opts->home); - testutil_assert((tablename = strchr(opts->uri, ':')) != 0); + tablename = strchr(opts->uri, ':'); + testutil_assert(tablename != NULL); tablename++; snprintf(index1uri, sizeof(index1uri), "index:%s:index1", tablename); snprintf(index2uri, sizeof(index2uri), "index:%s:index2", tablename); diff --git a/test/csuite/wt2592_join_schema/main.c b/test/csuite/wt2592_join_schema/main.c index fa6f50b12ae..a880e15767b 100644 --- a/test/csuite/wt2592_join_schema/main.c +++ b/test/csuite/wt2592_join_schema/main.c @@ -87,7 +87,8 @@ main(int argc, char *argv[]) testutil_check(testutil_parse_opts(argc, argv, opts)); testutil_make_work_dir(opts->home); - testutil_assert((tablename = strchr(opts->uri, ':')) != 0); + tablename = strchr(opts->uri, ':'); + testutil_assert(tablename != NULL); tablename++; snprintf(countryuri, sizeof(countryuri), "index:%s:country", tablename); snprintf(yearuri, sizeof(yearuri), "index:%s:year", tablename); |