From 07293d0d47f099d5801b3b32ecd80603fa248495 Mon Sep 17 00:00:00 2001 From: fvanroie Date: Thu, 29 Oct 2020 18:15:12 +0100 Subject: [PATCH] Update hasp-lvgl.robot --- lib/lvgl | 2 +- src/{lv_theme_hasp.c => lv_theme_hasp.cpp} | 5 ++-- test/hasp-lvgl.robot | 34 +++++++++++++++++----- 3 files changed, 31 insertions(+), 10 deletions(-) rename src/{lv_theme_hasp.c => lv_theme_hasp.cpp} (99%) diff --git a/lib/lvgl b/lib/lvgl index 3543cc05..00d32b12 160000 --- a/lib/lvgl +++ b/lib/lvgl @@ -1 +1 @@ -Subproject commit 3543cc051bdb7b8233ddcc71b3694efcbe562c52 +Subproject commit 00d32b127f5745bf477e9b3c8ae89f11b0247a5b diff --git a/src/lv_theme_hasp.c b/src/lv_theme_hasp.cpp similarity index 99% rename from src/lv_theme_hasp.c rename to src/lv_theme_hasp.cpp index 6f755dd7..558c7db3 100644 --- a/src/lv_theme_hasp.c +++ b/src/lv_theme_hasp.cpp @@ -1,5 +1,5 @@ /** - * @file lv_theme_hasp.c + * @file lv_theme_hasp.cpp * */ @@ -11,6 +11,7 @@ #if LV_USE_THEME_HASP #include "lv_misc/lv_gc.h" +#include "lv_theme_hasp.h" #if defined(LV_GC_INCLUDE) #include LV_GC_INCLUDE @@ -350,7 +351,7 @@ lv_theme_t * lv_theme_hasp_init(lv_color_t color_primary, lv_color_t color_secon LV_GC_ROOT(_lv_theme_template_styles) = lv_mem_alloc(sizeof(theme_styles_t)); styles = (theme_styles_t *)LV_GC_ROOT(_lv_theme_template_styles); #else - styles = lv_mem_alloc(sizeof(theme_styles_t)); + styles = (theme_styles_t*)lv_mem_alloc(sizeof(theme_styles_t)); #endif } diff --git a/test/hasp-lvgl.robot b/test/hasp-lvgl.robot index 143e7e59..9b3f708f 100644 --- a/test/hasp-lvgl.robot +++ b/test/hasp-lvgl.robot @@ -9,8 +9,8 @@ | | ... | ${property}=${property} | ${data}=${data} | | ${time} | Get Time | epoch | | ${client} | Catenate | SEPARATOR=. | robot.mqtt | ${time} -| | ${topic} | Set Variable | hasp/plate35/command -| | ${restopic} | Set Variable | hasp/plate35/state/json +| | ${topic} | Set Variable | hasp/plate37/command +| | ${restopic} | Set Variable | hasp/plate37/state/json | | ${qos} | Set Variable | 1 | | ${message} | Set Variable | ${property}=${data} | | ${result} | Set Variable | {"${property}":"${data}"} @@ -31,8 +31,8 @@ | | ... | ${property}=${property} | ${data}=${data} | | ${time} | Get Time | epoch | | ${client} | Catenate | SEPARATOR=. | robot.mqtt | ${time} -| | ${topic} | Set Variable | hasp/plate35/command -| | ${restopic} | Set Variable | hasp/plate35/state/page +| | ${topic} | Set Variable | hasp/plate37/command +| | ${restopic} | Set Variable | hasp/plate37/state/page | | ${qos} | Set Variable | 1 | | ${message} | Set Variable | ${property}=${data} | | Subscribe Async | client.id=${client} | topic=${restopic} @@ -44,12 +44,26 @@ | | Length Should Be | ${messages} | 1 | | Should Be Equal As Strings | ${messages}[0] | ${data} +| Hasp Command +| | [Arguments] | ${broker.uri}=${broker.uri} | ${port}=${broker.port} +| | ... | ${client.id}=${client.id} | ${clean_session}=${true} +| | ... | ${property}=${property} | ${data}=${data} +| | ${time} | Get Time | epoch +| | ${client} | Catenate | SEPARATOR=. | robot.mqtt | ${time} +| | ${topic} | Set Variable | hasp/plate37/command/${property} +| | ${restopic} | Set Variable | hasp/plate37/state/page +| | ${qos} | Set Variable | 1 +| | ${message} | Set Variable | ${data} +| | Connect | ${broker.uri} | ${port} | ${client.id} | ${clean_session} +| | Publish | ${topic} | ${message} | 1 | *Test Cases* | Test Color Picker\n | | ${obj} | Set Variable | p[1].b[4] | | Test Page | property=page | data=1 +| | Hasp Command | property=clearpage | data=1 +| | Hasp Command | property=jsonl | data={"page":1,"id":4,"objid":20} #| | Test Property | property=${obj}.txt | data=ABC #| | Test Property | property=${obj}.txt | data=1234 | | Test Property | property=${obj}.x | data=50 @@ -80,6 +94,8 @@ | Test Text Field\n | | ${obj} | Set Variable | p[1].b[1] | | Test Page | property=page | data=1 +| | Hasp Command | property=clearpage | data=1 +| | Hasp Command | property=jsonl | data={"page":1,"id":1,"objid":12} | | Test Property | property=${obj}.txt | data=ABC | | Test Property | property=${obj}.txt | data=123 | | Test Property | property=${obj}.x | data=20 @@ -103,8 +119,10 @@ | Test Button\n -| | ${obj} | Set Variable | p[0].b[1] -| | Test Page | property=page | data=0 +| | ${obj} | Set Variable | p[1].b[1] +| | Test Page | property=page | data=1 +| | Hasp Command | property=clearpage | data=1 +| | Hasp Command | property=jsonl | data={"page":1,"id":1,"objid":10} #| | Test Property | property=${obj}.txt | data=ABC #| | Test Property | property=${obj}.txt | data=1234 | | Test Property | property=${obj}.x | data=20 @@ -133,8 +151,10 @@ | | Test Property | property=${obj}.val | data=3 | Test Slider\n -| | ${obj} | Set Variable | p[1].b[3] +| | ${obj} | Set Variable | p[1].b[4] | | Test Page | property=page | data=1 +| | Hasp Command | property=clearpage | data=1 +| | Hasp Command | property=jsonl | data={"page":1,"id":4,"objid":30} #| | Test Property | property=${obj}.txt | data=ABC #| | Test Property | property=${obj}.txt | data=1234 | | Test Property | property=${obj}.x | data=20