[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #4432 [Tor Client]: Improved test coverage of three functions in common



#4432: Improved test coverage of three functions in common
-------------------------+--------------------------------------------------
 Reporter:  4ZM          |          Owner:              
     Type:  enhancement  |         Status:  needs_review
 Priority:  normal       |      Milestone:              
Component:  Tor Client   |        Version:              
 Keywords:               |         Parent:              
   Points:               |   Actualpoints:              
-------------------------+--------------------------------------------------

Comment(by nickm):

 Looks mostly good, except that I don't think that the test is right here:
 {{{
 +    test_streq(hex_str(binary_data, 33),
 "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F")
 +    test_streq(hex_str(binary_data, 4711),
 "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F")
 }}}

 Note that the documentation for hex_str says "fromlen must be <= 32".  No
 behavior is specified for fromlen > 32, so no particular behavior is
 required.

 This isn't just a semantic point: currently, design-by-contract allows us
 to decide later on that hex_str() should handle fromlen up to 64 or 128,
 and no current correct user of hex_str() should have been relying on its
 current behavior for those values.

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/4432#comment:2>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs