diff --git a/UnitTestFrameworkPkg/Library/UnitTestLib/Assert.c b/UnitTestFrameworkPkg/Library/UnitTestLib/Assert.c index 53cb71f61065..52752e0adc62 100644 --- a/UnitTestFrameworkPkg/Library/UnitTestLib/Assert.c +++ b/UnitTestFrameworkPkg/Library/UnitTestLib/Assert.c @@ -33,7 +33,7 @@ AddUnitTestFailure ( UnitTest->FailureType = FailureType; AsciiStrCpyS ( &UnitTest->FailureMessage[0], - UNIT_TEST_TESTFAILUREMSG_LENGTH, + UNIT_TEST_MAX_STRING_LENGTH, FailureMessage ); @@ -50,7 +50,7 @@ UnitTestLogFailure ( ) { UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle; - CHAR8 LogString[UNIT_TEST_TESTFAILUREMSG_LENGTH]; + CHAR8 LogString[UNIT_TEST_MAX_STRING_LENGTH]; VA_LIST Marker; // diff --git a/UnitTestFrameworkPkg/Library/UnitTestLib/Log.c b/UnitTestFrameworkPkg/Library/UnitTestLib/Log.c index f61b9d57b10a..88cf826b8863 100644 --- a/UnitTestFrameworkPkg/Library/UnitTestLib/Log.c +++ b/UnitTestFrameworkPkg/Library/UnitTestLib/Log.c @@ -15,8 +15,7 @@ #include #include -#define UNIT_TEST_MAX_SINGLE_LOG_STRING_LENGTH (512) -#define UNIT_TEST_MAX_LOG_BUFFER SIZE_16KB +#define UNIT_TEST_MAX_LOG_BUFFER SIZE_16KB struct _UNIT_TEST_LOG_PREFIX_STRING { UNIT_TEST_STATUS LogLevel; @@ -85,7 +84,7 @@ AddStringToUnitTestLog ( UnitTest->Log, UNIT_TEST_MAX_LOG_BUFFER / sizeof (CHAR8), String, - UNIT_TEST_MAX_SINGLE_LOG_STRING_LENGTH + UNIT_TEST_MAX_STRING_LENGTH ); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "Failed to add unit test log string. Status = %r\n", Status)); @@ -160,8 +159,8 @@ UnitTestLog ( ) { UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle; - CHAR8 NewFormatString[UNIT_TEST_MAX_SINGLE_LOG_STRING_LENGTH]; - CHAR8 LogString[UNIT_TEST_MAX_SINGLE_LOG_STRING_LENGTH]; + CHAR8 NewFormatString[UNIT_TEST_MAX_STRING_LENGTH]; + CHAR8 LogString[UNIT_TEST_MAX_STRING_LENGTH]; CONST CHAR8 *LogTypePrefix; VA_LIST Marker; diff --git a/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c b/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c index 3e3a850af125..953f1959bc11 100644 --- a/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c +++ b/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c @@ -571,9 +571,9 @@ UpdateTestFromSave ( Test->FailureType = MatchingTest->FailureType; AsciiStrnCpyS ( &Test->FailureMessage[0], - UNIT_TEST_TESTFAILUREMSG_LENGTH, + UNIT_TEST_MAX_STRING_LENGTH, &MatchingTest->FailureMessage[0], - UNIT_TEST_TESTFAILUREMSG_LENGTH + UNIT_TEST_MAX_STRING_LENGTH ); // @@ -748,7 +748,7 @@ SerializeState ( // TestSaveData->Result = UnitTest->Result; TestSaveData->FailureType = UnitTest->FailureType; - AsciiStrnCpyS (&TestSaveData->FailureMessage[0], UNIT_TEST_TESTFAILUREMSG_LENGTH, &UnitTest->FailureMessage[0], UNIT_TEST_TESTFAILUREMSG_LENGTH); + AsciiStrnCpyS (&TestSaveData->FailureMessage[0], UNIT_TEST_MAX_STRING_LENGTH, &UnitTest->FailureMessage[0], UNIT_TEST_MAX_STRING_LENGTH); // // If there is a log, save the log. diff --git a/UnitTestFrameworkPkg/PrivateInclude/UnitTestFrameworkTypes.h b/UnitTestFrameworkPkg/PrivateInclude/UnitTestFrameworkTypes.h index adce413818a2..3d91b7810872 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 @@ -24,12 +24,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[];