mirror of
https://github.com/HyperDbg/HyperDbg.git
synced 2026-07-10 01:29:59 +00:00
add more test cases for the command parser
This commit is contained in:
parent
8caea1fb77
commit
00fd5391fe
2 changed files with 50 additions and 6 deletions
|
|
@ -25,14 +25,14 @@ createTestCaseArray(const std::vector<std::string> & testCases)
|
|||
//
|
||||
// Allocate memory for the array of pointers (size: number of test cases)
|
||||
//
|
||||
CHAR_PTR_PTR testCaseArray = new char *[testCases.size()];
|
||||
CHAR_PTR_PTR testCaseArray = (CHAR_PTR_PTR)malloc(testCases.size() * sizeof(UINT64));
|
||||
|
||||
//
|
||||
// Allocate memory for each string and copy the content
|
||||
//
|
||||
for (size_t i = 0; i < testCases.size(); ++i)
|
||||
{
|
||||
testCaseArray[i] = new char[testCases[i].length() + 1]; // +1 for the null terminator
|
||||
testCaseArray[i] = (char *)malloc(testCases[i].length() + 1); // +1 for the null terminator
|
||||
std::strcpy(testCaseArray[i], testCases[i].c_str());
|
||||
}
|
||||
|
||||
|
|
@ -54,13 +54,13 @@ freeTestCaseArray(CHAR_PTR_PTR testCaseArray, size_t size)
|
|||
//
|
||||
for (size_t i = 0; i < size; ++i)
|
||||
{
|
||||
delete[] testCaseArray[i];
|
||||
free(testCaseArray[i]);
|
||||
}
|
||||
|
||||
//
|
||||
// Free the array of pointers
|
||||
//
|
||||
delete[] testCaseArray;
|
||||
free(testCaseArray);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -304,7 +304,7 @@ TestCommandParser()
|
|||
//
|
||||
// Clean up memory
|
||||
//
|
||||
freeTestCaseArray(testCaseArray, testCases.size());
|
||||
freeTestCaseArray(testCaseArray, testCase.second.size());
|
||||
}
|
||||
|
||||
return overallResult;
|
||||
|
|
|
|||
|
|
@ -45,4 +45,48 @@ script
|
|||
@rax= @rbx;
|
||||
|
||||
printf("ho");
|
||||
|
||||
|
||||
_____________________________________________________________
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
!monitor 123 1234 script { tesTo salam
|
||||
|
||||
khoobi?
|
||||
}
|
||||
----------------------------------
|
||||
!monitor
|
||||
----------------------------------
|
||||
123
|
||||
----------------------------------
|
||||
1234
|
||||
----------------------------------
|
||||
script
|
||||
----------------------------------
|
||||
tesTo salam
|
||||
|
||||
khoobi?
|
||||
|
||||
_____________________________________________________________
|
||||
help settings
|
||||
----------------------------------
|
||||
help
|
||||
----------------------------------
|
||||
settings
|
||||
_____________________________________________________________
|
||||
help settings
|
||||
----------------------------------
|
||||
help
|
||||
----------------------------------
|
||||
settings
|
||||
_____________________________________________________________
|
||||
|
||||
f fsdfsdfds
|
||||
|
||||
|
||||
----------------------------------
|
||||
f
|
||||
----------------------------------
|
||||
fsdfsdfds
|
||||
Loading…
Add table
Add a link
Reference in a new issue