I have been trying to learn cmocka to perform unitest. After looking at various examples on internet, I am confused as to how I should do unit testing, specifically I am unable to understand following syntax:
static int functionname(void **state) {
// What should I write here??
return 0;
}
I am unable to understand Why void ** state is being used and what does it signifies. I am doing unittesting on circular buffer to check whether it is full, how should I do it? Till now I have written the uni test for c mocka as follows:
static int CBfull(void **state) {
if(bufffull=1)
failcount++;
else passcount++;
}