Skip to content

Instantly share code, notes, and snippets.

@iKunalChhabra
Created May 10, 2025 13:03
Show Gist options
  • Save iKunalChhabra/404f66461808ef2ce8eee3c92d9f2076 to your computer and use it in GitHub Desktop.
Save iKunalChhabra/404f66461808ef2ce8eee3c92d9f2076 to your computer and use it in GitHub Desktop.
Simple test case with C
#include <stdio.h>
#define MUNIT_ENABLE_ASSERT_ALIASES
#include "munit.h"
static MunitResult
test_int_equal(const MunitParameter params[], void* data) {
int a = 5;
int b = 5;
assert_int(a, ==, b);
return MUNIT_OK;
}
static MunitTest test_suite_tests[] = {
{ "/int-equal", test_int_equal, NULL, NULL, MUNIT_TEST_OPTION_NONE, NULL },
{ NULL, NULL, NULL, NULL, MUNIT_TEST_OPTION_NONE, NULL }
};
static const MunitSuite test_suite = {
"/test-suite", test_suite_tests, NULL, 1, MUNIT_SUITE_OPTION_NONE
};
int main(int argc, char* argv[]) {
return munit_suite_main(&test_suite, NULL, argc, argv);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment