From ce07e811808f6a877f960cae09a2ae4251e1aa54 Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Mon, 26 Nov 2018 22:58:25 +0100 Subject: [PATCH] tests: on cursor shapes and regen tests.results --- src/bin/tyfuzz.c | 24 +++++++++++++++++++++++- tests/cursor-shape-0.sh | 2 ++ tests/cursor-shape-1.sh | 2 ++ tests/cursor-shape-2.sh | 2 ++ tests/cursor-shape-3.sh | 2 ++ tests/cursor-shape-4.sh | 2 ++ tests/cursor-shape-5.sh | 2 ++ tests/cursor-shape-6.sh | 2 ++ tests/cursor-shape-7.sh | 2 ++ tests/tests.results | 22 +++++++++++++++------- 10 files changed, 54 insertions(+), 8 deletions(-) create mode 100755 tests/cursor-shape-0.sh create mode 100755 tests/cursor-shape-1.sh create mode 100755 tests/cursor-shape-2.sh create mode 100755 tests/cursor-shape-3.sh create mode 100755 tests/cursor-shape-4.sh create mode 100755 tests/cursor-shape-5.sh create mode 100755 tests/cursor-shape-6.sh create mode 100755 tests/cursor-shape-7.sh diff --git a/src/bin/tyfuzz.c b/src/bin/tyfuzz.c index c80b34e3..c5106eb4 100644 --- a/src/bin/tyfuzz.c +++ b/src/bin/tyfuzz.c @@ -65,15 +65,17 @@ termio_font_size_set(Evas_Object *obj EINA_UNUSED, { } - +#ifndef TYTEST void termio_set_cursor_shape(Evas_Object *obj EINA_UNUSED, Cursor_Shape shape EINA_UNUSED) { } +#endif /* }}} */ /* {{{ TYTEST */ #ifdef TYTEST +const char *_cursor_shape = "undefined"; typedef struct _Termpty_Tests { size_t backsize, backpos; @@ -88,6 +90,24 @@ typedef struct _Termpty_Tests unsigned int bracketed_paste : 1; } Termpty_Tests; +void +termio_set_cursor_shape(Evas_Object *obj EINA_UNUSED, + Cursor_Shape shape EINA_UNUSED) +{ + switch (shape) + { + case CURSOR_SHAPE_UNDERLINE: + _cursor_shape = "underline"; + break; + case CURSOR_SHAPE_BAR: + _cursor_shape = "bar"; + break; + default: + case CURSOR_SHAPE_BLOCK: + _cursor_shape = "block"; + } +} + static void _termpty_to_termpty_tests(Termpty *ty, Termpty_Tests *tt) { @@ -152,6 +172,8 @@ _tytest_checksum(Termpty *ty) { MD5Update(&ctx, (unsigned char const*)"(NULL)", 6); } + MD5Update(&ctx, (unsigned char const*)_cursor_shape, + strlen(_cursor_shape)); MD5Final(hash, &ctx); diff --git a/tests/cursor-shape-0.sh b/tests/cursor-shape-0.sh new file mode 100755 index 00000000..2c29d38b --- /dev/null +++ b/tests/cursor-shape-0.sh @@ -0,0 +1,2 @@ +#!/bin/sh +printf '\033[0 q' diff --git a/tests/cursor-shape-1.sh b/tests/cursor-shape-1.sh new file mode 100755 index 00000000..17869f1a --- /dev/null +++ b/tests/cursor-shape-1.sh @@ -0,0 +1,2 @@ +#!/bin/sh +printf '\033[1 q' diff --git a/tests/cursor-shape-2.sh b/tests/cursor-shape-2.sh new file mode 100755 index 00000000..594c3547 --- /dev/null +++ b/tests/cursor-shape-2.sh @@ -0,0 +1,2 @@ +#!/bin/sh +printf '\033[2 q' diff --git a/tests/cursor-shape-3.sh b/tests/cursor-shape-3.sh new file mode 100755 index 00000000..f53f12b5 --- /dev/null +++ b/tests/cursor-shape-3.sh @@ -0,0 +1,2 @@ +#!/bin/sh +printf '\033[3 q' diff --git a/tests/cursor-shape-4.sh b/tests/cursor-shape-4.sh new file mode 100755 index 00000000..785a1b53 --- /dev/null +++ b/tests/cursor-shape-4.sh @@ -0,0 +1,2 @@ +#!/bin/sh +printf '\033[4 q' diff --git a/tests/cursor-shape-5.sh b/tests/cursor-shape-5.sh new file mode 100755 index 00000000..b140148e --- /dev/null +++ b/tests/cursor-shape-5.sh @@ -0,0 +1,2 @@ +#!/bin/sh +printf '\033[5 q' diff --git a/tests/cursor-shape-6.sh b/tests/cursor-shape-6.sh new file mode 100755 index 00000000..543c7f4f --- /dev/null +++ b/tests/cursor-shape-6.sh @@ -0,0 +1,2 @@ +#!/bin/sh +printf '\033[6 q' diff --git a/tests/cursor-shape-7.sh b/tests/cursor-shape-7.sh new file mode 100755 index 00000000..a6cc4b3b --- /dev/null +++ b/tests/cursor-shape-7.sh @@ -0,0 +1,2 @@ +#!/bin/sh +printf '\033[7 q' diff --git a/tests/tests.results b/tests/tests.results index fa5a8866..12ca893c 100644 --- a/tests/tests.results +++ b/tests/tests.results @@ -1,7 +1,15 @@ -decfra-no-restrict-cursor.sh 236d1c32fe49c8762ad204510117b1da -decfra-restrict-cursor.sh 898682203275b186e6c81424b93b1b79 -decera-no-restrict-cursor.sh d92d38dfe6fd6b4100e3f0dac0e0a405 -decera-restrict-cursor.sh baae3f0eef7e6f0032ba74f11ee306f6 -decera-decfra-extra.sh 53d28f0d90c30aefd0b9176572c47f63 -cursor-movements.sh 7ebb03610346e8fa56e171c55e7e2ec5 -fonts.sh be86e6ee87f551928a9783fa1a216aea +decfra-no-restrict-cursor.sh 45776d7f7369df2270530b4adbfd69c3 +decfra-restrict-cursor.sh 0a595dc0088097dd235dd5c8801a3eb5 +decera-no-restrict-cursor.sh 9d33acf9eca6eed4192e6d7f5104d202 +decera-restrict-cursor.sh 89b15109e4e2ade943a2ab3990729931 +decera-decfra-extra.sh abfe90a1df148bf15e7bf0d56163c76a +cursor-movements.sh 6b916da9bdb377e199bba69b1efefac6 +fonts.sh d0dcea18258b95d5c869aa866fcae10f +cursor-shape-0.sh c91e01b0e859cc043f21d804a01bcd50 +cursor-shape-1.sh c91e01b0e859cc043f21d804a01bcd50 +cursor-shape-2.sh c91e01b0e859cc043f21d804a01bcd50 +cursor-shape-3.sh dc3615ec92c9254cbf6b1deb83c3fda2 +cursor-shape-4.sh dc3615ec92c9254cbf6b1deb83c3fda2 +cursor-shape-5.sh 21332951c006a2d91cf0f227758ff477 +cursor-shape-6.sh 21332951c006a2d91cf0f227758ff477 +cursor-shape-7.sh 5d0dadf7273d918cbcd99df95e56795e