Sha256: 0dbfde77032a4bd08fa4827225672b3aaff46377b4e76051e9c8becd3bd44e00

Contents?: true

Size: 909 Bytes

Versions: 11

Compression:

Stored size: 909 Bytes

Contents

#include "unity.h"
#include "foo.h"
#include "mock_bar.h"
#include "mock_zzz.h"

void setUp(void)
{
}

void tearDown(void)
{
}

void test_foo(void)
{
	//When
	foo_turn_on();

	//Then
	TEST_ASSERT_EQUAL(1, bar_turn_on_fake.call_count);
	TEST_ASSERT_EQUAL(1, zzz_sleep_fake.call_count);
	TEST_ASSERT_EQUAL_STRING("sleepy", zzz_sleep_fake.arg1_val);
}

void test_foo_again(void)
{
	//When
	foo_turn_on();

	//Then
	TEST_ASSERT_EQUAL(1, bar_turn_on_fake.call_count);
}

void test_foo_mock_with_const(void)
{
	foo_print_message("123");

	TEST_ASSERT_EQUAL(1, bar_print_message_fake.call_count);
	TEST_ASSERT_EQUAL_STRING("123", bar_print_message_fake.arg0_val);
}

void test_foo_mock_with_variable_args(void)
{
	foo_print_special_message();
	TEST_ASSERT_EQUAL(1, bar_print_message_formatted_fake.call_count);
	TEST_ASSERT_EQUAL_STRING("The numbers are %d, %d and %d", bar_print_message_formatted_fake.arg0_val);
}

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
ceedling-0.31.1 plugins/fake_function_framework/examples/fff_example/test/test_foo.c
ceedling-0.31.0 plugins/fake_function_framework/examples/fff_example/test/test_foo.c
ceedling-0.30.0 plugins/fake_function_framework/examples/fff_example/test/test_foo.c
ceedling-0.28.3 plugins/fake_function_framework/examples/fff_example/test/test_foo.c
ceedling-0.28.2 plugins/fake_function_framework/examples/fff_example/test/test_foo.c
ceedling-0.28.1 plugins/fake_function_framework/examples/fff_example/test/test_foo.c
ceedling-0.27.0 plugins/fake_function_framework/examples/fff_example/test/test_foo.c
ceedling-0.25.0 plugins/fake_function_framework/examples/fff_example/test/test_foo.c
ceedling-0.24.0 plugins/fake_function_framework/examples/fff_example/test/test_foo.c
ceedling-0.22.0 plugins/fake_function_framework/examples/fff_example/test/test_foo.c
ceedling-0.21.0 plugins/fake_function_framework/examples/fff_example/test/test_foo.c