]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Update to latest tinytest
authorNick Mathewson <nickm@torproject.org>
Fri, 14 Mar 2014 14:09:04 +0000 (10:09 -0400)
committerNick Mathewson <nickm@torproject.org>
Fri, 14 Mar 2014 14:09:04 +0000 (10:09 -0400)
(This pulls in some fixes to tinytest_demo.c, which Tor doesn't build.)

src/ext/tinytest_demo.c

index bdd0e600897b91e448ba3e2517d5bd5799cabe50..634e112cb8b2f72171f1c3e486411b4b7f84e8b4 100644 (file)
 #include <string.h>
 #include <errno.h>
 #include <time.h>
-#ifndef _WIN32
+
+#ifdef _WIN32
+#include <windows.h>
+#else
 #include <unistd.h>
 #endif
 
@@ -152,7 +155,8 @@ test_memcpy(void *ptr)
        memcpy(db->buffer2, db->buffer1, sizeof(db->buffer1));
        tt_str_op(db->buffer1, ==, db->buffer2);
 
-        /* This one works if there's an internal NUL. */
+        /* tt_mem_op() does a memcmp, as opposed to the strcmp in tt_str_op() */
+        db->buffer2[100] = 3; /* Make the buffers unequal */
         tt_mem_op(db->buffer1, <, db->buffer2, sizeof(db->buffer1));
 
        /* Now we've allocated memory that's referenced by a local variable.