Created
May 10, 2025 13:03
-
-
Save iKunalChhabra/404f66461808ef2ce8eee3c92d9f2076 to your computer and use it in GitHub Desktop.
Simple test case with C
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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