Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 63768 Build 60652: arc lint + arc unit
Event Timeline
some fixes for the test utility functions
- more useful check for sdl_len in make_linkaddr, > 0 rather than >= 0
- initialise some ether_addrs
- use correct buffer length in data()
I like it; have you thought of any negative tests? ie, testing that parsing invalid addresses (like feeding link_ntoa -> link_addr as you mentioned) fails?
so a fun thing about link_addr is it has no way to indicate an error, it will just return garbage. D49936 will fix that, but i wanted to get the tests in first so i can change the other diff a bit and make sure i don’t break it. i’ll add some negative tests there at the same time.
lib/libc/tests/net/link_addr_test.cc | ||
---|---|---|
44 | The following code seems like it’s a logical item to add to a common C/C++ library. I highly doubt that this logic hasn’t been written somewhere or relied upon in the past. | |
169 | Some other potential testcases: positive:
negative:
|
add some additional tests
- address with mixed case hex digits
- short address
- long address
- very long address (SA-16:37.libc)
lib/libc/tests/net/link_addr_test.cc | ||
---|---|---|
169 | i've added a test for a mixed-case address; i wasn't sure if it was worth duplicating the other tests with different case. i've also added tests for short and long addresses, but they aren't negative tests since link_addr is supposed to accept them. |