Giter Site home page Giter Site logo

Missing Unit Tests about ros2_rust HOT 2 CLOSED

ros2-rust avatar ros2-rust commented on May 26, 2024 1
Missing Unit Tests

from ros2_rust.

Comments (2)

ruffsl avatar ruffsl commented on May 26, 2024

What kind of tests should we start with?
Are there any particular category of tests we could start with my mimicking/porting what exists for rclcpp or rclpy?

from ros2_rust.

jhdcs avatar jhdcs commented on May 26, 2024

I think that adding unit tests for context, as well as the node Publisher and Subscriber should probably be a priority. I'd put context at the top of the list, though - both because it is the lynchpin that the rest of the library builds off of (from what I'm able to see), and that it's what deals most directly with FFI with rcl.

Additionally, any function that has unsafe should have at least one unit test. Ideally, if we can get away with it, I'd put more in there, just so we can make sure that we know that it fails in a way we expect.

A quick look for unsafe in functions turns up the following (though I may have missed a few):

  1. rclrs/src/context.rs - ContextHandle.drop()
  2. rclrs/src/context.rs - Context.init()
  3. rclrs/src/context.rs - Context.ok()
  4. rclrs/src/context.rs - Context.default()
  5. rclrs/src/lib.rs - spin()
  6. rclrs/src/lib.rs - spin_once()
  7. rclrs/src/node/mod.rs - NodeHandle.drop()
  8. rclrs/src/node/mod.rs - Node.new_with_namespace()
  9. rclrs/src/node/publisher.rs - PublisherHandle.drop()
  10. rclrs/src/node/publisher.rs - Publisher.new()
  11. rclrs/src/node/publisher.rs - Publisher.publish()
  12. rclrs/src/node/subscription.rs - SubscriptionHandle.drop()
  13. rclrs/src/node/subscription.rs - SubscriptionBase.take()
  14. rclrs/src/node/subscription.rs - Subscription.new()
  15. rclrs/src/node/subscription.rs - Subscription.take()

from ros2_rust.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.