diff options
author | rlp@chromium.org <rlp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-16 07:18:44 +0000 |
---|---|---|
committer | rlp@chromium.org <rlp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-16 07:18:44 +0000 |
commit | 3cec6f2d12cf1151cfb4e5247940a25763b704c9 (patch) | |
tree | 65d85d270f2c40fe34e01fe8c148f13994eff123 /chrome/common | |
parent | b445f2cd8f8c34635f431a51ac72840281b77dab (diff) | |
download | chromium_src-3cec6f2d12cf1151cfb4e5247940a25763b704c9.zip chromium_src-3cec6f2d12cf1151cfb4e5247940a25763b704c9.tar.gz chromium_src-3cec6f2d12cf1151cfb4e5247940a25763b704c9.tar.bz2 |
Adding proper initialization of GPUInfo variables.
BUG=none
TEST=EmptyGPUInfo
Review URL: http://codereview.chromium.org/2938013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52626 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/gpu_info.cc | 5 | ||||
-rw-r--r-- | chrome/common/gpu_info.h | 2 | ||||
-rw-r--r-- | chrome/common/gpu_info_unittest.cc | 17 |
3 files changed, 23 insertions, 1 deletions
diff --git a/chrome/common/gpu_info.cc b/chrome/common/gpu_info.cc index 43aa189..b1add77 100644 --- a/chrome/common/gpu_info.cc +++ b/chrome/common/gpu_info.cc @@ -4,6 +4,11 @@ #include "chrome/common/gpu_info.h" +GPUInfo::GPUInfo() + : vendor_id_(0), device_id_(0), driver_version_(L""), + pixel_shader_version_(0), vertex_shader_version_(0) { +} + uint32 GPUInfo::vendor_id() const { return vendor_id_; } diff --git a/chrome/common/gpu_info.h b/chrome/common/gpu_info.h index acbc18c..65b5075 100644 --- a/chrome/common/gpu_info.h +++ b/chrome/common/gpu_info.h @@ -14,7 +14,7 @@ class GPUInfo { public: - GPUInfo() {} + GPUInfo(); ~GPUInfo() {} // Return the DWORD (uint32) representing the graphics card vendor id. diff --git a/chrome/common/gpu_info_unittest.cc b/chrome/common/gpu_info_unittest.cc new file mode 100644 index 0000000..4d469f6 --- /dev/null +++ b/chrome/common/gpu_info_unittest.cc @@ -0,0 +1,17 @@ +// Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/logging.h" +#include "chrome/common/gpu_info.h" +#include "testing/gtest/include/gtest/gtest.h" + +// Test that an empty GPUInfo has valid members +TEST(GPUInfoBasicTest, EmptyGPUInfo) { + GPUInfo gpu_info; + EXPECT_EQ(gpu_info.vendor_id(), 0u); + EXPECT_EQ(gpu_info.device_id(), 0u); + EXPECT_EQ(gpu_info.driver_version(), L""); + EXPECT_EQ(gpu_info.pixel_shader_version(), 0u); + EXPECT_EQ(gpu_info.vertex_shader_version(), 0u); +} |