HyperDbg Debugger
Loading...
Searching...
No Matches
main.cpp File Reference

perform tests More...

#include "pch.h"

Functions

int main (int argc, char *argv[])
 Main function of test process.

Detailed Description

perform tests

Author
Sina Karvandi (sina@.nosp@m.hype.nosp@m.rdbg..nosp@m.org)
Version
0.11
Date
2024-08-11

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )

Main function of test process.

Parameters
argc
argv
Returns
int
23{
24 if (argc != 2)
25 {
26 printf("you should not test functionalities directly, instead use 'test all' "
27 "command from HyperDbg...\n");
28 return 1;
29 }
30
32 {
33 //
34 // # Test case 1
35 // Testing command parser
36 //
38 {
39 printf("\n[*] The main command parser test cases passed successfully\n");
40 }
41 else
42 {
43 printf("\n[x] The main command parser test cases failed\n");
44 }
45 }
46 else if (!strcmp(argv[1], TEST_CASE_PARAMETER_FOR_PE_PARSER))
47 {
48 //
49 // # Test case 2
50 // Testing PE parser helpers
51 //
52 if (TestPeParser())
53 {
54 printf("\n[*] The PE parser test cases passed successfully\n");
55 }
56 else
57 {
58 printf("\n[x] The PE parser test cases failed\n");
59 }
60 }
62 {
63 //
64 // # Test case 3
65 // Testing script semantic test cases
66 //
68 {
69 printf("\n[*] The script semantic test cases passed successfully\n");
70 }
71 else
72 {
73 printf("\n[x] The script semantic test cases failed\n");
74 }
75 }
77 {
78 //
79 // # Test case 4
80 // Testing CodeView RSDS parser helpers
81 //
83 {
84 printf("\n[*] The CodeView RSDS parser test cases passed successfully\n");
85 }
86 else
87 {
88 printf("\n[x] The CodeView RSDS parser test cases failed\n");
89 }
90 }
91 else if (!strcmp(argv[1], TEST_HWDBG_FUNCTIONALITIES))
92 {
93 //
94 // # Test hwdbg functionalities
95 //
97 {
98 printf("\n[*] The hwdbg test cases passed successfully\n");
99 }
100 else
101 {
102 printf("\n[x] The hwdbg test cases failed\n");
103 }
104 }
105 else
106 {
107 printf("unknown test case\n");
108 }
109
110 printf("\npress any key to exit...");
111
112 _getch();
113
114 return 0;
115}
#define TEST_CASE_PARAMETER_FOR_CODEVIEW_RSDS_PARSER
Test case parameter for testing CodeView RSDS parser.
Definition Definition.h:90
#define TEST_CASE_PARAMETER_FOR_MAIN_COMMAND_PARSER
Test case parameter for testing main command parser.
Definition Definition.h:80
#define TEST_CASE_PARAMETER_FOR_SCRIPT_SEMANTIC_TEST_CASES
Test case parameter for testing semantic script tests.
Definition Definition.h:95
#define TEST_CASE_PARAMETER_FOR_PE_PARSER
Test case parameter for testing PE parser.
Definition Definition.h:85
#define TEST_HWDBG_FUNCTIONALITIES
Test case parameter for testing main command parser.
Definition Definition.h:75
printf("ho")
BOOLEAN HwdbgTestCreateTestCases()
Create test cases for hwdbg.
Definition hwdbg-tests.cpp:195
char ** argv
Definition symbol-parser.h:47
BOOLEAN TestCodeViewRsdsParser()
Runs a series of test cases to validate the behavior of the RSDS parser helper functions.
Definition test-codeview-rsds-parser.cpp:449
BOOLEAN TestCommandParser()
Test command parser.
Definition test-parser.cpp:285
BOOLEAN TestPeParser()
Runs all PE parser unit tests and reports pass/fail results.
Definition test-pe-parser.cpp:213
BOOLEAN TestSemanticScripts()
Test semantic scripts.
Definition test-semantic-scripts.cpp:95