Sha256: c9fac734c0f7e14fdc9befafd1bf227ce1ec7ac7984e935c657f46240d3ac51a

Contents?: true

Size: 863 Bytes

Versions: 21

Compression:

Stored size: 863 Bytes

Contents

#include "unity.h"
#include "a_file.h"
#include "mock_stuff.h"
#include "mock_other_stuff.h"


void setUp(void) {}
void tearDown(void) {}


void test_a_function_should_pass_with_values_that_make_sense(void)
{
	add_ExpectAndReturn(3, 5, 8);
	subtract_ExpectAndReturn(8, 2, 6);
	
  TEST_ASSERT_EQUAL(6, a_function(3, 5, 2));
}

void test_a_function_should_pass_because_we_lied_with_our_mocks(void)
{
	add_ExpectAndReturn(0, 0, 0);
	subtract_ExpectAndReturn(0, 0, 100);
	
  TEST_ASSERT_EQUAL(100, a_function(0, 0, 0));
}

void test_a_function_should_fail_because_missing_expectation(void)
{
	subtract_ExpectAndReturn(0, 0, 100);
	
  TEST_ASSERT_EQUAL(100, a_function(0, 0, 0));
}

void test_a_function_should_fail_because_wrong_return_value(void)
{
	add_ExpectAndReturn(3, 5, 8);
	subtract_ExpectAndReturn(8, 2, 0);
	
  TEST_ASSERT_EQUAL(6, a_function(3, 5, 2));
}

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
ceedling-0.25.0 test_graveyard/system/mocks/test/test_a_file.c
ceedling-0.24.0 test_graveyard/system/mocks/test/test_a_file.c
ceedling-0.22.0 test_graveyard/system/mocks/test/test_a_file.c
ceedling-0.21.0 test_graveyard/system/mocks/test/test_a_file.c
ceedling-0.20.3 test_graveyard/system/mocks/test/test_a_file.c
ceedling-0.20.2 test_graveyard/system/mocks/test/test_a_file.c
ceedling-0.19.0 test_graveyard/system/mocks/test/test_a_file.c
ceedling-0.18.0 test_graveyard/system/mocks/test/test_a_file.c
ceedling-0.17.0 test_graveyard/system/mocks/test/test_a_file.c
ceedling-0.16.0 test_graveyard/system/mocks/test/test_a_file.c
ceedling-0.15.6 test_graveyard/system/mocks/test/test_a_file.c
ceedling-0.15.5 test_graveyard/system/mocks/test/test_a_file.c
ceedling-0.15.4 test_graveyard/system/mocks/test/test_a_file.c
ceedling-0.15.3 test_graveyard/system/mocks/test/test_a_file.c
ceedling-0.15.2 test_graveyard/system/mocks/test/test_a_file.c
ceedling-0.15.1 test_graveyard/system/mocks/test/test_a_file.c
ceedling-0.15.0 test_graveyard/system/mocks/test/test_a_file.c
ceedling-0.13.0 test_graveyard/system/mocks/test/test_a_file.c
ceedling-0.13.0.rc1 test_graveyard/system/mocks/test/test_a_file.c
ceedling-0.0.2 new_project_template/vendor/ceedling/test/system/mocks/test/test_a_file.c