forked from DFHack/dfhack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsuspendtest.cpp
More file actions
51 lines (42 loc) · 1.08 KB
/
Copy pathsuspendtest.cpp
File metadata and controls
51 lines (42 loc) · 1.08 KB
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
49
50
51
// Test suspend/resume
#include <iostream>
#include <climits>
#include <integers.h>
#include <vector>
#include <ctime>
#include <string>
using namespace std;
#include <DFTypes.h>
#include <DFHackAPI.h>
int main (void)
{
string blah;
DFHack::API DF("Memory.xml");
if(!DF.Attach())
{
cerr << "DF not found" << endl;
return 1;
}
cout << "Attached, DF should be suspended now" << endl;
getline(cin, blah);
DF.Resume();
cout << "Resumed, DF should be running" << endl;
getline(cin, blah);
DF.Suspend();
cout << "Suspended, DF should be suspended now" << endl;
getline(cin, blah);
DF.Resume();
cout << "Resumed, testing ForceResume. Suspend using SysInternals Process Explorer" << endl;
getline(cin, blah);
DF.ForceResume();
cout << "ForceResumed. DF should be running." << endl;
getline(cin, blah);
if(!DF.Detach())
{
cerr << "Can't detach from DF" << endl;
return 1;
}
cout << "Detached, DF should be running again" << endl;
getline(cin, blah);
return 0;
}