trompeloeil

FORK: Header only C++14 mocking framework
git clone https://git.neptards.moe/u3shit/trompeloeil.git
Log | Files | Refs | README

custom_recursive_mutex.cpp (506B)


      1 #define TROMPELOEIL_CUSTOM_RECURSIVE_MUTEX
      2 #include <trompeloeil.hpp>
      3 
      4 namespace trompeloeil {
      5 
      6 std::unique_ptr<custom_recursive_mutex> create_custom_recursive_mutex() {
      7 
      8   class custom : public custom_recursive_mutex {
      9     void lock() override { mtx.lock(); }
     10     void unlock() override { mtx.unlock(); }
     11 
     12   private:
     13     std::recursive_mutex mtx;
     14   };
     15 
     16   return std::unique_ptr<custom>(new custom);
     17 }
     18 
     19 } // namespace trompeloeil
     20 
     21 class C {
     22 public:
     23   MAKE_MOCK0(func, int(void));
     24 };
     25 
     26 int main() {
     27   C c;
     28 }