Add fuzz testing drivers for all parameters

This commit is contained in:
Daniel J. Hofmann
2016-04-13 10:39:22 +02:00
committed by Patrick Niklaus
parent 3a0eed2ee5
commit 06b74c1f08
9 changed files with 179 additions and 40 deletions
+16
View File
@@ -0,0 +1,16 @@
#ifndef OSRM_FUZZ_UTIL_HPP
#define OSRM_FUZZ_UTIL_HPP
#include <type_traits>
// Fakes observable side effects the compiler can not optimize away
template <typename T> inline void escape(T p)
{
static_assert(std::is_pointer<T>::value, "");
asm volatile("" : : "g"((void *)p) : "memory");
}
// Possibly reads and writes all the memory in your system
inline void clobber() { asm volatile("" : : : "memory"); }
#endif