#include <check.h>
#include "bitfield.h"

START_TEST (test_foo)
{
    fail_unless(1 == 2);
}
END_TEST

Suite* bitfieldSuite(void) {
    Suite* s = suite_create("bitfield");
    TCase *tc_core = tcase_create("core");
    tcase_add_test(tc_core, test_foo);
    suite_add_tcase(s, tc_core);

    return s;
}

int main(void) {
    int numberFailed;
    Suite* s = bitfieldSuite();
    SRunner *sr = srunner_create(s);
    srunner_run_all(sr, CK_NORMAL);
    numberFailed = srunner_ntests_failed(sr);
    srunner_free(sr);
    return (numberFailed == 0) ? 0 : 1;
}

#include <check.h>
#include <stdint.h>
#include "bitfield.h"

START_TEST (test_size)
{
    uint8_t data = 0xFF;
    fail_unless(getBitField(&data, 0, 4) == 0xF);
}
END_TEST

Suite* bitfieldSuite(void) {
    Suite* s = suite_create("bitfield");
    TCase *tc_core = tcase_create("core");
    tcase_add_test(tc_core, test_size);
    suite_add_tcase(s, tc_core);

    return s;
}

int main(void) {
    int numberFailed;
    Suite* s = bitfieldSuite();
    SRunner *sr = srunner_create(s);
    srunner_run_all(sr, CK_NORMAL);
    numberFailed = srunner_ntests_failed(sr);
    srunner_free(sr);
    return (numberFailed == 0) ? 0 : 1;
}

Add a real test case for bitfield.
Add a real test case for bitfield.

This currently fails because we're not linking the test with the objects we want
to test. I tried adding the $(OBJS) variable to the build line, but because
those objects are all compiled with pic32-gcc it's not going to work.

I think the solution is to either:

Manually list the objects we want to recompile and link with (boo)

Compile our non-Arduino code into a static library that we link with.
