| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | // Copyright 2019 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #include <catch2/catch_all.hpp> |
| 5 | |
| 6 | #include "common/hwidtranslatorstub.h" |
| 7 | #include "common/stringpathdatasourcestub.h" |
| 8 | #include "core/info/amd/gpuinfovbios.h" |
| 9 | |
| 10 | namespace Tests::AMD::GPUInfoVbios { |
| 11 | |
| 12 | TEST_CASE("GPUInfoVbios tests", "[AMD][Info][GPUInfo][GPUInfoVbios]") |
| 13 | { |
| 14 | Vendor vendor(Vendor::AMD); |
| 15 | int const gpuIndex = 0; |
| 16 | IGPUInfo::Path path("_sys_", "_dev_"); |
| 17 | HWIDTranslatorStub hwIDTranslator; |
| 18 | |
| 19 | SECTION("Provides the type given by its DataSource") |
| 20 | { |
| 21 | ::AMD::GPUInfoVbios ts( |
| 22 | std::make_unique<StringPathDataSourceStub>("vbios_version", "VERSION")); |
| 23 | auto output = ts.provideInfo(vendor, gpuIndex, path, hwIDTranslator); |
| 24 | |
| 25 | auto type = std::make_pair(std::string(::AMD::GPUInfoVbios::version), |
| 26 | std::string("VERSION")); |
| 27 | REQUIRE_THAT(output, Catch::Matchers::VectorContains(type)); |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | } // namespace Tests::AMD::GPUInfoVbios |