forked from pyrite-dev/milsko
add iteration option to fuzzer
This commit is contained in:
parent
b639367470
commit
c14c267ebe
2 changed files with 8 additions and 5 deletions
2
configure
vendored
2
configure
vendored
|
|
@ -221,7 +221,7 @@ print(OUT " cp -rf include \$(DESTDIR)\$(PREFIX)/\n");
|
||||||
print(OUT "\n");
|
print(OUT "\n");
|
||||||
print(OUT "format:\n");
|
print(OUT "format:\n");
|
||||||
print(OUT
|
print(OUT
|
||||||
" clang-format --verbose -i `find src include examples \"(\" -name \"*.c\" -or -name \"*.h\" -or -name \"*.m\" \")\" -and -not -name \"*ttf.c\"`\n"
|
" clang-format --verbose -i `find tools src include examples \"(\" -name \"*.c\" -or -name \"*.h\" -or -name \"*.m\" \")\" -and -not -name \"*ttf.c\"`\n"
|
||||||
);
|
);
|
||||||
print(OUT
|
print(OUT
|
||||||
" perltidy -b -bext=\"/\" --paren-tightness=2 `find tools pl configure -name \"*.pl\"`\n"
|
" perltidy -b -bext=\"/\" --paren-tightness=2 `find tools pl configure -name \"*.pl\"`\n"
|
||||||
|
|
|
||||||
|
|
@ -11,15 +11,18 @@ typedef struct cls_pair {
|
||||||
} cls_pair_t;
|
} cls_pair_t;
|
||||||
|
|
||||||
cls_pair_t classes[] = {H(MwBoxClass), H(MwButtonClass), H(MwCheckBoxClass), H(MwComboBoxClass), H(MwEntryClass), H(MwFrameClass), H(MwImageClass), H(MwLabelClass), H(MwListBoxClass), H(MwMenuClass), H(MwNumberEntryClass), H(MwProgressBarClass), H(MwRadioBoxClass), H(MwScrollBarClass), H(MwSeparatorClass), H(MwTreeViewClass), H(MwViewportClass)};
|
cls_pair_t classes[] = {H(MwBoxClass), H(MwButtonClass), H(MwCheckBoxClass), H(MwComboBoxClass), H(MwEntryClass), H(MwFrameClass), H(MwImageClass), H(MwLabelClass), H(MwListBoxClass), H(MwMenuClass), H(MwNumberEntryClass), H(MwProgressBarClass), H(MwRadioBoxClass), H(MwScrollBarClass), H(MwSeparatorClass), H(MwTreeViewClass), H(MwViewportClass)};
|
||||||
char* int_params[] = {/*MwNx, MwNy, MwNwidth, MwNheight,*/ MwNorientation, MwNminValue, MwNmaxValue, MwNvalue, MwNchangedBy, MwNareaShown, MwNchecked, MwNalignment, MwNbold, MwNmain, MwNleftPadding, MwNhasHeading, MwNhasBorder, MwNinverted, MwNmodernLook, MwNwaitMS, MwNhideInput, MwNsingleClickSelectable, MwNflat, MwNshowArrows, MwNpadding, MwNborderWidth, MwNfillArea, MwNratio, MwNfixedSize, MwNmargin, MwNbitmapFont, MwNsevenSegment, MwNlength, MwNforceInverted, MwNroundness, MwNisRounded, MwNdarkTheme};
|
char* int_params[] = {/*MwNx, MwNy, MwNwidth, MwNheight,*/ MwNorientation, MwNminValue, MwNmaxValue, MwNvalue, MwNchangedBy, MwNareaShown, MwNchecked, MwNalignment, MwNbold, MwNmain, MwNleftPadding, MwNhasHeading, MwNhasBorder, MwNinverted, MwNmodernLook, MwNwaitMS, MwNhideInput, MwNsingleClickSelectable, MwNflat, MwNshowArrows, MwNpadding, MwNborderWidth, MwNfillArea, MwNratio, MwNfixedSize, MwNmargin, MwNbitmapFont, MwNsevenSegment, MwNlength, MwNforceInverted, MwNisRounded, MwNdarkTheme};
|
||||||
unsigned long maxxes[] = {UINT8_MAX, UINT16_MAX, UINT32_MAX, UINT64_MAX};
|
unsigned long maxxes[] = {UINT8_MAX, UINT16_MAX, UINT32_MAX, UINT64_MAX};
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
int i, j = 0;
|
int i, j = 0, max = 0;
|
||||||
char input;
|
char input;
|
||||||
MwWidget window, widget;
|
MwWidget window, widget;
|
||||||
unsigned long upper_limit;
|
unsigned long upper_limit;
|
||||||
|
|
||||||
|
printf("How many iteration do you want to do? Type -1 if you wanna run it forever.\n");
|
||||||
|
scanf("%d", &max);
|
||||||
|
|
||||||
printf("What upper limit of int params do you want to test?\n");
|
printf("What upper limit of int params do you want to test?\n");
|
||||||
for(i = 0; i < (sizeof(maxxes) / sizeof(unsigned long)); i++) {
|
for(i = 0; i < (sizeof(maxxes) / sizeof(unsigned long)); i++) {
|
||||||
printf("%d) %lu\n", i, maxxes[i]);
|
printf("%d) %lu\n", i, maxxes[i]);
|
||||||
|
|
@ -49,7 +52,7 @@ get_input:
|
||||||
|
|
||||||
window = MwCreateWidget(MwWindowClass, "window", NULL, 0, 0, 400, 400);
|
window = MwCreateWidget(MwWindowClass, "window", NULL, 0, 0, 400, 400);
|
||||||
|
|
||||||
while(MwPending(window) && j < 50) {
|
while(MwPending(window) && (max == -1 || j < max)) {
|
||||||
int class_num = rand() % (sizeof(classes) / sizeof(cls_pair_t));
|
int class_num = rand() % (sizeof(classes) / sizeof(cls_pair_t));
|
||||||
widget = MwCreateWidget(*classes[class_num].cls, classes[class_num].name, window, 0, 0, 100, 100);
|
widget = MwCreateWidget(*classes[class_num].cls, classes[class_num].name, window, 0, 0, 100, 100);
|
||||||
|
|
||||||
|
|
@ -68,6 +71,6 @@ get_input:
|
||||||
|
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
|
|
||||||
MwFreeWidget(window);
|
MwFreeWidget(window);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue