This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new aff23cd266 Coverity 1523692: Calling risky function in test_AcidPtr 
(#10880)
aff23cd266 is described below

commit aff23cd266fafc4af3e66ee22547b5f66af05c5e
Author: Bryan Call <bc...@apache.org>
AuthorDate: Thu Nov 30 08:23:33 2023 -0800

    Coverity 1523692: Calling risky function in test_AcidPtr (#10880)
    
    Switching to use random() instead of rand()
---
 src/tscore/unit_tests/test_AcidPtr.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tscore/unit_tests/test_AcidPtr.cc 
b/src/tscore/unit_tests/test_AcidPtr.cc
index bca36f3ace..b9b29c97c7 100644
--- a/src/tscore/unit_tests/test_AcidPtr.cc
+++ b/src/tscore/unit_tests/test_AcidPtr.cc
@@ -28,6 +28,7 @@
 #include <atomic>
 #include <condition_variable>
 #include <chrono>
+#include <stdlib.h>
 
 using namespace std;
 
@@ -47,7 +48,7 @@ TEST_CASE("AcidPtr Atomicity")
       unique_lock<mutex> gate_lock(gate_mutex);
       gate.wait(gate_lock);
     }
-    int r = rand();
+    int r = random();
     AcidCommitPtr<vector<int>> cptr(ptr);
     int old = (*cptr)[0];
     for (int &i : *cptr) {

Reply via email to