Debian Codegraph @

tests/src/test_gpuinfovulkan.cpp

raw symbols SCIP
1 // SPDX-License-Identifier: GPL-3.0-or-latercxx . . $ `<file>/tests/src/test_gpuinfovulkan.cpp`/
2 // Copyright 2019 Juan Palacios <[email protected]>
3
4 #include <catch2/catch_all.hpp>
5
6 #include "common/hwidtranslatorstub.h"cxx . . $ `<file>/tests/src/common/hwidtranslatorstub.h`/
7 #include "common/stringdatasourcestub.h"cxx . . $ `<file>/tests/src/common/stringdatasourcestub.h`/
8 #include "core/info/common/gpuinfovulkan.h"cxx . . $ `<file>/src/core/info/common/gpuinfovulkan.h`/
9
10 namespace Testscxx . . $ Tests/::GPUInfoVulkancxx . . $ Tests/GPUInfoVulkan/ {
11
12 TEST_CASEcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:144:11`!("GPUInfoVulkan tests", "[Info][GPUInfo][GPUInfoVulkan]")
13 {
14 Vendorcxx . . $ Vendor# vendor(Vendorcxx . . $ Vendor#::AMDcxx . . $ Vendor#AMD.);
15 int const gpuIndex = 0;
16 IGPUInfocxx . . $ IGPUInfo#::Pathcxx . . $ IGPUInfo#Path# pathcxx . . $ IGPUInfo#Path#Path(df8cb93b336b884d).("_sys_"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "_dev_"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).);
17 HWIDTranslatorStubcxx . . $ HWIDTranslatorStub# hwIDTranslator;
18
19 SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Provides api version (v1)")
20 {
21 stdcxx . . $ std/::stringcxx . . $ std/string# const infoDatacxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).(
22 // clang-format off
23 "...\n\
24 VkPhysicalDeviceProperties:\n\
25 ...\n\
26 apiVersion = 4194306\n\
27 ..."); // clang-format on
28
29 ::GPUInfoVulkancxx . . $ GPUInfoVulkan# tscxx . . $ GPUInfoVulkan#GPUInfoVulkan(d9a0eba8acfc8272).(
30 stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>("vulkaninfo", infoData));
31
32 auto output = ts.provideInfocxx . . $ GPUInfoVulkan#provideInfo(5b65f7e996e13d80).(vendor, gpuIndex, path, hwIDTranslator);
33
34 auto apiVersion = stdcxx . . $ std/::make_paircxx . . $ std/make_pair(1d30b6e115203116).(
35 stdcxx . . $ std/::stringcxx . . $ std/string#(::GPUInfoVulkancxx . . $ GPUInfoVulkan#::Keyscxx . . $ GPUInfoVulkan#Keys#::apiVersioncxx . . $ GPUInfoVulkan#Keys#apiVersion.), stdcxx . . $ std/::stringcxx . . $ std/string#("4194306"));
36 REQUIRE_THATcxx . . $ `<external>/3333208929440565380/catch_matchers.hpp:222:11`!(output, Catch::Matchers::VectorContains(apiVersion));
37 }
38
39 SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Provides api version (v2)")
40 {
41 stdcxx . . $ std/::stringcxx . . $ std/string# const infoDatacxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).(
42 // clang-format off
43 "...\n\
44 VkPhysicalDeviceProperties:\n\
45 ...\n\
46 apiVersion = 0x401046 (1.1.70)\n\
47 ..."); // clang-format on
48
49 ::GPUInfoVulkancxx . . $ GPUInfoVulkan# tscxx . . $ GPUInfoVulkan#GPUInfoVulkan(d9a0eba8acfc8272).(
50 stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>("vulkaninfo", infoData));
51
52 auto output = ts.provideInfocxx . . $ GPUInfoVulkan#provideInfo(5b65f7e996e13d80).(vendor, gpuIndex, path, hwIDTranslator);
53
54 auto apiVersion = stdcxx . . $ std/::make_paircxx . . $ std/make_pair(1d30b6e115203116).(
55 stdcxx . . $ std/::stringcxx . . $ std/string#(::GPUInfoVulkancxx . . $ GPUInfoVulkan#::Keyscxx . . $ GPUInfoVulkan#Keys#::apiVersioncxx . . $ GPUInfoVulkan#Keys#apiVersion.), stdcxx . . $ std/::stringcxx . . $ std/string#("1.1.70"));
56 REQUIRE_THATcxx . . $ `<external>/3333208929440565380/catch_matchers.hpp:222:11`!(output, Catch::Matchers::VectorContains(apiVersion));
57 }
58 }
59
60 } // namespace Tests::GPUInfoVulkan