[tor-bugs] #19563 [Core Tor/Tor]: Test: add unit test for tor_htonll() and tor_ntohll()
Tor Bug Tracker & Wiki
blackhole at torproject.org
Thu Nov 3 20:12:44 UTC 2016
#19563: Test: add unit test for tor_htonll() and tor_ntohll()
--------------------------+------------------------------------
Reporter: dgoulet | Owner:
Type: task | Status: needs_revision
Priority: Low | Milestone: Tor: 0.3.0.x-final
Component: Core Tor/Tor | Version:
Severity: Minor | Resolution:
Keywords: test easy | Actual Points:
Parent ID: | Points: 0.2
Reviewer: dgoulet | Sponsor:
--------------------------+------------------------------------
Changes (by dgoulet):
* status: new => needs_revision
* reviewer: => dgoulet
* milestone: Tor: 0.2.??? => Tor: 0.3.0.x-final
Comment:
Yes actually! That test file should definitely use `tor_htonll()`. Feel
free to fix that in a separate commit.
About, your patch, looks good! I would simply test the edge cases that is
the UINT64 max and 0. Also, I would define the expected "little endian"
and "big endian" value as const variables instead of just "n" and then
copy 4 times the expected value of converted n. It will just make things
clearer and avoid us to typo anything.
Moving it to 030 milestone. Also, next time, set the patch to
`needs_review`, will be easier for us to spot that it actually needs
review :). Big thanks for this!
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/19563#comment:2>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list