osquery-1/osquery/debug
Alexander b68b609585
Debug only wrapper class and functions to perform some verifications (#4697)
* Debug only wrapper class and funcions to perform some verifications only in debug build

The best way to test the code is to create a proper tests. But tests just increase a probability that everithing works correct. To put more checks to runtime means sometimes a notable performance penalty. And there is a debug build for that reason. But writing a debug only code means to put here an there ugly macro conditions. Which make a code hard to read and fix.

Function `debug_only::check` is a way to perform this kind of verification in a pure C++ style without macro magic.
If you need to have some state for this checks use class `debug_only::Var`. This is a way to have a debug data and do verifications assosiated to it.

* Add debug_only::verifyTrue for the simple boolean condition
2018-08-01 17:02:10 +01:00
..
tests Debug only wrapper class and functions to perform some verifications (#4697) 2018-08-01 17:02:10 +01:00
CMakeLists.txt Debug only wrapper class and functions to perform some verifications (#4697) 2018-08-01 17:02:10 +01:00
debug_only.h Debug only wrapper class and functions to perform some verifications (#4697) 2018-08-01 17:02:10 +01:00