EXSWHTEC-224 - Test cases ID clean up and documentation for Error Handling (#72)

- Test cases ID clean up and documentation for Error Handling
This commit is contained in:
milos-mozetic
2023-06-28 06:15:53 +02:00
committed by GitHub
parent 3969e4a320
commit 93751460f7
5 changed files with 140 additions and 0 deletions
@@ -25,6 +25,26 @@ THE SOFTWARE.
#include <hip_test_common.hh>
#include <hip/hip_runtime_api.h>
/**
* @addtogroup hipGetErrorName hipGetErrorName
* @{
* @ingroup ErrorTest
* `hipGetErrorName(hipError_t hip_error)` -
* Return hip error as text string form.
*/
/**
* Test Description
* ------------------------
* - Validate that a non-empty string is returned for each supported
* device error enumeration.
* Test source
* ------------------------
* - unit/errorHandling/hipGetErrorName.cc
* Test requirements
* ------------------------
* - HIP_VERSION >= 5.2
*/
TEST_CASE("Unit_hipGetErrorName_Positive_Basic") {
const char* error_string = nullptr;
const auto enumerator =
@@ -36,6 +56,20 @@ TEST_CASE("Unit_hipGetErrorName_Positive_Basic") {
REQUIRE(strlen(error_string) > 0);
}
/**
* Test Description
* ------------------------
* - Validate handling of invalid arguments:
* -# When error enumerator is invalid (-1)
* - AMD expected output: return "hipErrorUnknown"
* - NVIDIA expected output: return "cudaErrorUnknown"
* Test source
* ------------------------
* - unit/errorHandling/hipGetErrorName.cc
* Test requirements
* ------------------------
* - HIP_VERSION >= 5.2
*/
TEST_CASE("Unit_hipGetErrorName_Negative_Parameters") {
const char* error_string = hipGetErrorName(static_cast<hipError_t>(-1));
REQUIRE(error_string != nullptr);