Suppress misc compiler warnings
authorJay Doane <jay.s.doane@gmail.com>
Thu, 13 Dec 2018 04:41:27 +0000 (20:41 -0800)
committerJay Doane <jay.s.doane@gmail.com>
Thu, 27 Dec 2018 21:07:57 +0000 (13:07 -0800)
- couch_util_tests.erl:90:
    Warning: the result of the expression is ignored

- couch_mrview_index_changes_tests.erl:189,196:
    Warning: a term is constructed, but never used

- couch_replicator_connection_tests.erl:76:
    Warning: this expression will fail with a 'badarith' exception

src/couch/test/couch_util_tests.erl
src/couch_mrview/test/couch_mrview_index_changes_tests.erl
src/couch_replicator/test/couch_replicator_connection_tests.erl

index a0e9238..3e145c4 100644 (file)
@@ -87,7 +87,7 @@ flush_test() ->
         _IntsToAGazillion = lists:seq(1, 200000),
         _LotsOfData = lists:map(fun(_) -> <<"foobar">> end,
                                 lists:seq(1, 500000)),
-        _BigBin = list_to_binary(_LotsOfData),
+        _ = list_to_binary(_LotsOfData),
 
         %% Allocation 200K tuples puts us above the memory threshold
         %% Originally, there should be:
index 2701e0c..f0be1b9 100644 (file)
@@ -186,15 +186,13 @@ test_stream(Db) ->
 test_indexer(Db) ->
     Result = run_query(Db, [{since, 14}, refresh]),
     Expect = {ok, 15, [{{15,14,<<"14">>},14}]},
-    ?_assertEqual(Result, Expect),
 
     {ok, Db1} = save_doc(Db, 15),
     timer:sleep(1500),
     Result1 = run_query(Db1, [{since, 14}], false),
     Expect1 = {ok, 16, [{{15,14,<<"14">>},14},
                        {{16,15,<<"15">>},15}]},
-    ?_assertEqual(Result1, Expect1),
-    ok.
+    ?_assert(Result == Expect andalso Result1 == Expect1).
 
 
 save_doc(Db, Id) ->
index ef3f2b3..e75cc5a 100644 (file)
@@ -73,7 +73,7 @@ connections_not_shared_after_owner_death({Host, Port}) ->
         Self = self(),
         spawn(fun() ->
             Self ! couch_replicator_connection:acquire(URL),
-            1/0
+            error("simulate division by zero without compiler warning")
         end),
         receive
             {ok, Pid} ->