1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "gpu/config/gpu_control_list.h"
6 #include "testing/gtest/include/gtest/gtest.h"
10 class MachineModelInfoTest
: public testing::Test
{
12 MachineModelInfoTest() { }
13 virtual ~MachineModelInfoTest() { }
15 typedef GpuControlList::MachineModelInfo MachineModelInfo
;
18 TEST_F(MachineModelInfoTest
, ValidModelInfo
) {
19 const std::string name_op
[] = {
25 const std::string version_op
[] = {
34 for (size_t i
= 0; i
< arraysize(name_op
); ++i
) {
35 for (size_t j
= 0; j
< arraysize(version_op
); ++j
) {
38 if (version_op
[j
] != "any")
40 if (version_op
[j
] == "between")
42 MachineModelInfo
info(name_op
[i
], "model",
43 version_op
[j
], version1
, version2
);
44 EXPECT_TRUE(info
.IsValid());
49 TEST_F(MachineModelInfoTest
, ModelComparison
) {
50 MachineModelInfo
info("=", "model_a", ">", "3.4", std::string());
51 EXPECT_TRUE(info
.Contains("model_a", "4"));
52 EXPECT_FALSE(info
.Contains("model_b", "4"));
53 EXPECT_FALSE(info
.Contains("model_a", "3.2"));