Skip to content

MAX_SERVOS limit when testing #67

Open
@lfenster

Description

@lfenster

Is it possible to have a destructor for Servo that removes the motor from static list of Servos? The reason for asking is that I am artificially hitting the MAX_SERVOS limit when running unit tests for my solution. I have a test suite that initializes motors which contain Servos and then destructs the Motor to move on to the next test. See example below. B/c the Servo constructor adds to the static list of servos and caps it out at 48 (for the Mega 2560) after so many tests, the servos will stop attaching. Seems to me like there should be a destructor that does the cleanup for what the constructor is doing.

RUN_TEST(test_One);
RUN_TEST(test_Three);
RUN_TEST(test_RunTwoMotorsAsync);
RUN_TEST(test_ManualMotorReset);         
RUN_TEST(test_InitializeTwentyTwoMotors);
RUN_TEST(test_InitializeTwentyTwoMotorsAndMoveTwo);

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: codeRelated to content of the project itselftype: enhancementProposed improvement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions