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

- Test cases ID clean up and documentation for Error Handling
Tá an tiomantas seo le fáil i:
milos-mozetic
2023-06-28 06:15:53 +02:00
tiomanta ag GitHub
tuismitheoir 3969e4a320
tiomantas 93751460f7
D'athraigh 5 comhad le 140 breiseanna agus 0 scriosta
+33
Féach ar an gComhad
@@ -24,6 +24,26 @@ THE SOFTWARE.
#include <hip_test_common.hh>
#include <hip/hip_runtime_api.h>
/**
* @addtogroup hipGetErrorString hipGetErrorString
* @{
* @ingroup ErrorTest
* `hipGetErrorString(hipError_t hipError)` -
* Return handy text string message to explain the error which occurred.
*/
/**
* Test Description
* ------------------------
* - Validate that a non-empty string is returned for each supported
* device error enumeration.
* Test source
* ------------------------
* - unit/errorHandling/hipGetErrorString.cc
* Test requirements
* ------------------------
* - HIP_VERSION >= 5.2
*/
TEST_CASE("Unit_hipGetErrorString_Positive_Basic") {
const char* error_string = nullptr;
const auto enumerator =
@@ -35,6 +55,19 @@ TEST_CASE("Unit_hipGetErrorString_Positive_Basic") {
REQUIRE(strlen(error_string) > 0);
}
/**
* Test Description
* ------------------------
* - Validate handling of invalid arguments:
* -# When error enumerator is invalid (-1)
* - Expected output: do not return `nullptr`
* Test source
* ------------------------
* - unit/errorHandling/hipGetErrorString.cc
* Test requirements
* ------------------------
* - HIP_VERSION >= 5.2
*/
TEST_CASE("Unit_hipGetErrorString_Negative_Parameters") {
const char* error_string = hipGetErrorString(static_cast<hipError_t>(-1));
REQUIRE(error_string != nullptr);