Skip to content

Add regression test for reusing bound glue objects #825

Description

@knoepfel

Description

Add a regression test covering multiple registrations made through the same bound glue object.

For example:

auto glue_ball = m.make<A>();
glue_ball.fold(...);
glue_ball.transform(...);

Previously, phlex/core/glue.hpp moved bound_obj_ into the first registration's algorithm_bits or delegate. That left the glue object without its bound shared_ptr, so subsequent registrations could receive an empty object pointer and fail when invoking a member function.

The implementation now copies bound_obj_ into each registration, allowing the shared object to remain available for reuse.

Required regression coverage

  • Register at least two member-function nodes from one glue<T> instance.
  • Execute the graph and verify both nodes run successfully.
  • Cover the relevant registration paths, at minimum transform, and preferably fold or output as appropriate.
  • Ensure the test would fail under the previous std::move(bound_obj_) implementation.

Related code

  • phlex/core/glue.hpp
  • phlex/metaprogramming/delegate.hpp
  • Existing class registration coverage in test/class_registration.cpp

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions