summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/frontend.c12
-rw-r--r--test/plottest.c14
2 files changed, 19 insertions, 7 deletions
diff --git a/test/frontend.c b/test/frontend.c
index bdc8d67..3d72229 100644
--- a/test/frontend.c
+++ b/test/frontend.c
@@ -1,8 +1,10 @@
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
+#include <unistd.h>
#include "libnsfb.h"
+
int main(int argc, char **argv)
{
nsfb_t *nsfb;
@@ -27,12 +29,20 @@ int main(int argc, char **argv)
return 2;
}
+ if (nsfb_set_geometry(nsfb, 0, 0, 32) == -1) {
+ fprintf(stderr, "Unable to set geometry\n");
+ nsfb_finalise(nsfb);
+ return 3;
+ }
+
if (nsfb_init_frontend(nsfb) == -1) {
fprintf(stderr, "Unable to initialise nsfb frontend\n");
nsfb_finalise(nsfb);
- return 3;
+ return 4;
}
+ sleep(2);
+
nsfb_finalise(nsfb);
return 0;
}
diff --git a/test/plottest.c b/test/plottest.c
index dc469f6..522cf82 100644
--- a/test/plottest.c
+++ b/test/plottest.c
@@ -4,14 +4,15 @@
#include "libnsfb.h"
#include "libnsfb_plot.h"
+#include "libnsfb_event.h"
#define UNUSED(x) ((x) = (x))
extern const struct {
- unsigned int width;
- unsigned int height;
- unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */
- unsigned char pixel_data[132 * 135 * 4 + 1];
+ unsigned int width;
+ unsigned int height;
+ unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */
+ unsigned char pixel_data[132 * 135 * 4 + 1];
} nsglobe;
const struct {
@@ -67,6 +68,7 @@ const struct {
int main(int argc, char **argv)
{
nsfb_t *nsfb;
+ nsfb_event_t event;
nsfb_bbox_t box;
nsfb_bbox_t box2;
nsfb_bbox_t box3;
@@ -240,8 +242,8 @@ int main(int argc, char **argv)
}
- while (true )
- nsfb_input(nsfb);
+ while (event.type != NSFB_EVENT_CONTROL)
+ nsfb_input(nsfb, &event, -1);
return 0;
}