From 2660460b890cde6afc69dd249a2ba1b807313af8 Mon Sep 17 00:00:00 2001 From: "henrike@webrtc.org" Date: Mon, 6 Feb 2012 23:33:54 +0000 Subject: [PATCH] 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 --- src/system_wrappers/source/cpu_win.cc | 4 ++-- src/system_wrappers/source/cpu_wrapper_unittest.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/system_wrappers/source/cpu_win.cc b/src/system_wrappers/source/cpu_win.cc index 134200a1d..2e6b56760 100644 --- a/src/system_wrappers/source/cpu_win.cc +++ b/src/system_wrappers/source/cpu_win.cc @@ -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_; diff --git a/src/system_wrappers/source/cpu_wrapper_unittest.cc b/src/system_wrappers/source/cpu_wrapper_unittest.cc index dd49c3ac9..25e97cd75 100644 --- a/src/system_wrappers/source/cpu_wrapper_unittest.cc +++ b/src/system_wrappers/source/cpu_wrapper_unittest.cc @@ -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;