2019-08-19 18:43:23 +08:00
|
|
|
|
#include "base/window.h"
|
2019-04-01 12:22:41 +08:00
|
|
|
|
#include "base/canvas.h"
|
|
|
|
|
#include "base/widget.h"
|
|
|
|
|
#include "font_dummy.h"
|
|
|
|
|
#include "lcd_log.h"
|
|
|
|
|
#include "gtest/gtest.h"
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
2019-04-02 09:32:22 +08:00
|
|
|
|
extern "C" widget_t* window_design_create(widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h);
|
|
|
|
|
extern "C" image_manager_t* t_image_manager;
|
|
|
|
|
extern "C" locale_info_t* t_locale_info;
|
|
|
|
|
extern "C" assets_manager_t* t_assets_manager;
|
|
|
|
|
extern "C" font_manager_t* t_font_manager;
|
2019-04-01 12:22:41 +08:00
|
|
|
|
|
|
|
|
|
TEST(WindowDesign, locale_info) {
|
|
|
|
|
widget_t* w = window_design_create(NULL, 10, 20, 30, 40);
|
|
|
|
|
|
|
|
|
|
ASSERT_EQ(widget_get_locale_info(w), t_locale_info);
|
|
|
|
|
|
|
|
|
|
widget_destroy(w);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST(WindowDesign, image_manager) {
|
|
|
|
|
widget_t* w = window_design_create(NULL, 10, 20, 30, 40);
|
|
|
|
|
|
|
|
|
|
ASSERT_EQ(widget_get_image_manager(w), t_image_manager);
|
|
|
|
|
|
|
|
|
|
widget_destroy(w);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST(WindowDesign, assets_manager) {
|
|
|
|
|
widget_t* w = window_design_create(NULL, 10, 20, 30, 40);
|
|
|
|
|
|
|
|
|
|
ASSERT_EQ(widget_get_assets_manager(w), t_assets_manager);
|
|
|
|
|
|
|
|
|
|
widget_destroy(w);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST(WindowDesign, font_manager) {
|
|
|
|
|
widget_t* w = window_design_create(NULL, 10, 20, 30, 40);
|
|
|
|
|
|
|
|
|
|
ASSERT_EQ(widget_get_font_manager(w), t_font_manager);
|
|
|
|
|
|
|
|
|
|
widget_destroy(w);
|
|
|
|
|
}
|