File: multiasync_tests.hpp

package info (click to toggle)
cpr 1.12.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,452 kB
  • sloc: cpp: 14,315; ansic: 637; sh: 139; xml: 38; makefile: 16
file content (18 lines) | stat: -rw-r--r-- 381 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#pragma once

#include <atomic>
#include <condition_variable>
#include <gtest/gtest.h>

class TestSynchronizationEnv : public testing::Environment {
  public:
    std::atomic_size_t counter{0};
    std::atomic_bool fn_called{false};
    std::condition_variable test_cv{};
    std::mutex test_cv_mutex{};

    void Reset() {
        counter = 0;
        fn_called = false;
    }
};