added wip fuzzer, fixed alot of memory leaks with wayland
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
This commit is contained in:
parent
e41dbd43c1
commit
3e49278a15
5 changed files with 167 additions and 63 deletions
2
tools/.gitignore
vendored
Normal file
2
tools/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
font
|
||||
fuzzer
|
||||
|
|
@ -6,7 +6,10 @@ LIBS = `freetype-config --libs`
|
|||
.PHONY: all clean
|
||||
.SUFFIXES: .c .o
|
||||
|
||||
all: font
|
||||
all: fuzzer font
|
||||
|
||||
fuzzer: fuzzer.o
|
||||
$(CC) -g -L../src/ -Wl,-R../src -lMw -o $@ fuzzer.o
|
||||
|
||||
font: font.o
|
||||
$(CC) $(LDFLAGS) -o $@ font.o $(LIBS)
|
||||
|
|
@ -15,4 +18,4 @@ font: font.o
|
|||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -f *.o font
|
||||
rm -f *.o font fuzzer
|
||||
|
|
|
|||
85
tools/fuzzer.c
Normal file
85
tools/fuzzer.c
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
#include <Mw/Milsko.h>
|
||||
|
||||
#define WIDGET_AMOUNT 1
|
||||
|
||||
int main() {
|
||||
MwWidget window, widget;
|
||||
|
||||
MwLibraryInit();
|
||||
|
||||
window = MwCreateWidget(MwWindowClass, "window", NULL, 0, 0, 400, 400);
|
||||
|
||||
while(true) {
|
||||
int r = rand() % WIDGET_AMOUNT;
|
||||
MwClass cls;
|
||||
switch(r) {
|
||||
case 0:
|
||||
cls = MwBoxClass;
|
||||
break;
|
||||
case 1:
|
||||
cls = MwButtonClass;
|
||||
break;
|
||||
case 2:
|
||||
cls = MwCheckBoxClass;
|
||||
break;
|
||||
case 3:
|
||||
cls = MwComboBoxClass;
|
||||
break;
|
||||
case 4:
|
||||
cls = MwEntryClass;
|
||||
break;
|
||||
case 5:
|
||||
cls = MwFrameClass;
|
||||
break;
|
||||
case 6:
|
||||
cls = MwImageClass;
|
||||
break;
|
||||
case 7:
|
||||
cls = MwLabelClass;
|
||||
break;
|
||||
case 8:
|
||||
cls = MwListBoxClass;
|
||||
break;
|
||||
case 9:
|
||||
cls = MwMenuClass;
|
||||
break;
|
||||
case 10:
|
||||
cls = MwNumberEntryClass;
|
||||
break;
|
||||
case 12:
|
||||
cls = MwProgressBarClass;
|
||||
break;
|
||||
case 13:
|
||||
cls = MwRadioBoxClass;
|
||||
break;
|
||||
case 14:
|
||||
cls = MwScrollBarClass;
|
||||
break;
|
||||
case 15:
|
||||
cls = MwSeparatorClass;
|
||||
break;
|
||||
// case 16:
|
||||
// cls = MwSubMenuClass;
|
||||
// break;
|
||||
case 17:
|
||||
cls = MwTreeViewClass;
|
||||
break;
|
||||
case 18:
|
||||
cls = MwViewportClass;
|
||||
break;
|
||||
default:
|
||||
cls = NULL;
|
||||
break;
|
||||
}
|
||||
if(cls) {
|
||||
widget = MwCreateWidget(cls, "Cls", window, 0, 0, 100, 100);
|
||||
}
|
||||
|
||||
if(MwPending(window)) {
|
||||
MwStep(window);
|
||||
}
|
||||
if(cls) {
|
||||
MwDestroyWidget(widget);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue