diff options
author | Arlo Breault <arlolra@gmail.com> | 2013-08-03 22:36:32 -0700 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-08-04 09:29:22 -0400 |
commit | 506a01bda8fd6f055ff1deef0e73036f8031e7a4 (patch) | |
tree | 79e6c7eaf415d203b77da788cb785555ff653f11 /src/test/test_replay.c | |
parent | 468e44a0efaae8761d236042b80ac0125884980d (diff) | |
download | tor-506a01bda8fd6f055ff1deef0e73036f8031e7a4.tar.gz tor-506a01bda8fd6f055ff1deef0e73036f8031e7a4.zip |
Use size_t for length in replaycache_add_test_and_elapsed()
For consistency with the rest of buffer lengths in Tor.
See #8960
Diffstat (limited to 'src/test/test_replay.c')
-rw-r--r-- | src/test/test_replay.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/test/test_replay.c b/src/test/test_replay.c index 200bf4dd3e..b48f582f5e 100644 --- a/src/test/test_replay.c +++ b/src/test/test_replay.c @@ -76,13 +76,13 @@ test_replaycache_miss(void) result = replaycache_add_and_test_internal(1200, r, test_buffer, - (int)strlen(test_buffer), NULL); + strlen(test_buffer), NULL); test_eq(result, 0); /* poke the bad-parameter error case too */ result = replaycache_add_and_test_internal(1200, NULL, test_buffer, - (int)strlen(test_buffer), NULL); + strlen(test_buffer), NULL); test_eq(result, 0); done: @@ -102,12 +102,12 @@ test_replaycache_hit(void) result = replaycache_add_and_test_internal(1200, r, test_buffer, - (int)strlen(test_buffer), NULL); + strlen(test_buffer), NULL); test_eq(result, 0); result = replaycache_add_and_test_internal(1300, r, test_buffer, - (int)strlen(test_buffer), NULL); + strlen(test_buffer), NULL); test_eq(result, 1); done: @@ -127,17 +127,17 @@ test_replaycache_age(void) result = replaycache_add_and_test_internal(1200, r, test_buffer, - (int)strlen(test_buffer), NULL); + strlen(test_buffer), NULL); test_eq(result, 0); result = replaycache_add_and_test_internal(1300, r, test_buffer, - (int)strlen(test_buffer), NULL); + strlen(test_buffer), NULL); test_eq(result, 1); result = replaycache_add_and_test_internal(3000, r, test_buffer, - (int)strlen(test_buffer), NULL); + strlen(test_buffer), NULL); test_eq(result, 0); done: @@ -158,12 +158,12 @@ test_replaycache_elapsed(void) result = replaycache_add_and_test_internal(1200, r, test_buffer, - (int)strlen(test_buffer), NULL); + strlen(test_buffer), NULL); test_eq(result, 0); result = replaycache_add_and_test_internal(1300, r, test_buffer, - (int)strlen(test_buffer), &elapsed); + strlen(test_buffer), &elapsed); test_eq(result, 1); test_eq(elapsed, 100); @@ -184,17 +184,17 @@ test_replaycache_noexpire(void) result = replaycache_add_and_test_internal(1200, r, test_buffer, - (int)strlen(test_buffer), NULL); + strlen(test_buffer), NULL); test_eq(result, 0); result = replaycache_add_and_test_internal(1300, r, test_buffer, - (int)strlen(test_buffer), NULL); + strlen(test_buffer), NULL); test_eq(result, 1); result = replaycache_add_and_test_internal(3000, r, test_buffer, - (int)strlen(test_buffer), NULL); + strlen(test_buffer), NULL); test_eq(result, 1); done: @@ -215,12 +215,12 @@ test_replaycache_scrub(void) /* Set up like in test_replaycache_hit() */ result = replaycache_add_and_test_internal(100, r, test_buffer, - (int)strlen(test_buffer), NULL); + strlen(test_buffer), NULL); test_eq(result, 0); result = replaycache_add_and_test_internal(200, r, test_buffer, - (int)strlen(test_buffer), NULL); + strlen(test_buffer), NULL); test_eq(result, 1); /* @@ -257,14 +257,14 @@ test_replaycache_future(void) /* Set up like in test_replaycache_hit() */ result = replaycache_add_and_test_internal(100, r, test_buffer, - (int)strlen(test_buffer), &elapsed); + strlen(test_buffer), &elapsed); test_eq(result, 0); /* elapsed should still be 0, since it wasn't written */ test_eq(elapsed, 0); result = replaycache_add_and_test_internal(200, r, test_buffer, - (int)strlen(test_buffer), &elapsed); + strlen(test_buffer), &elapsed); test_eq(result, 1); /* elapsed should be the time since the last hit */ test_eq(elapsed, 100); @@ -275,7 +275,7 @@ test_replaycache_future(void) */ result = replaycache_add_and_test_internal(150, r, test_buffer, - (int)strlen(test_buffer), &elapsed); + strlen(test_buffer), &elapsed); /* We should still get a hit */ test_eq(result, 1); /* ...but it shouldn't let us see a negative elapsed time */ @@ -304,18 +304,18 @@ test_replaycache_realtime(void) /* This should miss */ result = - replaycache_add_and_test(r, test_buffer, (int)strlen(test_buffer)); + replaycache_add_and_test(r, test_buffer, strlen(test_buffer)); test_eq(result, 0); /* This should hit */ result = - replaycache_add_and_test(r, test_buffer, (int)strlen(test_buffer)); + replaycache_add_and_test(r, test_buffer, strlen(test_buffer)); test_eq(result, 1); /* This should hit and return a small elapsed time */ result = replaycache_add_test_and_elapsed(r, test_buffer, - (int)strlen(test_buffer), &elapsed); + strlen(test_buffer), &elapsed); test_eq(result, 1); test_assert(elapsed >= 0); test_assert(elapsed <= 5); |