FreeEMS  0.2.0-SNAPSHOT-282-g9efc524
BenchTest.h
Go to the documentation of this file.
1 /* FreeEMS - the open source engine management system
2  *
3  * Copyright 2011-2012 Fred Cooke
4  *
5  * This file is part of the FreeEMS project.
6  *
7  * FreeEMS software is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * FreeEMS software is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with any FreeEMS software. If not, see http://www.gnu.org/licenses/
19  *
20  * We ask that if you make any changes to this file you email them upstream to
21  * us at admin(at)diyefi(dot)org or, even better, fork the code on github.com!
22  *
23  * Thank you for choosing FreeEMS to run your engine!
24  */
25 
26 
27 /** @file
28  *
29  * @ingroup allHeaders
30  * @ingroup testing
31  *
32  * Contains bench test only vars and defines etc.
33  *
34  * To add a file to the project :
35  * - Change all 4 hash defines to the filename uppercased and underscored
36  *
37  */
38 
39 
40 /* Header file multiple inclusion protection courtesy eclipse Header Template */
41 /* and http://gcc.gnu.org/onlinedocs/gcc-3.1.1/cpp/ C pre processor manual */
42 #ifndef FILE_BENCH_TEST_H_SEEN
43 #define FILE_BENCH_TEST_H_SEEN
44 
45 
46 #ifdef EXTERN
47 #warning "EXTERN already defined by another header, please sort it out!"
48 #undef EXTERN /* If fail on warning is off, remove the definition such that we can redefine correctly. */
49 #endif
50 
51 
52 #ifdef STATIC_BENCH_TEST_C
53 #define EXTERN
54 #else
55 #define EXTERN extern
56 #endif
57 
58 
59 EXTERN unsigned short testTicksPerEvent;
60 EXTERN unsigned short testNumberOfCycles;
61 EXTERN unsigned char testEventsPerCycle;
63 EXTERN unsigned char testMode;
64 #define TEST_MODE_STOP 0
65 #define TEST_MODE_ITERATIONS 1
66 #define TEST_MODE_BUMP_UP_CYCLES 2
67 #define TEST_MODE_DODGY_MISSING_TOOTH TEST_MODE_BUMP_UP_CYCLES // Genuine bumps exit before getting here, so this is being reused in the hackiest most horrible way imaginable!
68 #define TEST_MODE_TIME_UNITS_SECONDS 3
69 #define TEST_MODE_TIME_UNITS_MINUTES 4
70 #define TEST_MODE_TIME_UNITS_HOURS 5
71 #define TEST_MODE_REVOLUTIONS 6 // Default of dizzy, sub modes of different patterns:
72 #define TEST_MODE_REVOLUTIONS_12_1 7
73 #define TEST_MODE_REVOLUTIONS_24_1 8
74 #define TEST_MODE_REVOLUTIONS_36_1 9
75 #define TEST_MODE_REVOLUTIONS_60_2 10
76 #define TEST_MODE_REVOLUTIONS_4and1 11
77 #define TEST_MODE_REVOLUTIONS_4and2 12
78 #define TEST_MODE_REVOLUTIONS_24and1 13
79 #define TEST_MODE_REVOLUTIONS_24and2 14
80 #define TEST_MODE_REVOLUTIONS_LT1 15
81 
82 
83 /// @todo TODO make event array length a var, and populate it with the const at init time, and with the chosen fake array type
84 /// @todo TODO make the event array itself be a pointer, and switch this pointer in the bench test call with it pre-inited to the address of the const array for real decoders
85 
86 
87 #undef EXTERN
88 
89 
90 #else
91  /* let us know if we are being untidy with headers */
92  #warning "Header file BENCH_TEST_H seen before, sort it out!"
93 /* end of the wrapper ifdef from the very top */
94 #endif