Fixes flakyness in CPU unittest
Review URL: https://webrtc-codereview.appspot.com/377005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1616 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
06c7dbae14
commit
2660460b89
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
||||
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
@ -46,7 +46,7 @@ WebRtc_Word32 CpuWindows::CpuUsageMultiCore(WebRtc_UWord32& num_cores,
|
||||
{
|
||||
num_cores = 0;
|
||||
cpu_usage = NULL;
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
num_cores = number_of_objects_ - 1;
|
||||
cpu_usage = cpu_usage_;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
||||
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
@ -42,7 +42,7 @@ TEST(CpuWrapperTest, Usage) {
|
||||
// Initializing the CPU measurements may take a couple of seconds on Windows.
|
||||
// Since the initialization is lazy we need to wait until it is completed.
|
||||
// Should not take more than 10000 ms.
|
||||
while (cpu_usage_available && (++num_iterations < 10000)) {
|
||||
while (!cpu_usage_available && (++num_iterations < 10000)) {
|
||||
if (cores != NULL) {
|
||||
ASSERT_GT(num_cores, 0u);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user