29 lines
636 B
C
29 lines
636 B
C
#include "test.h"
|
|
#include "../popup_layout.h"
|
|
|
|
void
|
|
popup_layout(struct ct *t)
|
|
{
|
|
Rune heart[] = { 0x2764, 0xfe0f };
|
|
Caret caret;
|
|
int x, y;
|
|
|
|
CT_EQ_INT(t, 1, popupcells(heart, nelem(heart)));
|
|
memset(&caret, 0, sizeof caret);
|
|
popupposition(&caret, 40, 50, 800, 600, 100, 60, &x, &y);
|
|
CT_EQ_INT(t, 50, x);
|
|
CT_EQ_INT(t, 60, y);
|
|
caret.valid = 1;
|
|
caret.x = 70;
|
|
caret.y = 80;
|
|
caret.h = 20;
|
|
popupposition(&caret, 40, 50, 800, 600, 100, 60, &x, &y);
|
|
CT_EQ_INT(t, 70, x);
|
|
CT_EQ_INT(t, 100, y);
|
|
caret.x = 790;
|
|
caret.y = 590;
|
|
popupposition(&caret, 0, 0, 800, 600, 100, 60, &x, &y);
|
|
CT_EQ_INT(t, 700, x);
|
|
CT_EQ_INT(t, 540, y);
|
|
}
|