Skip to content

Instantly share code, notes, and snippets.

@pdcgomes
Created December 17, 2013 13:08
Show Gist options
  • Save pdcgomes/8004622 to your computer and use it in GitHub Desktop.
Save pdcgomes/8004622 to your computer and use it in GitHub Desktop.
You can use this to declare unit testing methods, they will be named: "test{index}_methodName" where {index} is automatically incremented whenever the macro is expanded. This ensures that unit tests run in the order they've been specified. WARNING: this will not work if you include the file in a precompiled header prefix
// You can use this to declare unit testing methods, they will be named:
// test{index}_methodName where {index} is automatically incremented whenever the macro is expanded
// this ensures that unit tests run in the order they've been specified
// WARNING: this will not work if you include the file in a precompiled header prefix
#define CONCAT_INNER(a, b) test##a##_##b
#define CONCAT(a, b) CONCAT_INNER(a, b)
#define DECLARE_TEST_METHOD(_testName_) CONCAT(__COUNTER__, _testName_)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment