From 14adc6a1d769e22958496d570b7f25b68cc86969 Mon Sep 17 00:00:00 2001 From: benj Date: Fri, 16 Jun 2017 01:20:02 -0700 Subject: add unity testing fmwk and simple hash fn demonstration --- .../extras/fixture/test/template_fixture_tests.c | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 external/Unity/extras/fixture/test/template_fixture_tests.c (limited to 'external/Unity/extras/fixture/test/template_fixture_tests.c') diff --git a/external/Unity/extras/fixture/test/template_fixture_tests.c b/external/Unity/extras/fixture/test/template_fixture_tests.c new file mode 100644 index 0000000..18bbb89 --- /dev/null +++ b/external/Unity/extras/fixture/test/template_fixture_tests.c @@ -0,0 +1,39 @@ +/* Copyright (c) 2010 James Grenning and Contributed to Unity Project + * ========================================== + * Unity Project - A Test Framework for C + * Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams + * [Released under MIT License. Please refer to license.txt for details] + * ========================================== */ + +#include "unity_fixture.h" + +static int data = -1; + +TEST_GROUP(mygroup); + +TEST_SETUP(mygroup) +{ + data = 0; +} + +TEST_TEAR_DOWN(mygroup) +{ + data = -1; +} + +TEST(mygroup, test1) +{ + TEST_ASSERT_EQUAL_INT(0, data); +} + +TEST(mygroup, test2) +{ + TEST_ASSERT_EQUAL_INT(0, data); + data = 5; +} + +TEST(mygroup, test3) +{ + data = 7; + TEST_ASSERT_EQUAL_INT(7, data); +} -- cgit v1.2.3