Skip to content

Commit

Permalink
Merge pull request #683 from callumfare/callum/cts-urPlatformGetApiVe…
Browse files Browse the repository at this point in the history
…rsion

[UR][CTS] Add tests for urPlatformGetApiVersion
  • Loading branch information
callumfare authored Jul 4, 2023
2 parents 4cdbbd8 + 27eb9ae commit 9595961
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/conformance/platform/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
add_conformance_test(platform
urInit.cpp
urPlatformGet.cpp
urPlatformGetApiVersion.cpp
urPlatformGetBackendOption.cpp
urPlatformGetInfo.cpp
urPlatformGetLastError.cpp
Expand Down
26 changes: 26 additions & 0 deletions test/conformance/platform/urPlatformGetApiVersion.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright (C) 2022-2023 Intel Corporation
// Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions.
// See LICENSE.TXT
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include "fixtures.h"

using urPlatformGetApiVersionTest = uur::platform::urPlatformTest;

TEST_F(urPlatformGetApiVersionTest, Success) {
ur_api_version_t version;
ASSERT_EQ_RESULT(UR_RESULT_SUCCESS,
urPlatformGetApiVersion(platform, &version));
ASSERT_GE(UR_API_VERSION_CURRENT, version);
}

TEST_F(urPlatformGetApiVersionTest, InvalidPlatform) {
ur_api_version_t version;
ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_HANDLE,
urPlatformGetApiVersion(nullptr, &version));
}

TEST_F(urPlatformGetApiVersionTest, InvalidVersionPtr) {
ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_POINTER,
urPlatformGetApiVersion(platform, nullptr));
}

0 comments on commit 9595961

Please sign in to comment.