#include "unity.h"
#include "unity_test_module.h"
#include "channel.h"


// I rather dislike keeping line numbers updated, so I made my own macro to ditch the line number
#define MY_RUN_TEST(func) RUN_TEST(func, 0)

extern void channel_setUp(void){
    channel_init();
}
extern void channel_tearDown(void) {}

void test_channel_all_zero_test(){
    uint8_t value = 0x00;
    uint8_t result = channel_change_one_random_bit(value);
    TEST_ASSERT_NOT_EQUAL(value, result); 
}

void test_channel_all_one_test(){
    uint8_t value = 0xFF;
    uint8_t result = channel_change_one_random_bit(value);
    TEST_ASSERT_NOT_EQUAL(value, result); 
}

void run_channel_tests(){
    UnityRegisterSetupTearDown( channel_setUp, channel_tearDown);

    MY_RUN_TEST(test_channel_all_zero_test);
    MY_RUN_TEST(test_channel_all_one_test);

    UnityUnregisterSetupTearDown();
}
