Skip to content

Commit

Permalink
Add invalid version test
Browse files Browse the repository at this point in the history
  • Loading branch information
VivianNK committed Sep 20, 2024
1 parent 760c157 commit 354fce2
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ class AdvancedLoggerMmCoreTest : public Test {
testLoggerInfo.Version = ADVANCED_LOGGER_VERSION;
testLoggerInfo.LogBufferOffset = (ALIGN_VALUE (sizeof (testLoggerInfo), 8));
testLoggerInfo.LogCurrentOffset = (ALIGN_VALUE (sizeof (testLoggerInfo), 8));

}
};

Expand All @@ -70,15 +69,18 @@ TEST_F (AdvancedLoggerMmCoreTest, AdvLoggerGetInfoFail) {
// NULL LoggerInfo
Status = ValidateInfoBlock ();
EXPECT_EQ (Status, FALSE);
mLoggerInfo = &testLoggerInfo;

// Invalid Signature
mLoggerInfo = &testLoggerInfo;
mLoggerInfo->Signature = SIGNATURE_32 ('T', 'E', 'S', 'T');
Status = ValidateInfoBlock ();
EXPECT_EQ (Status, FALSE);
mLoggerInfo->Signature = ADVANCED_LOGGER_SIGNATURE;

// Mismatched Version is okay? Wouldn't expect mismatched version with valid signature?
// Invalid Version
mLoggerInfo->Version = (UINT32)1;
Status = ValidateInfoBlock ();
EXPECT_EQ (Status, FALSE);

// Invalid Buffer Offset
mLoggerInfo->LogBufferOffset = (UINT32)0;
Expand Down

0 comments on commit 354fce2

Please sign in to comment.