chaokunyang commented on code in PR #2852:
URL: https://github.com/apache/fory/pull/2852#discussion_r2483105668


##########
java/fory-core/src/test/java/org/apache/fory/ThreadSafeForyTest.java:
##########
@@ -373,4 +374,63 @@ public void testSerializerRegister() {
           return null;
         });
   }
+
+  @Test
+  public void testGetDepth() {
+    Fory fory = Fory.builder().requireClassRegistration(false).build();
+    Assert.assertEquals(fory.getDepth(), -1);
+    BeanA beanA = BeanA.createBeanA(2);
+    byte[] bytes = fory.serialize(beanA);
+    Assert.assertEquals(fory.getDepth(), -1);
+    fory.deserialize(bytes);
+    Assert.assertEquals(fory.getDepth(), -1);
+  }
+
+  @Test
+  public void testRegisterAfterSerializeThrowsException() throws Exception {

Review Comment:
   Seems this test doesn't capture the bug in set `depth` to `-1`, please 
update this test to make it actually capture such bugs



-- 
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