[tor-commits] [onionoo/release] Avoid integer overflow in tests.

karsten at torproject.org karsten at torproject.org
Mon Sep 10 15:29:14 UTC 2018


commit ed9c9f342716edcb7ada756c4d5713e6296abf3d
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date:   Mon Aug 20 16:07:29 2018 +0200

    Avoid integer overflow in tests.
---
 src/test/java/org/torproject/onionoo/server/ResourceServletTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/test/java/org/torproject/onionoo/server/ResourceServletTest.java b/src/test/java/org/torproject/onionoo/server/ResourceServletTest.java
index 063f550..58bab5d 100644
--- a/src/test/java/org/torproject/onionoo/server/ResourceServletTest.java
+++ b/src/test/java/org/torproject/onionoo/server/ResourceServletTest.java
@@ -1367,7 +1367,7 @@ public class ResourceServletTest {
   public void testFirstSeenDaysMaxIntPlusOne() {
     this.assertErrorStatusCode(
         "/summary?first_seen_days="
-        + String.valueOf(Integer.MAX_VALUE + 1), 400);
+        + String.valueOf(((long) Integer.MAX_VALUE) + 1L), 400);
   }
 
   @Test(timeout = 100)





More information about the tor-commits mailing list