pranavshenoy commented on code in PR #4087:
URL: https://github.com/apache/cassandra/pull/4087#discussion_r2051290342


##########
test/unit/org/apache/cassandra/db/compaction/unified/ControllerTest.java:
##########
@@ -121,6 +121,18 @@ public void testValidateOptionsIntegers()
         testValidateOptions(true);
     }
 
+    @Test
+    public void testValidateOptionsInvalidTargetSSTableSize()
+    {
+        try {
+            Map<String, String> options = new HashMap<>();
+            options.putIfAbsent(Controller.TARGET_SSTABLE_SIZE_OPTION, 
"12E899");
+            Controller.validateOptions(options);
+            fail("Passing invalid number should have caused exception");
+        } catch(ConfigurationException e) {
+        }
+    }
+

Review Comment:
   @Claudenw  have changed the name of the testcase and created a common 
function for both test cases. 
   
   Thanks for sharing this interesting insight on converting Long.MAX_VALUE to 
double. 
   
   In order to understand more, I ran this code:
   `double d = Long.MAX_VALUE;
     if(d > Long.MAX_VALUE) {
         System.out.println("d>Long.MAX_VALUE");
     } else if(d == Long.MAX_VALUE) {
         System.out.println("d == Long.MAX_VALUE");
     } else {
         System.out.println("d < Long.MAX_VALUE");
     }
     System.out.println(d-Long.MAX_VALUE);`
   
   When I print d, I get 9223372036854776000. However, the output of the code 
was 
   d == Long.MAX_VALUE and  `d-Long.MAX_VALUE` gives 0 too. 
   
   From this, I feel like, during any condition checks/operations, d will have 
Long.MAX_VALUE. Correct me if I am wrong. 
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to