C

Unit testing in C (Unity, CMocka)

Në shqip: Testet në C

ShpjegimiSQ

C-ja s'ka framework testesh të integruar, por ka librari të vogla si Unity, CMocka dhe Criterion: shkruan funksione testi me TEST_ASSERT_EQUAL(5, mblidh(2, 3)) dhe i ekzekuton të gjitha.

EnglishEN

C has no built-in test framework, but there are small libraries like Unity, CMocka and Criterion: you write test functions with TEST_ASSERT_EQUAL(5, add(2, 3)) and run them all.

Si ta mendosh

Si fleta e korrigjimit me ✓ dhe ✗.

Lexoje në anglisht

Like a marking sheet with ✓ and ✗.

Shembull kodic

void test_mblidh(void) {
    TEST_ASSERT_EQUAL(5, mblidh(2, 3));
}

Terma të lidhur