1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:07:36 +00:00

MACAddress: Unit testing for basic functionality

Problem:
- There are no unit tests for `MACAddress` class. This makes it
  difficult to refactor and ensure the same behavior.
- `m_data` private member variable is uninitialized leading to undefined
  behavior of `is_zero()`.

Solution:
- Add unit tests to cover basic functionality.
- Initialize `m_data`.
This commit is contained in:
Lenny Maiorani 2020-11-16 11:33:31 -07:00 committed by Andreas Kling
parent f23d9a73aa
commit fd97f23cef
2 changed files with 80 additions and 1 deletions

View file

@ -71,7 +71,7 @@ public:
}
private:
u8 m_data[6];
u8 m_data[6] {};
};
static_assert(sizeof(MACAddress) == 6);