| 1 |
#include "CppUTest/TestHarness.h" |
| 2 |
|
| 3 |
static int fakeRan = 0; |
| 4 |
|
| 5 |
extern "C" |
| 6 |
{ |
| 7 |
#include "ClassName.h" |
| 8 |
void virtualFunction_renameThis_fake(ClassName*) |
| 9 |
{ |
| 10 |
fakeRan = 1; |
| 11 |
} |
| 12 |
} |
| 13 |
|
| 14 |
TEST_GROUP(ClassName) |
| 15 |
{ |
| 16 |
ClassName* aClassName; |
| 17 |
|
| 18 |
void setup() |
| 19 |
{ |
| 20 |
aClassName = ClassName_Create(); |
| 21 |
fakeRan = 0; |
| 22 |
aClassName->virtualFunction_renameThis = virtualFunction_renameThis_fake; |
| 23 |
} |
| 24 |
|
| 25 |
void teardown() |
| 26 |
{ |
| 27 |
ClassName_Destroy(aClassName); |
| 28 |
} |
| 29 |
}; |
| 30 |
|
| 31 |
TEST(ClassName, Fake) |
| 32 |
{ |
| 33 |
aClassName->virtualFunction_renameThis(aClassName); |
| 34 |
LONGS_EQUAL(1, fakeRan); |
| 35 |
} |
| 36 |
|
| 37 |
TEST(ClassName, Create) |
| 38 |
{ |
| 39 |
FAIL("Start here"); |
| 40 |
} |
| 41 |
|