// Copyright Advanced Micro Devices, Inc., or its affiliates. // SPDX-License-Identifier: MIT #include "CustomMatchers.hpp" #include "TestContext.hpp" #include #include #include #include #include #include TEST_CASE("CommandArgumentValue toString", "[command][toString]") { using cav = rocRoller::CommandArgumentValue; SECTION("Values") { CHECK(toString(cav(5)) == "5"); CHECK(toString(cav(-5ll)) == "-5"); CHECK(toString(cav(3643653242342ull)) == "3643653242342"); CHECK(toString(cav(4.5f)) == "4.50000"); CHECK(toString(cav(4.5)) == "4.50000"); CHECK(toString(cav(rocRoller::FP8(4.5))) == "4.50000"); } SECTION("Pointers") { float x = 5.f; void* ptr = &x; auto ptrStr = rocRoller::concatenate(ptr); CHECK(toString(cav(reinterpret_cast(ptr))) == ptrStr); CHECK(toString(cav(reinterpret_cast(ptr))) == ptrStr); CHECK(toString(cav(reinterpret_cast(ptr))) == ptrStr); CHECK(toString(cav(reinterpret_cast(ptr))) == ptrStr); CHECK(toString(cav(reinterpret_cast(ptr))) == ptrStr); CHECK(toString(cav(reinterpret_cast(ptr))) == ptrStr); CHECK(toString(cav(reinterpret_cast(ptr))) == ptrStr); CHECK(toString(cav(reinterpret_cast(ptr))) == ptrStr); CHECK(toString(cav(reinterpret_cast(ptr))) == ptrStr); CHECK(toString(cav(reinterpret_cast(ptr))) == ptrStr); CHECK(toString(cav(reinterpret_cast(ptr))) == ptrStr); } }