On this page

Criterion

Basic Setup

int add(int a, int b) {
  return a + b;
}
#include <criterion/criterion.h>

int add(int, int);

Test(add_test, should_add_integers, .description = "should add integers") {
  int a = 1;
  int b = 1;
  int expected = 2;
  cr_assert_eq(expected, add(a, a), "add(%d, %d) == %d", a, b, expected);
}