Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Unified Diff: webrtc/modules/video_coding/utility/ivf_file_writer_unittest.cc

Issue 2190533004: Use a better method to generate a random ID in IvfFileWriterTest. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Reverting last patchset (was meant for another CL) Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/video_coding/utility/ivf_file_writer_unittest.cc
diff --git a/webrtc/modules/video_coding/utility/ivf_file_writer_unittest.cc b/webrtc/modules/video_coding/utility/ivf_file_writer_unittest.cc
index ae1283b78d02abe2301b3a8f3be3fa98e81a961e..f22aff78cd1c6957cdff010179adfcdc6d68b4f8 100644
--- a/webrtc/modules/video_coding/utility/ivf_file_writer_unittest.cc
+++ b/webrtc/modules/video_coding/utility/ivf_file_writer_unittest.cc
@@ -13,6 +13,7 @@
#include <memory>
#include "testing/gtest/include/gtest/gtest.h"
+#include "webrtc/base/helpers.h"
#include "webrtc/base/logging.h"
#include "webrtc/base/thread.h"
#include "webrtc/base/timeutils.h"
@@ -31,15 +32,14 @@ static const int kMaxFileRetries = 5;
class IvfFileWriterTest : public ::testing::Test {
protected:
void SetUp() override {
- const int64_t start_id =
- reinterpret_cast<int64_t>(this) ^ rtc::TimeMicros();
- int64_t id = start_id;
+ const uint64_t start_id = rtc::CreateRandomId64();
+ uint64_t id = start_id;
do {
std::ostringstream oss;
oss << test::OutputPath() << "ivf_test_file_" << id++ << ".ivf";
file_name_ = oss.str();
- } while (id < start_id + 100 && FileExists(false));
- ASSERT_LT(id, start_id + 100);
+ } while ((id - start_id) < 100u && FileExists(false));
+ ASSERT_LT(id - start_id, 100u);
}
bool WriteDummyTestFrames(int width,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698