Commit 24f5c62b authored by Adrien Oliva's avatar Adrien Oliva

Add basic creation and deletion tests

parent d39546ee
Pipeline #119 passed with stages
in 1 minute and 10 seconds
2 Adrien Oliva <olivaa+gitlab@yapbreak.fr>
5 Adrien Oliva <olivaa+gitlab@yapbreak.fr>
......@@ -39,7 +39,7 @@ class button_t {
void *m_long_arg = NULL;
public:
button_t(const uint8_t pin);
explicit button_t(const uint8_t pin);
~button_t();
void on_single_click(button_callback_t callback, void *arg);
......
......@@ -7,10 +7,54 @@
TEST_GROUP(basic)
{
void setup()
{
fixtures::registerInstance(f);
}
fixtures f;
};
TEST(basic, nothing)
{
};
TEST(basic, leak_prevent)
{
button_t *b = new button_t(1);
CHECK(b != NULL);
delete b;
};
TEST_GROUP(initial_setup)
{
void setup()
{
fixtures::registerInstance(f);
}
void teardown()
{
f.check();
}
fixtures f;
};
TEST(initial_setup, pin_mode)
{
button_t b(1);
f.set_expected_pin_mode(1, INPUT);
f.set_expected_pin_mode(2, NOTSET);
f.set_expected_call("pinMode", 1);
};
TEST(initial_setup, other_pin_mode)
{
button_t b(2);
f.set_expected_pin_mode(2, INPUT);
f.set_expected_pin_mode(1, NOTSET);
f.set_expected_call("pinMode", 1);
};
#endif /* end of include guard: UT_BUTTON_H_VPZWRLC7 */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment