135375f98Sopenharmony_ci/* This Test File Is Used To Verify Many Combinations Of Using the Generate Test Runner Script */ 235375f98Sopenharmony_ci 335375f98Sopenharmony_ci#include <stdio.h> 435375f98Sopenharmony_ci#include "unity.h" 535375f98Sopenharmony_ci#include "Defs.h" 635375f98Sopenharmony_ci 735375f98Sopenharmony_ciTEST_SOURCE_FILE("some_file.c") 835375f98Sopenharmony_ci 935375f98Sopenharmony_ci/* Notes about prefixes: 1035375f98Sopenharmony_ci test - normal default prefix. these are "always run" tests for this procedure 1135375f98Sopenharmony_ci spec - normal default prefix. required to run default setup/teardown calls. 1235375f98Sopenharmony_ci*/ 1335375f98Sopenharmony_ci 1435375f98Sopenharmony_ci/* Include Passthroughs for Linking Tests */ 1535375f98Sopenharmony_civoid putcharSpy(int c) { (void)putchar(c);} 1635375f98Sopenharmony_civoid flushSpy(void) {} 1735375f98Sopenharmony_ci 1835375f98Sopenharmony_ci/* Global Variables Used During These Tests */ 1935375f98Sopenharmony_ciint CounterSetup = 0; 2035375f98Sopenharmony_ciint CounterTeardown = 0; 2135375f98Sopenharmony_ciint CounterSuiteSetup = 0; 2235375f98Sopenharmony_ci 2335375f98Sopenharmony_civoid setUp(void) 2435375f98Sopenharmony_ci{ 2535375f98Sopenharmony_ci CounterSetup = 1; 2635375f98Sopenharmony_ci} 2735375f98Sopenharmony_ci 2835375f98Sopenharmony_civoid tearDown(void) 2935375f98Sopenharmony_ci{ 3035375f98Sopenharmony_ci CounterTeardown = 1; 3135375f98Sopenharmony_ci} 3235375f98Sopenharmony_ci 3335375f98Sopenharmony_civoid custom_setup(void) 3435375f98Sopenharmony_ci{ 3535375f98Sopenharmony_ci CounterSetup = 2; 3635375f98Sopenharmony_ci} 3735375f98Sopenharmony_ci 3835375f98Sopenharmony_civoid custom_teardown(void) 3935375f98Sopenharmony_ci{ 4035375f98Sopenharmony_ci CounterTeardown = 2; 4135375f98Sopenharmony_ci} 4235375f98Sopenharmony_ci 4335375f98Sopenharmony_civoid test_ThisTestAlwaysPasses(void) 4435375f98Sopenharmony_ci{ 4535375f98Sopenharmony_ci TEST_PASS(); 4635375f98Sopenharmony_ci} 4735375f98Sopenharmony_ci 4835375f98Sopenharmony_civoid test_ThisTestAlwaysFails(void) 4935375f98Sopenharmony_ci{ 5035375f98Sopenharmony_ci TEST_FAIL_MESSAGE("This Test Should Fail"); 5135375f98Sopenharmony_ci} 5235375f98Sopenharmony_ci 5335375f98Sopenharmony_civoid test_ThisTestAlwaysIgnored(void) 5435375f98Sopenharmony_ci{ 5535375f98Sopenharmony_ci TEST_IGNORE_MESSAGE("This Test Should Be Ignored"); 5635375f98Sopenharmony_ci} 5735375f98Sopenharmony_ci 5835375f98Sopenharmony_civoid spec_ThisTestPassesWhenNormalSetupRan(void) 5935375f98Sopenharmony_ci{ 6035375f98Sopenharmony_ci TEST_ASSERT_EQUAL_MESSAGE(1, CounterSetup, "Normal Setup Wasn't Run"); 6135375f98Sopenharmony_ci} 6235375f98Sopenharmony_ci 6335375f98Sopenharmony_civoid spec_ThisTestPassesWhenNormalTeardownRan(void) 6435375f98Sopenharmony_ci{ 6535375f98Sopenharmony_ci TEST_ASSERT_EQUAL_MESSAGE(1, CounterTeardown, "Normal Teardown Wasn't Run"); 6635375f98Sopenharmony_ci} 67