-
Notifications
You must be signed in to change notification settings - Fork 229
/
Copy pathDataBreakpointTest.h
48 lines (39 loc) · 1.51 KB
/
DataBreakpointTest.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//--------------------------------------------------------------------------------------
// DataBreakpointTest.h
//
// Advanced Technology Group (ATG)
// Copyright (C) Microsoft Corporation. All rights reserved.
//--------------------------------------------------------------------------------------
#pragma once
#include <cstdint>
#include <atomic>
#include <thread>
#include <vector>
#include <chrono>
#include "OSLockable.h"
class DataBreakpointTest
{
public:
enum class WhichTest
{
ExecutionTest,
ReadTest,
ReadWriteTest
};
private:
ATG::EventLockable<false, false> m_startTestEvent; // used to signal a test should start on the test thread
ATG::EventLockable<false, false> m_testDoneEvent; // used to notify the main thread the test was completed
std::atomic<bool> m_testSuccessful; // was the last test run successful
std::atomic<bool> m_shutdownThread; // used to tell the test thread to exit, m_startTestEvent needs to be signalled as well
std::thread *m_testThread;
WhichTest m_currentTest;
uint32_t m_readWriteFailVariable; // testing variables
uint32_t m_writeFailVariable;
uint32_t TestThreadFunction();
public:
DataBreakpointTest();
DataBreakpointTest(const DataBreakpointTest& rhs) = delete;
DataBreakpointTest(const DataBreakpointTest&& rhs) = delete;
DataBreakpointTest& operator=(const DataBreakpointTest& rhs) = delete;
bool RunTest(WhichTest test);
};