-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clang implemented, need to pull out redundant code
- Loading branch information
1 parent
23000a4
commit ee40d31
Showing
10 changed files
with
141 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
File: xfakes-c.c From: example-clang-link-errors.txt | ||
Generated file to help to quickly stub C-linkage unresolved external references | ||
* When EXPLODING_FAKE_FOR is executed, a message is printed and the test run is existed | ||
* You could customize EXPLODING_FAKE_FOR to only fail the test | ||
* Add this file to your test build. | ||
* Do not include the header files for the referenced functions. The C-linker does not care. | ||
Note: a EXPLODING_FAKE_FOR() is generated for global variables too. | ||
* They will explode upon write :-) | ||
* You might want to resolve these a different way. | ||
*/ | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
#define BOOM_MESSAGE printf("BOOM! time to write a better fake for %s\n", __func__) | ||
#define EXPLODING_FAKE_FOR(f) void f(void); void f(void) { BOOM_MESSAGE; exit(1); } | ||
#define NULL_VOID_FAKE_FOR(f) void f(void); void f(void) {} | ||
#define NULL_VALUE_FAKE_FOR(value_type, f, result) value_type f(void); value_type f(void) { return result; } | ||
|
||
|
||
EXPLODING_FAKE_FOR(eventList) | ||
EXPLODING_FAKE_FOR(log_debug) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
File: xfakes-cpp.cpp From: example-clang-link-errors.txt | ||
Generated file to help to quickly stub C++ undefined external functions. | ||
* Add this file to your test build. | ||
* One at a time | ||
* Uncomment an exploing fake function definition. | ||
* Add needed the include file. | ||
* Modify non-void function return types and propvide a return value. | ||
* Fix errors. | ||
* Work carefully. Use the compiler and link error output to test your changes. | ||
* You could customize the BOOM macros to only fail the test, rather than exit the | ||
test runner. | ||
*/ | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
#define BOOM_MESSAGE printf("BOOM! time to write a better fake for %s\n", __func__) | ||
#define BOOM_VOID_CPP BOOM_MESSAGE; exit(1); | ||
#define BOOM_VALUE_CPP(result) BOOM_MESSAGE; exit(1); return result; | ||
|
||
/* | ||
* Production code header files | ||
*/ | ||
|
||
// #include "your.h" | ||
|
||
// void LightSwitch::LightSwitch() { BOOM_VOID_CPP } | ||
// void LightSwitch::Off(int) { BOOM_VOID_CPP } | ||
// void LightSwitch::On(int) { BOOM_VOID_CPP } | ||
// void LightSwitch::~LightSwitch() { BOOM_VOID_CPP } | ||
// void RandomMinuteGenerator::Get() { BOOM_VOID_CPP } | ||
// void RandomMinuteGenerator::RandomMinuteGenerator(int, int) { BOOM_VOID_CPP } | ||
// void RandomMinuteGenerator::~RandomMinuteGenerator() { BOOM_VOID_CPP } | ||
// void Time::Time(Time const&) { BOOM_VOID_CPP } | ||
// void Time::getDay() const { BOOM_VOID_CPP } | ||
// void Time::getMinute() const { BOOM_VOID_CPP } | ||
// void Time::~Time() { BOOM_VOID_CPP } | ||
// void TimeService::TimeService() { BOOM_VOID_CPP } | ||
// void TimeService::getTime() { BOOM_VOID_CPP } | ||
// void TimeService::wakePeriodically(std::__1::unique_ptr<WakeUpAction, std::__1::default_delete<WakeUpAction> >) { BOOM_VOID_CPP } | ||
// void TimeService::~TimeService() { BOOM_VOID_CPP } | ||
// void WakeUpAction::WakeUpAction(int) { BOOM_VOID_CPP } | ||
// void WakeUpAction::~WakeUpAction() { BOOM_VOID_CPP } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
File: xfakes-cpp-globals.cpp From: example-gcc-link-errors.txt | ||
Generated file to help to quickly stub C++ undefined external globals. | ||
* One at a time | ||
* Add the file containing the global definition to your build or | ||
add the global data definition (and its declaratiob) to this file. | ||
Adding the global to this file is probably not sustainable, but a | ||
pragmatic choice until you decide how to better organioze your global | ||
data. | ||
* Add include files as neededd. | ||
* Work carefully. Use the compiler and link error output to test your changes. | ||
*/ | ||
|
||
// cpp-global AcmeRegistry::instance; | ||
// cpp-global AcmeWpa::clock; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters