-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.cpp
67 lines (50 loc) · 1.42 KB
/
main.cpp
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include <cstdlib>
#include <cstdio>
#include "src/implementation/templates.hpp"
#include "src/implementation/examples/mario_kart_8.hpp"
#define TABS "\t\t\t"
void testFillMemory32() {
unsigned int length = 0xC;
auto *address = (unsigned int *) malloc(length);
unsigned int value = 0x13371337;
enum dataType dataType = THIRTY_TWO_BIT;
fillMemoryInternal(address, length, value, dataType);
for (int valueIndex = 0; valueIndex < length; valueIndex += getBytesCount(dataType)) {
if (readInternal(address, dataType) != value) {
printf("fillMemory32()%sfailed\n", TABS);
goto AFTER_FILL_MEMORY;
}
}
printf("fillMemory32()%spassed\n", TABS);
AFTER_FILL_MEMORY:;
free(address);
}
void testFillMemory8() {
unsigned int length = 0xC;
auto *address = (unsigned int *) malloc(length);
unsigned int value = 0x37;
enum dataType dataType = EIGHT_BIT;
fillMemoryInternal(address, length, value, dataType);
for (int valueIndex = 0; valueIndex < length; valueIndex += getBytesCount(dataType)) {
if (readInternal(address, dataType) != value) {
printf("fillMemory8()%sfailed\n", TABS);
goto AFTER_FILL_MEMORY;
}
}
printf("fillMemory8()%spassed\n", TABS);
AFTER_FILL_MEMORY:;
free(address);
}
void testFillMemory() {
testFillMemory8();
testFillMemory32();
}
void testWriteSearchTemplate() {
}
int main() {
randomVR();
exit(EXIT_SUCCESS);
testFillMemory();
testWriteSearchTemplate();
return EXIT_SUCCESS;
}