Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/cJSON/blob/master/tests/unity/extras/fixture/test/template_fixture_tests.c # cJSON [Ported from github.com/DaveGamble/cJSON] Fix: heap-use-after-free in merge_patch when patch is subtree of target (#1065) Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `cJSON / tests / unity / extras / fixture / test / template_fixture_tests.c` 39 lines ยท 722 bytes Raw Blame History 1 /* Copyright (c) 2010 James Grenning and Contributed to Unity Project 2 * ========================================== 3 * Unity Project - A Test Framework for C 4 * Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams 5 * [Released under MIT License. Please refer to license.txt for details] 6 * ========================================== */ 7 8 #include "unity_fixture.h" 9 10 static int data = -1; 11 12 TEST_GROUP(mygroup); 13 14 TEST_SETUP(mygroup) 15 { 16 data = 0; 17 } 18 19 TEST_TEAR_DOWN(mygroup) 20 { 21 data = -1; 22 } 23 24 TEST(mygroup, test1) 25 { 26 TEST_ASSERT_EQUAL_INT(0, data); 27 } 28 29 TEST(mygroup, test2) 30 { 31 TEST_ASSERT_EQUAL_INT(0, data); 32 data = 5; 33 } 34 35 TEST(mygroup, test3) 36 { 37 data = 7; 38 TEST_ASSERT_EQUAL_INT(7, data); 39 }