aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2019-10-31 20:06:16 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2019-10-31 20:06:16 +0100
commit196b4448dfce0614df53da46d6a3e8e8f09fa63e (patch)
tree01d561ef2819952d6c6a83677da23539ba949c57
parent1bdc95076e1ff978db4458bc6e5f1560aa08021b (diff)
downloadd2tk-196b4448dfce0614df53da46d6a3e8e8f09fa63e.tar.xz
test: add more test for link.
-rw-r--r--VERSION2
-rw-r--r--test/base.c25
2 files changed, 25 insertions, 2 deletions
diff --git a/VERSION b/VERSION
index 591b691..00dcbfa 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.873
+0.1.875
diff --git a/test/base.c b/test/base.c
index 8af9007..6eba21c 100644
--- a/test/base.c
+++ b/test/base.c
@@ -1941,7 +1941,6 @@ _test_combo_scroll_right()
};
int32_t val = 1;
const d2tk_state_t state = d2tk_base_combo(base, D2TK_ID, nitms, itms, &rect, &val);
- fprintf(stderr, "%s\n", d2tk_state_dump(state));
assert(state == (D2TK_STATE_HOT | D2TK_STATE_FOCUS | D2TK_STATE_FOCUS_IN
| D2TK_STATE_SCROLL_RIGHT | D2TK_STATE_OVER | D2TK_STATE_CHANGED) );
assert(val == 2);
@@ -2205,6 +2204,29 @@ _test_link()
}
static void
+_test_link_down()
+{
+ d2tk_mock_ctx_t ctx = {
+ .check = NULL
+ };
+
+ d2tk_base_t *base = d2tk_base_new(&d2tk_mock_driver_lazy, &ctx);
+ const d2tk_rect_t rect = D2TK_RECT(0, 0, DIM_W, DIM_H);
+ assert(base);
+
+ d2tk_base_set_butmask(base, D2TK_BUTMASK_LEFT, true);
+
+ const char *lbl= "link";
+ const d2tk_state_t state = d2tk_base_link(base, D2TK_ID, -1, lbl, 0.8f, &rect,
+ D2TK_ALIGN_LEFT);
+ assert(state == (D2TK_STATE_DOWN | D2TK_STATE_ACTIVE | D2TK_STATE_HOT
+ | D2TK_STATE_FOCUS | D2TK_STATE_FOCUS_IN | D2TK_STATE_CHANGED
+ | D2TK_STATE_OVER) );
+
+ d2tk_base_free(base);
+}
+
+static void
_test_dial_bool()
{
d2tk_mock_ctx_t ctx = {
@@ -2489,6 +2511,7 @@ main(int argc __attribute__((unused)), char **argv __attribute__((unused)))
_test_label_null();
_test_label_filled();
_test_link();
+ _test_link_down();
_test_dial_bool();
_test_dial_int32();
_test_dial_int64();