From b7a8ded8ef22af1df654412afc02e4d22e804d74 Mon Sep 17 00:00:00 2001 From: Aryan Salmanpour Date: Wed, 23 Apr 2025 15:35:19 -0400 Subject: [PATCH] Test: update TestInvalidGetErrorName test to cover all possible error names (#144) * Test: update TestInvalidGetErrorName test to cover all possible error names * Add ROCJPEG_STATUS_MAX_VALUE * clean up --- api/rocjpeg/rocjpeg.h | 1 + test/rocjpeg_negative_api_tests/rocjpeg_api_negative_tests.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/api/rocjpeg/rocjpeg.h b/api/rocjpeg/rocjpeg.h index 95644db62d..cf491c8b1d 100644 --- a/api/rocjpeg/rocjpeg.h +++ b/api/rocjpeg/rocjpeg.h @@ -63,6 +63,7 @@ typedef enum { ROCJPEG_STATUS_HW_JPEG_DECODER_NOT_SUPPORTED = -10, /**< Hardware JPEG decoder is not supported. */ ROCJPEG_STATUS_RUNTIME_ERROR = -11, /**< Runtime error occurred. */ ROCJPEG_STATUS_NOT_IMPLEMENTED = -12, /**< The requested feature is not implemented. */ + ROCJPEG_STATUS_MAX_VALUE = -13, /**< Maximum status code value. */ } RocJpegStatus; /** diff --git a/test/rocjpeg_negative_api_tests/rocjpeg_api_negative_tests.cpp b/test/rocjpeg_negative_api_tests/rocjpeg_api_negative_tests.cpp index f077072ad6..77eb9d8404 100644 --- a/test/rocjpeg_negative_api_tests/rocjpeg_api_negative_tests.cpp +++ b/test/rocjpeg_negative_api_tests/rocjpeg_api_negative_tests.cpp @@ -334,7 +334,7 @@ int RocJpegApiNegativeTests::TestInvalidGetErrorName() { } // Scenario 2: Pass a valid error code and ensure it returns a non-null name - for (int i = 0; i >= -8; i--) { + for (int i = 0; i >= ROCJPEG_STATUS_MAX_VALUE; i--) { RocJpegStatus valid_status = static_cast(i);; error_name = rocJpegGetErrorName(valid_status); if (error_name == nullptr) {