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!
Trac: Status: new to needs_revision Milestone: Tor: 0.2.??? to Tor: 0.3.0.x-final Reviewer: N/Ato dgoulet