Sha256: 5ee308d07357d5ab48194523ed2024e74ccb721671c0839cca056bf648008ef8
Contents?: true
Size: 1.04 KB
Versions: 66
Compression:
Stored size: 1.04 KB
Contents
#include "vendor/unity.h" #include "../src/two_fer.h" #include <stddef.h> #define BUFFER_SIZE (100) void setUp(void) { } void tearDown(void) { } void test_two_fer_no_name_given(void) { char response[BUFFER_SIZE]; const char *expected = "One for you, one for me."; two_fer(response, NULL); TEST_ASSERT_EQUAL_STRING(expected, response); } void test_two_fer_a_name_given(void) { TEST_IGNORE(); // delete this line to run test char response[BUFFER_SIZE]; const char *expected = "One for Alice, one for me."; two_fer(response, "Alice"); TEST_ASSERT_EQUAL_STRING(expected, response); } void test_two_fer_another_name_given(void) { TEST_IGNORE(); char response[BUFFER_SIZE]; const char *expected = "One for Bob, one for me."; two_fer(response, "Bob"); TEST_ASSERT_EQUAL_STRING(expected, response); } int main(void) { UnityBegin("test/test_two_fer.c"); RUN_TEST(test_two_fer_no_name_given); RUN_TEST(test_two_fer_a_name_given); RUN_TEST(test_two_fer_another_name_given); UnityEnd(); return 0; }
Version data entries
66 entries across 66 versions & 1 rubygems