Created
February 19, 2017 00:12
-
-
Save JayBazuzi/f348f7a95719e78a75d91e65d97f79ad to your computer and use it in GitHub Desktop.
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
#define Example(name) Example_(name, __COUNTER__) | |
#define Example_(name, counter) Example__(name, counter) | |
#define Example__(name, counter) \ | |
void Example##counter(); \ | |
struct ExampleInitializer##counter \ | |
{ \ | |
ExampleInitializer##counter() \ | |
{ \ | |
allExamples.Add({__FILE__, name, Example##counter}); \ | |
} \ | |
} ExampleInitializer##counter##Instance; \ | |
void Example##counter() | |
Example("it multiplies two numbers") | |
{ | |
auto testSubject = Calculator(); | |
auto result = testSubject.Multiply(6, 9); | |
Assert(result == 42); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment