• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2021 The Dawn Authors
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #include <gtest/gtest.h>
16 
17 #include "common/GPUInfo.h"
18 
19 namespace {
20     const PCIVendorID vendorID = 0x8086;
21     const gpu_info::D3DDriverVersion version1 = {20, 19, 15, 5107};
22     const gpu_info::D3DDriverVersion version2 = {21, 20, 16, 5077};
23     const gpu_info::D3DDriverVersion version3 = {27, 20, 100, 9946};
24     const gpu_info::D3DDriverVersion version4 = {27, 20, 101, 2003};
25 }  // anonymous namespace
26 
TEST(GPUInfo,CompareD3DDriverVersion)27 TEST(GPUInfo, CompareD3DDriverVersion) {
28     EXPECT_EQ(gpu_info::CompareD3DDriverVersion(vendorID, version1, version2), -1);
29     EXPECT_EQ(gpu_info::CompareD3DDriverVersion(vendorID, version2, version3), -1);
30     EXPECT_EQ(gpu_info::CompareD3DDriverVersion(vendorID, version3, version4), -1);
31 }
32