generated from LizardByte/template-base
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ebf96e7
commit ea2ec80
Showing
10 changed files
with
215 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// local includes | ||
#include "display_device/types.h" | ||
#include "fixtures/fixtures.h" | ||
|
||
namespace { | ||
// Specialized TEST macro(s) for this test file | ||
#define TEST_S(...) DD_MAKE_TEST(TEST, EdidParsing, __VA_ARGS__) | ||
} // namespace | ||
|
||
TEST_S(NoData) { | ||
EXPECT_EQ(display_device::EdidData::parse({}), std::nullopt); | ||
} | ||
|
||
TEST_S(BadFixedHeader) { | ||
auto EDID_DATA {ut_consts::DEFAULT_EDID}; | ||
EDID_DATA[1] = std::byte {0xAA}; | ||
EXPECT_EQ(display_device::EdidData::parse(EDID_DATA), std::nullopt); | ||
} | ||
|
||
TEST_S(BadChecksum) { | ||
auto EDID_DATA {ut_consts::DEFAULT_EDID}; | ||
EDID_DATA[16] = std::byte {0x00}; | ||
EXPECT_EQ(display_device::EdidData::parse(EDID_DATA), std::nullopt); | ||
} | ||
|
||
TEST_S(InvalidManufacturerId, BelowLimit) { | ||
auto EDID_DATA {ut_consts::DEFAULT_EDID}; | ||
// The sum of 8th and 9th bytes should remain 109 | ||
EDID_DATA[8] = std::byte {0x00}; | ||
EDID_DATA[9] = std::byte {0x6D}; | ||
EXPECT_EQ(display_device::EdidData::parse(EDID_DATA), std::nullopt); | ||
} | ||
|
||
TEST_S(InvalidManufacturerId, AboveLimit) { | ||
auto EDID_DATA {ut_consts::DEFAULT_EDID}; | ||
// The sum of 8th and 9th bytes should remain 109 | ||
EDID_DATA[8] = std::byte {0x6D}; | ||
EDID_DATA[9] = std::byte {0x00}; | ||
EXPECT_EQ(display_device::EdidData::parse(EDID_DATA), std::nullopt); | ||
} | ||
|
||
TEST_S(ValidOutput) { | ||
EXPECT_EQ(display_device::EdidData::parse(ut_consts::DEFAULT_EDID), ut_consts::DEFAULT_EDID_DATA); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters