mdwelsh commented on code in PR #8725:
URL: https://github.com/apache/tvm/pull/8725#discussion_r875255257
##########
rust/tvm-rt/src/object/object_ptr.rs:
##########
@@ -460,26 +485,71 @@ mod tests {
Ok(())
}
- fn test_fn(o: ObjectPtr<Object>) -> ObjectPtr<Object> {
- // The call machinery adds at least 1 extra count while inside the
call.
+ fn test_fn_raw<'a>(
+ mut args: crate::to_function::ArgList<'a>,
+ ) -> crate::function::Result<RetValue> {
+ let v: ArgValue = args.remove(0);
+ let v2: ArgValue = args.remove(0);
+ // assert_eq!(o.count(), 2);
+ let o: ObjectPtr<Object> = v.try_into().unwrap();
+ assert_eq!(o.count(), 2);
+ let o2: ObjectPtr<Object> = v2.try_into().unwrap();
+ assert_eq!(o2.count(), 3);
+ drop(o2);
+ assert_eq!(o.count(), 2);
+ Ok(o.into())
+ }
+
+ #[test]
+ fn test_ref_count_raw_fn() {
Review Comment:
Style: Unit test should start with a descriptive comment explaining the
purpose of the test.
For more information about this comment, see
https://fixie.ai/comment/18c94f96b.
--
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]