diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-03-14 10:09:04 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-03-14 10:09:04 -0400 |
commit | 102bb1c04f5cb4fb3eae7f41f80660e47c64ceb6 (patch) | |
tree | e6dc1f353f0aa52625c4f1358bfa2d443d98c099 /src/ext/tinytest_demo.c | |
parent | cd9d08a5e14d2339185fd7702ed4e89858dc76b4 (diff) | |
download | tor-102bb1c04f5cb4fb3eae7f41f80660e47c64ceb6.tar.gz tor-102bb1c04f5cb4fb3eae7f41f80660e47c64ceb6.zip |
Update to latest tinytest
(This pulls in some fixes to tinytest_demo.c, which Tor doesn't build.)
Diffstat (limited to 'src/ext/tinytest_demo.c')
-rw-r--r-- | src/ext/tinytest_demo.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ext/tinytest_demo.c b/src/ext/tinytest_demo.c index bdd0e60089..634e112cb8 100644 --- a/src/ext/tinytest_demo.c +++ b/src/ext/tinytest_demo.c @@ -36,7 +36,10 @@ #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. |