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

Side by Side Diff: gpu/config/gpu_control_list_machine_model_info_unittest.cc

Issue 241793002: Fix machine_model behaviors in gpu blacklist. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gpu/config/gpu_control_list_format.txt ('k') | gpu/config/gpu_control_list_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #include "gpu/config/gpu_control_list.h"
6 #include "testing/gtest/include/gtest/gtest.h"
7
8 namespace gpu {
9
10 class MachineModelInfoTest : public testing::Test {
11 public:
12 MachineModelInfoTest() { }
13 virtual ~MachineModelInfoTest() { }
14
15 typedef GpuControlList::MachineModelInfo MachineModelInfo;
16 };
17
18 TEST_F(MachineModelInfoTest, ValidModelInfo) {
19 const std::string name_op[] = {
20 "contains",
21 "beginwith",
22 "endwith",
23 "="
24 };
25 const std::string version_op[] = {
26 "=",
27 "<",
28 "<=",
29 ">",
30 ">=",
31 "any",
32 "between"
33 };
34 for (size_t i = 0; i < arraysize(name_op); ++i) {
35 for (size_t j = 0; j < arraysize(version_op); ++j) {
36 std::string version1;
37 std::string version2;
38 if (version_op[j] != "any")
39 version1 = "3.14";
40 if (version_op[j] == "between")
41 version2 = "5.4";
42 MachineModelInfo info(name_op[i], "model",
43 version_op[j], version1, version2);
44 EXPECT_TRUE(info.IsValid());
45 }
46 }
47 }
48
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"));
54 }
55
56 } // namespace gpu
57
OLDNEW
« no previous file with comments | « gpu/config/gpu_control_list_format.txt ('k') | gpu/config/gpu_control_list_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698