summaryrefslogtreecommitdiffstats
path: root/UnitTestFrameworkPkg/PrivateInclude
diff options
context:
space:
mode:
authorOliver Smith-Denny <osde@microsoft.com>2024-10-02 08:13:56 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-10-08 01:26:36 +0000
commit2ee050d1d5bdc071f01ae66ce886c35ebf36b27e (patch)
treefdf59a71342e030c34d22e0875e2fe68a23f2605 /UnitTestFrameworkPkg/PrivateInclude
parentd99045f39220e2ad075ae5b93b53bbabd5923cb4 (diff)
downloadedk2-2ee050d1d5bdc071f01ae66ce886c35ebf36b27e.tar.gz
UnitTestFrameworkPkg: UnitTestLib: Support Failure Strings of 512 Chars
Currently, there is a mismatch of allowed string sizes in UnitTestLib. The UT_LOG_* macros allow a string size of 512, but failure messages are constrained to 120 characters and some other string lengths are similarly constrained. 120 characters is too few for some longer error messages, particularly the ones that print out the path to the failing line. This can result in the actual error not getting printed in the log. This patch updates all UnitTestLib allowed string lengths to be 512 characters. Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
Diffstat (limited to 'UnitTestFrameworkPkg/PrivateInclude')
-rw-r--r--UnitTestFrameworkPkg/PrivateInclude/UnitTestFrameworkTypes.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/UnitTestFrameworkPkg/PrivateInclude/UnitTestFrameworkTypes.h b/UnitTestFrameworkPkg/PrivateInclude/UnitTestFrameworkTypes.h
index adce413818..3d91b78108 100644
--- a/UnitTestFrameworkPkg/PrivateInclude/UnitTestFrameworkTypes.h
+++ b/UnitTestFrameworkPkg/PrivateInclude/UnitTestFrameworkTypes.h
@@ -15,7 +15,7 @@
///
/// The maximum length of a string stored in the unit test framework
///
-#define UNIT_TEST_MAX_STRING_LENGTH (120)
+#define UNIT_TEST_MAX_STRING_LENGTH (512)
///
/// The size of a firngerprint used to save/resume execution of a unit test
@@ -25,12 +25,6 @@
#define UNIT_TEST_FINGERPRINT_SIZE (sizeof (UINT32))
///
-/// The maximum length of a test failure message stored in the unit test
-/// framework
-///
-#define UNIT_TEST_TESTFAILUREMSG_LENGTH (120)
-
-///
/// FAILURE_TYPE used to record the type of assert that was triggered by a unit
/// test.
///
@@ -54,7 +48,7 @@ typedef struct {
CHAR8 *Name; // can't have spaces and should be short
CHAR8 *Log;
FAILURE_TYPE FailureType;
- CHAR8 FailureMessage[UNIT_TEST_TESTFAILUREMSG_LENGTH];
+ CHAR8 FailureMessage[UNIT_TEST_MAX_STRING_LENGTH];
UINT8 Fingerprint[UNIT_TEST_FINGERPRINT_SIZE];
UNIT_TEST_STATUS Result;
UNIT_TEST_FUNCTION RunTest;
@@ -117,7 +111,7 @@ typedef struct {
typedef struct {
UINT32 Size; // Size of the UNIT_TEST_SAVE_TEST including Log[]
UINT8 Fingerprint[UNIT_TEST_FINGERPRINT_SIZE]; // Fingerprint of the test itself.
- CHAR8 FailureMessage[UNIT_TEST_TESTFAILUREMSG_LENGTH];
+ CHAR8 FailureMessage[UNIT_TEST_MAX_STRING_LENGTH];
FAILURE_TYPE FailureType;
UNIT_TEST_STATUS Result;
CHAR8 Log[];