From bbe45e2ebb912752a6bd64438973eca73a8406d2 Mon Sep 17 00:00:00 2001 From: bloodstalker Date: Mon, 23 Jan 2017 15:27:22 +0330 Subject: added tdd tests for automatic refactoring --- test/auto-refac-tdd/auto-refac-tdd01.c | 49 ++++++++++++++++++++++++++++++++++ test/auto-refac-tdd/auto-refac-tdd01.h | 17 ++++++++++++ test/auto-refac-tdd/mut.c | 0 3 files changed, 66 insertions(+) create mode 100644 test/auto-refac-tdd/auto-refac-tdd01.c create mode 100644 test/auto-refac-tdd/auto-refac-tdd01.h create mode 100644 test/auto-refac-tdd/mut.c (limited to 'test/auto-refac-tdd') diff --git a/test/auto-refac-tdd/auto-refac-tdd01.c b/test/auto-refac-tdd/auto-refac-tdd01.c new file mode 100644 index 0000000..40e60d1 --- /dev/null +++ b/test/auto-refac-tdd/auto-refac-tdd01.c @@ -0,0 +1,49 @@ + +/*first line's intentionally left blank.*/ +/**********************************************************************************************************************/ +/*inclusion directives*/ +#include "auto-refac-tdd01.h" +/**********************************************************************************************************************/ +/**************************************************MACROS & DEFS*******************************************************/ +#define MACRO1 100U + +/**********************************************************************************************************************/ +/******************************************************Globals*********************************************************/ + + +/**********************************************************************************************************************/ +/***********************************************Function Definitions***************************************************/ +void tdd_forfixer(void) +{ + int loopcounter; + int counter; + + for (loopcounter = 0; loopcounter < 10; ++loopcounter) + counter; + + for (loopcounter = 0; loopcounter < 10; ++loopcounter) + counter-- ; +} + +void tdd_ifconstswapper(void) +{ + int a; + + if (a = 10) + { + /*blah blah*/ + } + + if (a == MACRO1) + { + + } + + if (MACRO1 == a) + { + + } +} +/**********************************************************************************************************************/ +/**********************************************************************************************************************/ +/*last line's intntionally left blank.*/ diff --git a/test/auto-refac-tdd/auto-refac-tdd01.h b/test/auto-refac-tdd/auto-refac-tdd01.h new file mode 100644 index 0000000..7acdb65 --- /dev/null +++ b/test/auto-refac-tdd/auto-refac-tdd01.h @@ -0,0 +1,17 @@ + +/*first line's been intentionally left blank.*/ +#ifndef AUTO_REFAC_TDD_01_H +#define AUTO_REFAC_TDD_01_H +/*********************************************************************************************************************/ +/**************************************************MACROS & DEFS*******************************************************/ + +/*********************************************************************************************************************/ +/***************************************************Globals***********************************************************/ + +/*********************************************************************************************************************/ +/********************************************Function Declarations****************************************************/ + + +/*********************************************************************************************************************/ +#endif +/*last line's intentionally lefg blank.*/ diff --git a/test/auto-refac-tdd/mut.c b/test/auto-refac-tdd/mut.c new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3