[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 19:52:21 UTC 2016


#19563: Test: add unit test for tor_htonll() and tor_ntohll()
--------------------------+------------------------------
 Reporter:  dgoulet       |          Owner:
     Type:  task          |         Status:  new
 Priority:  Low           |      Milestone:  Tor: 0.2.???
Component:  Core Tor/Tor  |        Version:
 Severity:  Minor         |     Resolution:
 Keywords:  test easy     |  Actual Points:
Parent ID:                |         Points:  0.2
 Reviewer:                |        Sponsor:
--------------------------+------------------------------

Comment (by icanhasaccount):

 Heya - I added an attempt at this on the following branch:

 https://github.com/mintytoast/tor-stuff/tree/bug_19563

 One thing I noticed - in test_util_format.c there is a macro to define
 htonll:

   #if !defined(HAVE_HTONLL) && !defined(htonll)
   #ifdef WORDS_BIGENDIAN
   #define htonll(x) (x)
   #else
   static uint64_t
   htonll(uint64_t a)
   {
     return htonl((uint32_t)(a>>32)) |
 (((uint64_t)htonl((uint32_t)a))<<32);
   }
   #endif
   #endif

 Should the test case using the above be changed to use tor_htonll? If so I
 can do this in a separate patch.

 Thank you in advance for your time in reading this comment.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/19563#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list