From f1c4199eaca515f6aa24275a0b3bc1ce5ffa1b9f Mon Sep 17 00:00:00 2001 From: Lee Date: Thu, 21 Oct 2021 14:39:19 +0800 Subject: [PATCH] =?UTF-8?q?Signed-off-by:=E6=9D=8E=E6=96=87=E8=99=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lee --- build_lite/BUILD.gn | 6 +- graphic_lite/graphic_utils/BUILD.gn | 29 - graphic_lite/graphic_utils/a/BUILD.gn | 55 - graphic_lite/graphic_utils/a/Test.json | 25 - .../graphic_utils/a/src/UiInterfaceTest.cpp | 212 ---- .../graphic_utils/a/src/UiInterfaceTest.h | 19 - .../graphic_utils/color_posix/BUILD.gn | 46 - .../graphic_utils/color_posix/Test.json | 25 - .../color_posix/src/color_test.cpp | 390 ------- .../graphic_utils/geometry2d_posix/BUILD.gn | 46 - .../graphic_utils/geometry2d_posix/Test.json | 25 - .../geometry2d_posix/src/geometry2d_test.cpp | 232 ----- .../graphic_utils/graphic_math_posix/BUILD.gn | 46 - .../graphic_math_posix/Test.json | 25 - .../src/graphic_math_test.cpp | 484 --------- .../graphic_utils/heap_base_posix/BUILD.gn | 46 - .../graphic_utils/heap_base_posix/Test.json | 25 - .../heap_base_posix/src/heap_base_test.cpp | 42 - .../graphic_utils/list_posix/BUILD.gn | 46 - .../graphic_utils/list_posix/Test.json | 25 - .../list_posix/src/list_test.cpp | 284 ------ .../graphic_utils/mem_api_posix/BUILD.gn | 46 - .../graphic_utils/mem_api_posix/Test.json | 25 - .../mem_api_posix/src/mem_api_test.cpp | 77 -- .../graphic_utils/rect_posix/BUILD.gn | 46 - .../graphic_utils/rect_posix/Test.json | 25 - .../rect_posix/src/rect_test.cpp | 496 --------- .../graphic_utils/sys_info_posix/BUILD.gn | 46 - .../graphic_utils/sys_info_posix/Test.json | 25 - .../sys_info_posix/src/sys_info_test.cpp | 74 -- .../graphic_utils/transform_posix/BUILD.gn | 46 - .../graphic_utils/transform_posix/Test.json | 25 - .../transform_posix/src/transform_test.cpp | 214 ---- .../graphic_utils/version_posix/BUILD.gn | 46 - .../graphic_utils/version_posix/Test.json | 25 - .../version_posix/src/version_test.cpp | 61 -- graphic_lite/surface/BUILD.gn | 18 - graphic_lite/surface/surface_posix/BUILD.gn | 49 - graphic_lite/surface/surface_posix/Test.json | 25 - .../src/surface_surface_test.cpp | 77 -- .../surface_posix/src/surface_test.cpp | 247 ----- graphic_lite/ui/BUILD.gn | 64 -- graphic_lite/ui/a/BUILD.gn | 56 - graphic_lite/ui/a/Test.json | 25 - graphic_lite/ui/a/src/UiInterfaceTest.cpp | 965 ------------------ graphic_lite/ui/a/src/UiInterfaceTest.h | 19 - graphic_lite/ui/a/src/window_test.cpp | 166 --- graphic_lite/ui/animator_posix/BUILD.gn | 46 - graphic_lite/ui/animator_posix/Test.json | 25 - .../ui/animator_posix/src/animator_test.cpp | 131 --- .../ui/easing_equation_posix/BUILD.gn | 46 - .../ui/easing_equation_posix/Test.json | 25 - .../src/test_easing_equation.cpp | 246 ----- graphic_lite/ui/events_posix/BUILD.gn | 56 - graphic_lite/ui/events_posix/Test.json | 25 - .../ui/events_posix/src/cancel_event_test.cpp | 42 - .../ui/events_posix/src/click_event_test.cpp | 42 - .../ui/events_posix/src/drag_event_test.cpp | 143 --- .../ui/events_posix/src/event_test.cpp | 57 -- .../ui/events_posix/src/key_event_test.cpp | 58 -- .../src/long_press_event_test.cpp | 59 -- .../ui/events_posix/src/press_event_test.cpp | 43 - .../events_posix/src/release_event_test.cpp | 43 - .../src/virtual_device_event_test.cpp | 56 - graphic_lite/ui/flexlayout_posix/BUILD.gn | 46 - graphic_lite/ui/flexlayout_posix/Test.json | 25 - .../flexlayout_posix/src/test_flex_layout.cpp | 84 -- graphic_lite/ui/gridlayout_posix/BUILD.gn | 46 - graphic_lite/ui/gridlayout_posix/Test.json | 25 - .../gridlayout_posix/src/test_grid_layout.cpp | 46 - graphic_lite/ui/image_posix/BUILD.gn | 46 - graphic_lite/ui/image_posix/Test.json | 25 - .../ui/image_posix/src/image_test.cpp | 59 -- graphic_lite/ui/interpolation_posix/BUILD.gn | 46 - graphic_lite/ui/interpolation_posix/Test.json | 25 - .../src/interpolation_test.cpp | 49 - graphic_lite/ui/layout_posix/BUILD.gn | 46 - graphic_lite/ui/layout_posix/Test.json | 25 - .../ui/layout_posix/src/test_layout.cpp | 53 - graphic_lite/ui/listlayout_posix/BUILD.gn | 46 - graphic_lite/ui/listlayout_posix/Test.json | 25 - .../listlayout_posix/src/list_layout_test.cpp | 42 - graphic_lite/ui/screen_posix/BUILD.gn | 46 - graphic_lite/ui/screen_posix/Test.json | 25 - .../ui/screen_posix/src/screen_test.cpp | 50 - graphic_lite/ui/style_posix/BUILD.gn | 46 - graphic_lite/ui/style_posix/Test.json | 25 - .../ui/style_posix/src/style_test.cpp | 447 -------- graphic_lite/ui/theme_posix/BUILD.gn | 49 - graphic_lite/ui/theme_posix/Test.json | 25 - .../ui/theme_posix/src/theme_manager_test.cpp | 48 - .../ui/theme_posix/src/theme_test.cpp | 150 --- .../ui/ui_abstract_progress_posix/BUILD.gn | 46 - .../ui/ui_abstract_progress_posix/Test.json | 25 - .../src/ui_abstract_progress_test.cpp | 182 ---- .../ui/ui_analog_clock_posix/BUILD.gn | 46 - .../ui/ui_analog_clock_posix/Test.json | 25 - .../src/ui_analog_clock_test.cpp | 201 ---- graphic_lite/ui/ui_arc_lable_posix/BUILD.gn | 46 - graphic_lite/ui/ui_arc_lable_posix/Test.json | 25 - .../src/ui_arc_label_test.cpp | 160 --- graphic_lite/ui/ui_axis_posix/BUILD.gn | 46 - graphic_lite/ui/ui_axis_posix/Test.json | 25 - .../ui/ui_axis_posix/src/ui_axis_test.cpp | 97 -- .../ui/ui_box_porgress_posix/BUILD.gn | 46 - .../ui/ui_box_porgress_posix/Test.json | 25 - .../src/ui_box_progress_test.cpp | 214 ---- graphic_lite/ui/ui_button_posix/BUILD.gn | 46 - graphic_lite/ui/ui_button_posix/Test.json | 25 - .../ui/ui_button_posix/src/ui_button_test.cpp | 126 --- graphic_lite/ui/ui_canvas_posix/BUILD.gn | 46 - graphic_lite/ui/ui_canvas_posix/Test.json | 25 - .../ui/ui_canvas_posix/src/ui_canvas_test.cpp | 336 ------ graphic_lite/ui/ui_chart_posix/BUILD.gn | 46 - graphic_lite/ui/ui_chart_posix/Test.json | 25 - .../ui/ui_chart_posix/src/ui_chart_test.cpp | 617 ----------- graphic_lite/ui/ui_checbox_posix/BUILD.gn | 46 - graphic_lite/ui/ui_checbox_posix/Test.json | 25 - .../ui_checbox_posix/src/ui_checkbox_test.cpp | 83 -- .../ui/ui_circle_progress_posix/BUILD.gn | 46 - .../ui/ui_circle_progress_posix/Test.json | 25 - .../src/ui_circle_progress_test.cpp | 199 ---- .../ui/ui_digital_clock_posix/BUILD.gn | 46 - .../ui/ui_digital_clock_posix/Test.json | 25 - .../src/ui_digital_clock_test.cpp | 158 --- .../ui/ui_image_animator_posix/BUILD.gn | 46 - .../ui/ui_image_animator_posix/Test.json | 25 - .../src/ui_image_animator_test.cpp | 289 ------ graphic_lite/ui/ui_image_posix/BUILD.gn | 46 - graphic_lite/ui/ui_image_posix/Test.json | 25 - .../ui/ui_image_posix/src/ui_image_test.cpp | 209 ---- .../ui/ui_label_button_posix/BUILD.gn | 46 - .../ui/ui_label_button_posix/Test.json | 25 - .../src/ui_label_button_test.cpp | 143 --- graphic_lite/ui/ui_label_posix/BUILD.gn | 46 - graphic_lite/ui/ui_label_posix/Test.json | 25 - .../ui/ui_label_posix/src/ui_label_test.cpp | 196 ---- graphic_lite/ui/ui_list_posix/BUILD.gn | 46 - graphic_lite/ui/ui_list_posix/Test.json | 25 - .../ui/ui_list_posix/src/ui_list_test.cpp | 69 -- graphic_lite/ui/ui_picker_posix/BUILD.gn | 46 - graphic_lite/ui/ui_picker_posix/Test.json | 25 - .../ui/ui_picker_posix/src/ui_picker_test.cpp | 158 --- .../ui/ui_radio_button_posix/BUILD.gn | 46 - .../ui/ui_radio_button_posix/Test.json | 25 - .../src/ui_radio_button_test.cpp | 56 - .../ui/ui_repeat_button_posix/BUILD.gn | 46 - .../ui/ui_repeat_button_posix/Test.json | 25 - .../src/ui_repeat_button_test.cpp | 67 -- graphic_lite/ui/ui_screenshot_posix/BUILD.gn | 46 - graphic_lite/ui/ui_screenshot_posix/Test.json | 25 - .../src/ui_screenshot_test.cpp | 47 - graphic_lite/ui/ui_scroll_view_posix/BUILD.gn | 46 - .../ui/ui_scroll_view_posix/Test.json | 25 - .../src/ui_scroll_view_test.cpp | 158 --- graphic_lite/ui/ui_slider_posix/BUILD.gn | 46 - graphic_lite/ui/ui_slider_posix/Test.json | 25 - .../ui/ui_slider_posix/src/ui_slider_test.cpp | 68 -- .../ui/ui_surface_view_posix/BUILD.gn | 46 - .../ui/ui_surface_view_posix/Test.json | 25 - .../src/ui_surface_view_test.cpp | 135 --- graphic_lite/ui/ui_swipe_view_posix/BUILD.gn | 46 - graphic_lite/ui/ui_swipe_view_posix/Test.json | 25 - .../src/ui_swipe_view_test.cpp | 157 --- graphic_lite/ui/ui_text_posix/BUILD.gn | 46 - graphic_lite/ui/ui_text_posix/Test.json | 25 - .../ui/ui_text_posix/src/ui_text_test.cpp | 123 --- .../ui/ui_texture_mapper_posix/BUILD.gn | 46 - .../ui/ui_texture_mapper_posix/Test.json | 25 - .../src/ui_texture_mapper_test.cpp | 203 ---- graphic_lite/ui/ui_time_picker_posix/BUILD.gn | 46 - .../ui/ui_time_picker_posix/Test.json | 25 - .../src/ui_time_picker_test.cpp | 137 --- .../ui/ui_toggle_button_posix/BUILD.gn | 46 - .../ui/ui_toggle_button_posix/Test.json | 25 - .../src/ui_toggle_button_test.cpp | 61 -- graphic_lite/ui/ui_view_group_posix/BUILD.gn | 46 - graphic_lite/ui/ui_view_group_posix/Test.json | 25 - .../src/ui_view_group_test.cpp | 155 --- graphic_lite/ui/ui_view_posix/BUILD.gn | 49 - graphic_lite/ui/ui_view_posix/Test.json | 25 - .../ui/ui_view_posix/src/test_ui_view.cpp | 510 --------- .../ui/ui_view_posix/src/ui_view_test.cpp | 325 ------ graphic_lite/ui/uianimator_posix/BUILD.gn | 46 - graphic_lite/ui/uianimator_posix/Test.json | 25 - .../src/easing_equation_test.cpp | 74 -- graphic_lite/ui/uidfx_posix/BUILD.gn | 46 - graphic_lite/ui/uidfx_posix/Test.json | 25 - .../ui/uidfx_posix/src/dump_dom_tree_test.cpp | 604 ----------- graphic_lite/ui/uifont_posix/BUILD.gn | 46 - graphic_lite/ui/uifont_posix/Test.json | 25 - .../ui/uifont_posix/src/font_test.cpp | 320 ------ 192 files changed, 3 insertions(+), 16914 deletions(-) delete mode 100755 graphic_lite/graphic_utils/BUILD.gn delete mode 100755 graphic_lite/graphic_utils/a/BUILD.gn delete mode 100755 graphic_lite/graphic_utils/a/Test.json delete mode 100755 graphic_lite/graphic_utils/a/src/UiInterfaceTest.cpp delete mode 100755 graphic_lite/graphic_utils/a/src/UiInterfaceTest.h delete mode 100755 graphic_lite/graphic_utils/color_posix/BUILD.gn delete mode 100644 graphic_lite/graphic_utils/color_posix/Test.json delete mode 100755 graphic_lite/graphic_utils/color_posix/src/color_test.cpp delete mode 100755 graphic_lite/graphic_utils/geometry2d_posix/BUILD.gn delete mode 100644 graphic_lite/graphic_utils/geometry2d_posix/Test.json delete mode 100755 graphic_lite/graphic_utils/geometry2d_posix/src/geometry2d_test.cpp delete mode 100755 graphic_lite/graphic_utils/graphic_math_posix/BUILD.gn delete mode 100644 graphic_lite/graphic_utils/graphic_math_posix/Test.json delete mode 100755 graphic_lite/graphic_utils/graphic_math_posix/src/graphic_math_test.cpp delete mode 100755 graphic_lite/graphic_utils/heap_base_posix/BUILD.gn delete mode 100644 graphic_lite/graphic_utils/heap_base_posix/Test.json delete mode 100755 graphic_lite/graphic_utils/heap_base_posix/src/heap_base_test.cpp delete mode 100755 graphic_lite/graphic_utils/list_posix/BUILD.gn delete mode 100644 graphic_lite/graphic_utils/list_posix/Test.json delete mode 100755 graphic_lite/graphic_utils/list_posix/src/list_test.cpp delete mode 100755 graphic_lite/graphic_utils/mem_api_posix/BUILD.gn delete mode 100755 graphic_lite/graphic_utils/mem_api_posix/Test.json delete mode 100755 graphic_lite/graphic_utils/mem_api_posix/src/mem_api_test.cpp delete mode 100755 graphic_lite/graphic_utils/rect_posix/BUILD.gn delete mode 100644 graphic_lite/graphic_utils/rect_posix/Test.json delete mode 100755 graphic_lite/graphic_utils/rect_posix/src/rect_test.cpp delete mode 100755 graphic_lite/graphic_utils/sys_info_posix/BUILD.gn delete mode 100644 graphic_lite/graphic_utils/sys_info_posix/Test.json delete mode 100755 graphic_lite/graphic_utils/sys_info_posix/src/sys_info_test.cpp delete mode 100755 graphic_lite/graphic_utils/transform_posix/BUILD.gn delete mode 100644 graphic_lite/graphic_utils/transform_posix/Test.json delete mode 100755 graphic_lite/graphic_utils/transform_posix/src/transform_test.cpp delete mode 100755 graphic_lite/graphic_utils/version_posix/BUILD.gn delete mode 100755 graphic_lite/graphic_utils/version_posix/Test.json delete mode 100755 graphic_lite/graphic_utils/version_posix/src/version_test.cpp delete mode 100755 graphic_lite/surface/BUILD.gn delete mode 100755 graphic_lite/surface/surface_posix/BUILD.gn delete mode 100644 graphic_lite/surface/surface_posix/Test.json delete mode 100755 graphic_lite/surface/surface_posix/src/surface_surface_test.cpp delete mode 100755 graphic_lite/surface/surface_posix/src/surface_test.cpp delete mode 100755 graphic_lite/ui/BUILD.gn delete mode 100755 graphic_lite/ui/a/BUILD.gn delete mode 100755 graphic_lite/ui/a/Test.json delete mode 100755 graphic_lite/ui/a/src/UiInterfaceTest.cpp delete mode 100755 graphic_lite/ui/a/src/UiInterfaceTest.h delete mode 100644 graphic_lite/ui/a/src/window_test.cpp delete mode 100755 graphic_lite/ui/animator_posix/BUILD.gn delete mode 100644 graphic_lite/ui/animator_posix/Test.json delete mode 100755 graphic_lite/ui/animator_posix/src/animator_test.cpp delete mode 100755 graphic_lite/ui/easing_equation_posix/BUILD.gn delete mode 100644 graphic_lite/ui/easing_equation_posix/Test.json delete mode 100755 graphic_lite/ui/easing_equation_posix/src/test_easing_equation.cpp delete mode 100755 graphic_lite/ui/events_posix/BUILD.gn delete mode 100644 graphic_lite/ui/events_posix/Test.json delete mode 100755 graphic_lite/ui/events_posix/src/cancel_event_test.cpp delete mode 100755 graphic_lite/ui/events_posix/src/click_event_test.cpp delete mode 100755 graphic_lite/ui/events_posix/src/drag_event_test.cpp delete mode 100755 graphic_lite/ui/events_posix/src/event_test.cpp delete mode 100755 graphic_lite/ui/events_posix/src/key_event_test.cpp delete mode 100755 graphic_lite/ui/events_posix/src/long_press_event_test.cpp delete mode 100755 graphic_lite/ui/events_posix/src/press_event_test.cpp delete mode 100755 graphic_lite/ui/events_posix/src/release_event_test.cpp delete mode 100755 graphic_lite/ui/events_posix/src/virtual_device_event_test.cpp delete mode 100755 graphic_lite/ui/flexlayout_posix/BUILD.gn delete mode 100644 graphic_lite/ui/flexlayout_posix/Test.json delete mode 100755 graphic_lite/ui/flexlayout_posix/src/test_flex_layout.cpp delete mode 100755 graphic_lite/ui/gridlayout_posix/BUILD.gn delete mode 100644 graphic_lite/ui/gridlayout_posix/Test.json delete mode 100755 graphic_lite/ui/gridlayout_posix/src/test_grid_layout.cpp delete mode 100755 graphic_lite/ui/image_posix/BUILD.gn delete mode 100644 graphic_lite/ui/image_posix/Test.json delete mode 100755 graphic_lite/ui/image_posix/src/image_test.cpp delete mode 100755 graphic_lite/ui/interpolation_posix/BUILD.gn delete mode 100644 graphic_lite/ui/interpolation_posix/Test.json delete mode 100755 graphic_lite/ui/interpolation_posix/src/interpolation_test.cpp delete mode 100755 graphic_lite/ui/layout_posix/BUILD.gn delete mode 100644 graphic_lite/ui/layout_posix/Test.json delete mode 100755 graphic_lite/ui/layout_posix/src/test_layout.cpp delete mode 100755 graphic_lite/ui/listlayout_posix/BUILD.gn delete mode 100644 graphic_lite/ui/listlayout_posix/Test.json delete mode 100755 graphic_lite/ui/listlayout_posix/src/list_layout_test.cpp delete mode 100755 graphic_lite/ui/screen_posix/BUILD.gn delete mode 100644 graphic_lite/ui/screen_posix/Test.json delete mode 100755 graphic_lite/ui/screen_posix/src/screen_test.cpp delete mode 100755 graphic_lite/ui/style_posix/BUILD.gn delete mode 100644 graphic_lite/ui/style_posix/Test.json delete mode 100755 graphic_lite/ui/style_posix/src/style_test.cpp delete mode 100755 graphic_lite/ui/theme_posix/BUILD.gn delete mode 100644 graphic_lite/ui/theme_posix/Test.json delete mode 100755 graphic_lite/ui/theme_posix/src/theme_manager_test.cpp delete mode 100755 graphic_lite/ui/theme_posix/src/theme_test.cpp delete mode 100755 graphic_lite/ui/ui_abstract_progress_posix/BUILD.gn delete mode 100644 graphic_lite/ui/ui_abstract_progress_posix/Test.json delete mode 100755 graphic_lite/ui/ui_abstract_progress_posix/src/ui_abstract_progress_test.cpp delete mode 100755 graphic_lite/ui/ui_analog_clock_posix/BUILD.gn delete mode 100644 graphic_lite/ui/ui_analog_clock_posix/Test.json delete mode 100755 graphic_lite/ui/ui_analog_clock_posix/src/ui_analog_clock_test.cpp delete mode 100755 graphic_lite/ui/ui_arc_lable_posix/BUILD.gn delete mode 100644 graphic_lite/ui/ui_arc_lable_posix/Test.json delete mode 100755 graphic_lite/ui/ui_arc_lable_posix/src/ui_arc_label_test.cpp delete mode 100755 graphic_lite/ui/ui_axis_posix/BUILD.gn delete mode 100644 graphic_lite/ui/ui_axis_posix/Test.json delete mode 100755 graphic_lite/ui/ui_axis_posix/src/ui_axis_test.cpp delete mode 100755 graphic_lite/ui/ui_box_porgress_posix/BUILD.gn delete mode 100644 graphic_lite/ui/ui_box_porgress_posix/Test.json delete mode 100755 graphic_lite/ui/ui_box_porgress_posix/src/ui_box_progress_test.cpp delete mode 100755 graphic_lite/ui/ui_button_posix/BUILD.gn delete mode 100644 graphic_lite/ui/ui_button_posix/Test.json delete mode 100755 graphic_lite/ui/ui_button_posix/src/ui_button_test.cpp delete mode 100755 graphic_lite/ui/ui_canvas_posix/BUILD.gn delete mode 100644 graphic_lite/ui/ui_canvas_posix/Test.json delete mode 100755 graphic_lite/ui/ui_canvas_posix/src/ui_canvas_test.cpp delete mode 100755 graphic_lite/ui/ui_chart_posix/BUILD.gn delete mode 100644 graphic_lite/ui/ui_chart_posix/Test.json delete mode 100755 graphic_lite/ui/ui_chart_posix/src/ui_chart_test.cpp delete mode 100755 graphic_lite/ui/ui_checbox_posix/BUILD.gn delete mode 100644 graphic_lite/ui/ui_checbox_posix/Test.json delete mode 100755 graphic_lite/ui/ui_checbox_posix/src/ui_checkbox_test.cpp delete mode 100755 graphic_lite/ui/ui_circle_progress_posix/BUILD.gn delete mode 100644 graphic_lite/ui/ui_circle_progress_posix/Test.json delete mode 100755 graphic_lite/ui/ui_circle_progress_posix/src/ui_circle_progress_test.cpp delete mode 100755 graphic_lite/ui/ui_digital_clock_posix/BUILD.gn delete mode 100644 graphic_lite/ui/ui_digital_clock_posix/Test.json delete mode 100755 graphic_lite/ui/ui_digital_clock_posix/src/ui_digital_clock_test.cpp delete mode 100755 graphic_lite/ui/ui_image_animator_posix/BUILD.gn delete mode 100644 graphic_lite/ui/ui_image_animator_posix/Test.json delete mode 100755 graphic_lite/ui/ui_image_animator_posix/src/ui_image_animator_test.cpp delete mode 100755 graphic_lite/ui/ui_image_posix/BUILD.gn delete mode 100644 graphic_lite/ui/ui_image_posix/Test.json delete mode 100755 graphic_lite/ui/ui_image_posix/src/ui_image_test.cpp delete mode 100755 graphic_lite/ui/ui_label_button_posix/BUILD.gn delete mode 100644 graphic_lite/ui/ui_label_button_posix/Test.json delete mode 100755 graphic_lite/ui/ui_label_button_posix/src/ui_label_button_test.cpp delete mode 100755 graphic_lite/ui/ui_label_posix/BUILD.gn delete mode 100644 graphic_lite/ui/ui_label_posix/Test.json delete mode 100755 graphic_lite/ui/ui_label_posix/src/ui_label_test.cpp delete mode 100755 graphic_lite/ui/ui_list_posix/BUILD.gn delete mode 100644 graphic_lite/ui/ui_list_posix/Test.json delete mode 100755 graphic_lite/ui/ui_list_posix/src/ui_list_test.cpp delete mode 100755 graphic_lite/ui/ui_picker_posix/BUILD.gn delete mode 100644 graphic_lite/ui/ui_picker_posix/Test.json delete mode 100755 graphic_lite/ui/ui_picker_posix/src/ui_picker_test.cpp delete mode 100755 graphic_lite/ui/ui_radio_button_posix/BUILD.gn delete mode 100644 graphic_lite/ui/ui_radio_button_posix/Test.json delete mode 100755 graphic_lite/ui/ui_radio_button_posix/src/ui_radio_button_test.cpp delete mode 100755 graphic_lite/ui/ui_repeat_button_posix/BUILD.gn delete mode 100644 graphic_lite/ui/ui_repeat_button_posix/Test.json delete mode 100755 graphic_lite/ui/ui_repeat_button_posix/src/ui_repeat_button_test.cpp delete mode 100755 graphic_lite/ui/ui_screenshot_posix/BUILD.gn delete mode 100644 graphic_lite/ui/ui_screenshot_posix/Test.json delete mode 100755 graphic_lite/ui/ui_screenshot_posix/src/ui_screenshot_test.cpp delete mode 100755 graphic_lite/ui/ui_scroll_view_posix/BUILD.gn delete mode 100644 graphic_lite/ui/ui_scroll_view_posix/Test.json delete mode 100755 graphic_lite/ui/ui_scroll_view_posix/src/ui_scroll_view_test.cpp delete mode 100755 graphic_lite/ui/ui_slider_posix/BUILD.gn delete mode 100644 graphic_lite/ui/ui_slider_posix/Test.json delete mode 100755 graphic_lite/ui/ui_slider_posix/src/ui_slider_test.cpp delete mode 100755 graphic_lite/ui/ui_surface_view_posix/BUILD.gn delete mode 100644 graphic_lite/ui/ui_surface_view_posix/Test.json delete mode 100755 graphic_lite/ui/ui_surface_view_posix/src/ui_surface_view_test.cpp delete mode 100755 graphic_lite/ui/ui_swipe_view_posix/BUILD.gn delete mode 100644 graphic_lite/ui/ui_swipe_view_posix/Test.json delete mode 100755 graphic_lite/ui/ui_swipe_view_posix/src/ui_swipe_view_test.cpp delete mode 100755 graphic_lite/ui/ui_text_posix/BUILD.gn delete mode 100644 graphic_lite/ui/ui_text_posix/Test.json delete mode 100755 graphic_lite/ui/ui_text_posix/src/ui_text_test.cpp delete mode 100755 graphic_lite/ui/ui_texture_mapper_posix/BUILD.gn delete mode 100644 graphic_lite/ui/ui_texture_mapper_posix/Test.json delete mode 100755 graphic_lite/ui/ui_texture_mapper_posix/src/ui_texture_mapper_test.cpp delete mode 100755 graphic_lite/ui/ui_time_picker_posix/BUILD.gn delete mode 100644 graphic_lite/ui/ui_time_picker_posix/Test.json delete mode 100755 graphic_lite/ui/ui_time_picker_posix/src/ui_time_picker_test.cpp delete mode 100755 graphic_lite/ui/ui_toggle_button_posix/BUILD.gn delete mode 100644 graphic_lite/ui/ui_toggle_button_posix/Test.json delete mode 100755 graphic_lite/ui/ui_toggle_button_posix/src/ui_toggle_button_test.cpp delete mode 100755 graphic_lite/ui/ui_view_group_posix/BUILD.gn delete mode 100644 graphic_lite/ui/ui_view_group_posix/Test.json delete mode 100755 graphic_lite/ui/ui_view_group_posix/src/ui_view_group_test.cpp delete mode 100755 graphic_lite/ui/ui_view_posix/BUILD.gn delete mode 100644 graphic_lite/ui/ui_view_posix/Test.json delete mode 100755 graphic_lite/ui/ui_view_posix/src/test_ui_view.cpp delete mode 100755 graphic_lite/ui/ui_view_posix/src/ui_view_test.cpp delete mode 100755 graphic_lite/ui/uianimator_posix/BUILD.gn delete mode 100644 graphic_lite/ui/uianimator_posix/Test.json delete mode 100755 graphic_lite/ui/uianimator_posix/src/easing_equation_test.cpp delete mode 100755 graphic_lite/ui/uidfx_posix/BUILD.gn delete mode 100644 graphic_lite/ui/uidfx_posix/Test.json delete mode 100755 graphic_lite/ui/uidfx_posix/src/dump_dom_tree_test.cpp delete mode 100755 graphic_lite/ui/uifont_posix/BUILD.gn delete mode 100644 graphic_lite/ui/uifont_posix/Test.json delete mode 100755 graphic_lite/ui/uifont_posix/src/font_test.cpp diff --git a/build_lite/BUILD.gn b/build_lite/BUILD.gn index 02d9254e4..c358d7094 100644 --- a/build_lite/BUILD.gn +++ b/build_lite/BUILD.gn @@ -63,9 +63,9 @@ lite_component("acts_component") { "//test/xts/acts/hiviewdfx_lite/hilog_posix:ActsHilogTest", "//test/xts/acts/multimedia_lite/media_lite_posix/recorder_native:ActsMediaRecorderTest", - "//test/xts/acts/graphic_lite/graphic_utils:uikit_test1", - "//test/xts/acts/graphic_lite/surface:uikit_test2", - "//test/xts/acts/graphic_lite/ui:uikit_test3", + #"//test/xts/acts/graphic_lite/graphic_utils:uikit_test1", + #"//test/xts/acts/graphic_lite/surface:uikit_test2", + #"//test/xts/acts/graphic_lite/ui:uikit_test3", "//test/xts/acts/appexecfwk_lite/bundle_mgr_posix:ActsBundleMgrTest", "//test/xts/acts/aafwk_lite/ability_posix:ActsAbilityMgrTest", "//test/xts/acts/communication_lite/lwip_posix:ActsLwipTest", diff --git a/graphic_lite/graphic_utils/BUILD.gn b/graphic_lite/graphic_utils/BUILD.gn deleted file mode 100755 index 24cf458c0..000000000 --- a/graphic_lite/graphic_utils/BUILD.gn +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -group("uikit_test1") { - deps = [ - "//test/xts/acts/graphic_lite/graphic_utils/a:ActsGraphicInterfaceTest", - "//test/xts/acts/graphic_lite/graphic_utils/color_posix:ActsColorTest", - "//test/xts/acts/graphic_lite/graphic_utils/geometry2d_posix:ActsGeometyr2dTest", - "//test/xts/acts/graphic_lite/graphic_utils/graphic_math_posix:ActsGraphicMathTest", - "//test/xts/acts/graphic_lite/graphic_utils/heap_base_posix:ActsHeapBaseTest", - "//test/xts/acts/graphic_lite/graphic_utils/list_posix:ActsListTest", - "//test/xts/acts/graphic_lite/graphic_utils/mem_api_posix:ActsGraphMemApiTest", - "//test/xts/acts/graphic_lite/graphic_utils/rect_posix:ActsRectTest", - - #"//test/xts/acts/graphic_lite/graphic_utils/sys_info_posix:ActsSysInfoTest", - "//test/xts/acts/graphic_lite/graphic_utils/transform_posix:ActsTransformTest", - "//test/xts/acts/graphic_lite/graphic_utils/version_posix:ActsGraphVersionTest", - ] -} diff --git a/graphic_lite/graphic_utils/a/BUILD.gn b/graphic_lite/graphic_utils/a/BUILD.gn deleted file mode 100755 index c333a3142..000000000 --- a/graphic_lite/graphic_utils/a/BUILD.gn +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build/lite/config/component/lite_component.gni") -import("//build/lite/config/subsystem/graphic/config.gni") -import("//build/lite/ndk/ndk.gni") -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsGraphicInterfaceTest") { - suite_name = "acts" - if (enable_graphic_font) { - sources = [ - "src/UiInterfaceTest.cpp", - ] - } else { - sources = [ "src/UiInterfaceTest.cpp" ] - } - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/graphic_utils/a/Test.json b/graphic_lite/graphic_utils/a/Test.json deleted file mode 100755 index 0437d3bc5..000000000 --- a/graphic_lite/graphic_utils/a/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "ui interface coverage filled", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsGraphicInterfaceTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/graphic_utils/a/src/UiInterfaceTest.cpp b/graphic_lite/graphic_utils/a/src/UiInterfaceTest.cpp deleted file mode 100755 index 9f8ad9f03..000000000 --- a/graphic_lite/graphic_utils/a/src/UiInterfaceTest.cpp +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "UiInterfaceTest.h" - -#include "common/graphic_startup.h" -#include "components/root_view.h" -#include "components/text_adapter.h" -#include "components/ui_abstract_clock.h" -#include "components/ui_analog_clock.h" -#include "components/ui_axis.h" -#include "components/ui_button.h" -#include "components/ui_canvas.h" -#include "components/ui_checkbox.h" -#include "components/ui_image_animator.h" -#include "components/ui_scroll_view.h" -#include "components/ui_swipe_view.h" -#include "components/ui_time_picker.h" -#include "components/ui_view.h" -#include "components/ui_view_group.h" -#include "dfx/event_injector.h" -#include "dfx/ui_screenshot.h" -#include "events/aod_callback.h" -#include "events/press_event.h" -#include "events/virtual_device_event.h" -#include "gfx_utils/graphic_math.h" -#include "themes/theme_manager.h" -#include "window/window.h" - -#include -#include - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class UiInterfaceTest : public testing::Test { -public: - static void SetUpTestCase(void){} - static void TearDownTestCase(void){} -}; - -class TestListener : public OHOS::UICheckBox::OnChangeListener { -public: - bool OnChange(UICheckBox::UICheckBoxState state) override - { - return true; - } -}; - -class TestAnimatorCallback : public AnimatorCallback { -public: - TestAnimatorCallback() {} - - ~TestAnimatorCallback() {} - - void Callback(UIView* view) override {} -}; - -class Font { -public: - void SetDynamicFontId() const {}; - void SetAnimatorSpeed() const {}; - void GetLongMode() const {}; - void Scal() const {}; - void Itoa() const {}; - void GetCrossPoint() const {}; - void IsLineSegmentCross() const {}; - void IsRectCross() const {}; - void SetOnChangeListener() const {}; - void SetLineAndTextOpacity() const {}; - void OnClickEventHappen() const {}; -}; - -class KeyActListener { -public: - void OnDragEndEventHappen() const {}; - void OnLongPressEventHappen() const {}; - void OnFPSChangedListener() const {}; - void OnFPSChanged() const {}; - void GetFPS() const {}; - void RegisterFPSChangedListener() const {}; - void CreateSurface() const {}; - void GetQueueSize() const {}; - void RegisterConsumerListener() const {}; - void UnregisterConsumerListener() const {}; - void GetInt64() const {}; - void GetSurface() const {}; - void OnKeyAct() const {}; - void OnKeyEvent() const {}; - void SetOnKeyActListener() const {}; - void ClearOnKeyActListener() const {}; -}; - -class RootViewManage { -public: - void OnVirtualDeviceEvent() const {}; - void SetOnVirtualDeviceEventListener() const {}; - void ClearOnVirtualDeviceEventListener() const {}; - void EnableCursor() const {}; - void GetCursor() const {}; - void DrawTop() const {}; - void GetTopUIView() const {}; - void FindSubView() const {}; - void SetFilePath() const {}; -}; -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_3200 - * @tc.name test GetBoxRect api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_3200, Function | MediumTest | Level0) -{ - TransformMap* transformMap = new TransformMap(); - transformMap->GetBoxRect(); - EXPECT_EQ(0, 0); - delete transformMap; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_3300 - * @tc.name test GetPolygon api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_3300, Function | MediumTest | Level0) -{ - TransformMap* transformMap = new TransformMap(); - transformMap->GetPolygon(); - EXPECT_EQ(0, 0); - delete transformMap; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_3400 - * @tc.name test Translate api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_3400, Function | MediumTest | Level0) -{ - Matrix3* matrix3 = new Matrix3(); - Vector2* vector2 = new Vector2(); - matrix3->Translate(*vector2); - EXPECT_EQ(0, 0); - delete vector2; - delete matrix3; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_3500 - * @tc.name test IsExtends api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_3500, Function | MediumTest | Level0) -{ - Rect* rect = new Rect(); - rect->IsExtends(*rect); - EXPECT_EQ(0, 0); - delete rect; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_3600 - * @tc.name test ColorTo16 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_3600, Function | MediumTest | Level0) -{ - Color* color = new Color(); - Color32* ret = new Color32(); - color->ColorTo16(*ret); - EXPECT_EQ(0, 0); - delete ret; - delete color; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_3700 - * @tc.name test ColorTo32 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_3700, Function | MediumTest | Level0) -{ - Color* color = new Color(); - ColorType* colorType = new ColorType(); - color->ColorTo32(*colorType); - EXPECT_EQ(0, 0); - delete colorType; - delete color; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_7600 - * @tc.name test new api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_7600, Function | MediumTest | Level0) -{ - delete(operator new(10)); - EXPECT_EQ(0, 0); -} -} // namespace OHOS diff --git a/graphic_lite/graphic_utils/a/src/UiInterfaceTest.h b/graphic_lite/graphic_utils/a/src/UiInterfaceTest.h deleted file mode 100755 index 695c3f5ef..000000000 --- a/graphic_lite/graphic_utils/a/src/UiInterfaceTest.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef XTS_HITS_UI_INTERFACE_API_EXPECT_H -#define XTS_HITS_UI_INTERFACE_API_EXPECT_H - -#endif \ No newline at end of file diff --git a/graphic_lite/graphic_utils/color_posix/BUILD.gn b/graphic_lite/graphic_utils/color_posix/BUILD.gn deleted file mode 100755 index fde8d65c5..000000000 --- a/graphic_lite/graphic_utils/color_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsColorTest") { - suite_name = "acts" - sources = [ "src/color_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/graphic_utils/color_posix/Test.json b/graphic_lite/graphic_utils/color_posix/Test.json deleted file mode 100644 index 58edba664..000000000 --- a/graphic_lite/graphic_utils/color_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsColorTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/graphic_utils/color_posix/src/color_test.cpp b/graphic_lite/graphic_utils/color_posix/src/color_test.cpp deleted file mode 100755 index c3739c19c..000000000 --- a/graphic_lite/graphic_utils/color_posix/src/color_test.cpp +++ /dev/null @@ -1,390 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "gfx_utils/color.h" - -#include -#include - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class ColorTest : public testing::Test { -public: - static void SetUpTestCase(void); - static void TearDownTestCase(void); - static Color* color; -}; -Color* ColorTest::color = nullptr; - -void ColorTest::SetUpTestCase(void) -{ - return; -} - -void ColorTest::TearDownTestCase(void) -{ - return; -} - -/** - * @tc.number SUB_GRAPHIC_COLOR_GETCOLORFROMRGB_0100 - * @tc.name test color get-color-from-RGB api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ColorTest, Graphic_Color_Test_GetColorFromRGB_0100, Function | MediumTest | Level0) -{ - EXPECT_EQ(Color::GetColorFromRGB(0, 0, 0).red, 0); - EXPECT_EQ(Color::GetColorFromRGB(0, 0, 0).green, 0); - EXPECT_EQ(Color::GetColorFromRGB(0, 0, 0).blue, 0); - EXPECT_EQ(Color::GetColorFromRGB(0, 0, 0).alpha, 0xFF); -} - -/** - * @tc.number SUB_GRAPHIC_COLOR_GETCOLORFROMRGBA_0200 - * @tc.name test color get-color-from-RGBA api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ColorTest, Graphic_Color_Test_GetColorFromRGBA_0200, Function | MediumTest | Level0) -{ - EXPECT_EQ(Color::GetColorFromRGBA(0, 0, 0, 0).red, 0); - EXPECT_EQ(Color::GetColorFromRGBA(0, 0, 0, 0).green, 0); - EXPECT_EQ(Color::GetColorFromRGBA(0, 0, 0, 0).blue, 0); - EXPECT_EQ(Color::GetColorFromRGBA(0, 0, 0, 0).alpha, 0); -} - -/** - * @tc.number SUB_GRAPHIC_COLOR_COLORTO32_0300 - * @tc.name test color color-to-32 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ColorTest, Graphic_Color_Test_ColorTo32_0300, Function | MediumTest | Level0) -{ - ColorType color; - color.red = 0; - color.green = 0; - color.blue = 0; - color.alpha = 0; - uint32_t color32 = 0; - - EXPECT_EQ(Color::ColorTo32(color), color32); -} - -/** - * @tc.number SUB_GRAPHIC_COLOR_COLORTO32_0400 - * @tc.name test color color-to-32-2 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ColorTest, Graphic_Color_Test_ColorTo32_0400, Function | MediumTest | Level0) -{ - Color16 color; - color.red = 0; - color.green = 0; - color.blue = 0; - - EXPECT_EQ(Color::ColorTo32(color, 0), 0); -} - -/** - * @tc.number SUB_GRAPHIC_COLOR_COLORTO16_0500 - * @tc.name test color color-to-16 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ColorTest, Graphic_Color_Test_ColorTo16_0500, Function | MediumTest | Level0) -{ - Color32 color32; - color32.red = 0; - color32.green = 0; - color32.blue = 0; - - EXPECT_EQ(Color::ColorTo16(color32), 0); -} - -/** - * @tc.number SUB_GRAPHIC_COLOR_WHITE_0600 - * @tc.name test color white api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ColorTest, Graphic_Color_Test_White_0600, Function | MediumTest | Level0) -{ - ColorType white = Color::White(); - - EXPECT_EQ(white.red, 0xFF); - EXPECT_EQ(white.green, 0xFF); - EXPECT_EQ(white.blue, 0xFF); -} - -/** - * @tc.number SUB_GRAPHIC_COLOR_SILVER_0700 - * @tc.name test color silver api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ColorTest, Graphic_Color_Test_Silver_0700, Function | MediumTest | Level0) -{ - ColorType silver = Color::Silver(); - - EXPECT_EQ(silver.red, 0xC0); - EXPECT_EQ(silver.green, 0xC0); - EXPECT_EQ(silver.blue, 0xC0); -} - -/** - * @tc.number SUB_GRAPHIC_COLOR_GRAY_0800 - * @tc.name test color gray api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ColorTest, Graphic_Color_Test_Gray_0800, Function | MediumTest | Level0) -{ - ColorType gray = Color::Gray(); - - EXPECT_EQ(gray.red, 0x80); - EXPECT_EQ(gray.green, 0x80); - EXPECT_EQ(gray.blue, 0x80); -} - -/** - * @tc.number SUB_GRAPHIC_COLOR_BLACK_0900 - * @tc.name test color black api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ColorTest, Graphic_Color_Test_Black_0900, Function | MediumTest | Level0) -{ - ColorType black = Color::Black(); - - EXPECT_EQ(black.red, 0x00); - EXPECT_EQ(black.green, 0x00); - EXPECT_EQ(black.blue, 0x00); -} - -/** - * @tc.number SUB_GRAPHIC_COLOR_RED_1000 - * @tc.name test color red api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ColorTest, Graphic_Color_Test_Red_1000, Function | MediumTest | Level0) -{ - ColorType red = Color::Red(); - - EXPECT_EQ(red.red, 0xFF); - EXPECT_EQ(red.green, 0x00); - EXPECT_EQ(red.blue, 0x00); -} - -/** - * @tc.number SUB_GRAPHIC_COLOR_MAROON_1100 - * @tc.name test color maroon api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ColorTest, Graphic_Color_Test_Maroon_1100, Function | MediumTest | Level0) -{ - ColorType maroon = Color::Maroon(); - - EXPECT_EQ(maroon.red, 0x80); - EXPECT_EQ(maroon.green, 0x00); - EXPECT_EQ(maroon.blue, 0x00); -} - -/** - * @tc.number SUB_GRAPHIC_COLOR_YELLOW_1200 - * @tc.name test color yellow api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ColorTest, Graphic_Color_Test_Yellow_1200, Function | MediumTest | Level0) -{ - ColorType yellow = Color::Yellow(); - - EXPECT_EQ(yellow.red, 0xFF); - EXPECT_EQ(yellow.green, 0xFF); - EXPECT_EQ(yellow.blue, 0x00); -} - -/** - * @tc.number SUB_GRAPHIC_COLOR_OLIVE_1300 - * @tc.name test color olive api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ColorTest, Graphic_Color_Test_Olive_1300, Function | MediumTest | Level0) -{ - ColorType olive = Color::Olive(); - - EXPECT_EQ(olive.red, 0x80); - EXPECT_EQ(olive.green, 0x80); - EXPECT_EQ(olive.blue, 0x00); -} - -/** - * @tc.number SUB_GRAPHIC_COLOR_LIME_1400 - * @tc.name test color lime api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ColorTest, Graphic_Color_Test_Lime_1400, Function | MediumTest | Level0) -{ - ColorType lime = Color::Lime(); - - EXPECT_EQ(lime.red, 0x00); - EXPECT_EQ(lime.green, 0xFF); - EXPECT_EQ(lime.blue, 0x00); -} - -/** - * @tc.number SUB_GRAPHIC_COLOR_GREEN_1500 - * @tc.name test color GREEN api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ColorTest, Graphic_Color_Test_Green_1500, Function | MediumTest | Level0) -{ - ColorType green = Color::Green(); - - EXPECT_EQ(green.red, 0x00); - EXPECT_EQ(green.green, 0xFF); - EXPECT_EQ(green.blue, 0x00); -} - -/** - * @tc.number SUB_GRAPHIC_COLOR_CYAN_1600 - * @tc.name test color CYAN api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ColorTest, Graphic_Color_Test_Cyan_1600, Function | MediumTest | Level0) -{ - ColorType cyan = Color::Cyan(); - - EXPECT_EQ(cyan.red, 0x00); - EXPECT_EQ(cyan.green, 0xFF); - EXPECT_EQ(cyan.blue, 0xFF); -} - -/** - * @tc.number SUB_GRAPHIC_COLOR_AQUA_1700 - * @tc.name test color aqua api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ColorTest, Graphic_Color_Test_Aqua_1700, Function | MediumTest | Level0) -{ - ColorType aqua = Color::Aqua(); - - EXPECT_EQ(aqua.red, 0x00); - EXPECT_EQ(aqua.green, 0xFF); - EXPECT_EQ(aqua.blue, 0xFF); -} - -/** - * @tc.number SUB_GRAPHIC_COLOR_TEAL_1800 - * @tc.name test color teal api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ColorTest, Graphic_Color_Test_Teal_1800, Function | MediumTest | Level0) -{ - ColorType teal = Color::Teal(); - - EXPECT_EQ(teal.red, 0x00); - EXPECT_EQ(teal.green, 0x80); - EXPECT_EQ(teal.blue, 0x80); -} - -/** - * @tc.number SUB_GRAPHIC_COLOR_BLUE_1900 - * @tc.name test color blue api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ColorTest, Graphic_Color_Test_Blue_1900, Function | MediumTest | Level0) -{ - ColorType blue = Color::Blue(); - - EXPECT_EQ(blue.red, 0x00); - EXPECT_EQ(blue.green, 0x00); - EXPECT_EQ(blue.blue, 0xFF); -} - -/** - * @tc.number SUB_GRAPHIC_COLOR_NAVY_2000 - * @tc.name test color navy api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ColorTest, Graphic_Color_Test_Navy_2000, Function | MediumTest | Level0) -{ - ColorType navy = Color::Navy(); - - EXPECT_EQ(navy.red, 0x00); - EXPECT_EQ(navy.green, 0x00); - EXPECT_EQ(navy.blue, 0x80); -} - -/** - * @tc.number SUB_GRAPHIC_COLOR_MAGENTA_2100 - * @tc.name test color magenta api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ColorTest, Graphic_Color_Test_Magenta_2100, Function | MediumTest | Level0) -{ - ColorType magenta = Color::Magenta(); - - EXPECT_EQ(magenta.red, 0xFF); - EXPECT_EQ(magenta.green, 0x00); - EXPECT_EQ(magenta.blue, 0xFF); -} - -/** - * @tc.number SUB_GRAPHIC_COLOR_PURPLE_2200 - * @tc.name test color purple api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ColorTest, Graphic_Color_Test_Purple_2200, Function | MediumTest | Level0) -{ - ColorType purple = Color::Purple(); - - EXPECT_EQ(purple.red, 0x80); - EXPECT_EQ(purple.green, 0x00); - EXPECT_EQ(purple.blue, 0x80); -} - -/** - * @tc.number SUB_GRAPHIC_COLOR_ORANGE_2300 - * @tc.name test color orange api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ColorTest, Graphic_Color_Test_Orange_2300, Function | MediumTest | Level0) -{ - ColorType orange = Color::Orange(); - - EXPECT_EQ(orange.red, 0xFF); - EXPECT_EQ(orange.green, 0xA5); - EXPECT_EQ(orange.blue, 0x00); -} - -/** - * @tc.number SUB_GRAPHIC_COLOR_GETMIXCOLOR_2400 - * @tc.name test color getmixcolor api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ColorTest, Graphic_Color_Test_GetMixColor_2400, Function | MediumTest | Level0) -{ - ColorType c1; - c1.red = 0; - c1.green = 0; - c1.blue = 0; - ColorType c2; - c2.red = 0; - c2.green = 0; - c2.blue = 0; - uint8_t mix = 0; - ColorType ret = Color::GetMixColor(c1, c2, mix); - - EXPECT_EQ(ret.red, 0); - EXPECT_EQ(ret.green, 0); - EXPECT_EQ(ret.blue, 0); - EXPECT_EQ(ret.alpha, 0xFF); -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/graphic_utils/geometry2d_posix/BUILD.gn b/graphic_lite/graphic_utils/geometry2d_posix/BUILD.gn deleted file mode 100755 index 9c5344d9c..000000000 --- a/graphic_lite/graphic_utils/geometry2d_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsGeometyr2dTest") { - suite_name = "acts" - sources = [ "src/geometry2d_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/graphic_utils/geometry2d_posix/Test.json b/graphic_lite/graphic_utils/geometry2d_posix/Test.json deleted file mode 100644 index 01c99c7f4..000000000 --- a/graphic_lite/graphic_utils/geometry2d_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsGeometyr2dTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/graphic_utils/geometry2d_posix/src/geometry2d_test.cpp b/graphic_lite/graphic_utils/geometry2d_posix/src/geometry2d_test.cpp deleted file mode 100755 index e95265215..000000000 --- a/graphic_lite/graphic_utils/geometry2d_posix/src/geometry2d_test.cpp +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "gfx_utils/geometry2d.h" -#include -#include - -using namespace std; -using namespace testing::ext; - -namespace OHOS { -class Geometry2dTest : public testing::Test { -public: - static void SetUpTestCase(void); - static void TearDownTestCase(void); -}; - -void Geometry2dTest::SetUpTestCase() -{ - return; -} - -void Geometry2dTest::TearDownTestCase() -{ - return; -} - -/** - * @tc.number SUB_GRAPHIC_GEOMETRY2D_LINE_OPERATOR_0100 - * @tc.name test line of geometry2d operator api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(Geometry2dTest, Graphic_Line_Test_operator_0100, Function | MediumTest | Level0) -{ - Vector2 pt1 = { 100, 200 }; - Vector2 pt2 = { 300, 400 }; - Line* line = new Line(pt1, pt2); - - EXPECT_EQ(line->operator[](0).x_, 100); - EXPECT_EQ(line->operator[](0).y_, 200); - EXPECT_EQ(line->operator[](1).x_, 300); - EXPECT_EQ(line->operator[](1).y_, 400); - delete line; - - line = new Line(100, 200, 300, 400); - - EXPECT_EQ(line->operator[](0).x_, 100); - EXPECT_EQ(line->operator[](0).y_, 200); - EXPECT_EQ(line->operator[](1).x_, 300); - EXPECT_EQ(line->operator[](1).y_, 400); - delete line; -} - -/** - * @tc.number SUB_GRAPHIC_GEOMETRY2D_POLYGON_MAKEAABB_0200 - * @tc.name test polygon of geometry2d makeAABB api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(Geometry2dTest, Graphic_Polygon_Test_MakeAABB_0200, Function | MediumTest | Level0) -{ - Vector2 vertexes[4] = { {0, 0}, {500, 100}, {300, 500}, {100, 300} }; - Polygon* polygon = new Polygon(vertexes, 4); - Rect rect = polygon->MakeAABB(); - - EXPECT_EQ(rect.GetLeft(), 0); - EXPECT_EQ(rect.GetTop(), 0); - EXPECT_EQ(rect.GetRight(), 500); - EXPECT_EQ(rect.GetBottom(), 500); - delete polygon; -} - -/** - * @tc.number SUB_GRAPHIC_GEOMETRY2D_POLYGON_GETVERTEXNUM_0300 - * @tc.name test polygon of geometry2d get-vertexNum api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(Geometry2dTest, Graphic_Polygon_Test_GetVertexNum_0300, Function | MediumTest | Level0) -{ - Vector2 vertexes[4] = { { 0, 0 }, { 500, 100 }, { 300, 500 }, { 100, 300 } }; - Polygon* polygon = new Polygon(vertexes, 4); - - EXPECT_EQ(polygon->GetVertexNum(), 4); - delete polygon; -} - -/** - * @tc.number SUB_GRAPHIC_GEOMETRY2D_POLYGON_SETVERTEXNUM_0400 - * @tc.name test polygon of geometry2d set-vertexNum api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(Geometry2dTest, Graphic_Polygon_Test_SetVertexNum_0400, Function | MediumTest | Level0) -{ - Polygon* polygon = new Polygon(); - polygon->SetVertexNum(8); - - EXPECT_EQ(polygon->GetVertexNum(), 8); - delete polygon; -} - -/** - * @tc.number SUB_GRAPHIC_GEOMETRY2D_POLYGON_OPERATOR_0500 - * @tc.name test polygon of geometry2d operator api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(Geometry2dTest, Graphic_Polygon_Test_operator_0500, Function | MediumTest | Level0) -{ - Vector2 vertexes[4] = { { 0, 0 }, { 500, 100 }, { 300, 500 }, { 100, 300 } }; - Polygon* polygon = new Polygon(vertexes, 4); - - EXPECT_EQ(polygon->operator[](1).x_, 500); - EXPECT_EQ(polygon->operator[](2).y_, 500); - delete polygon; - - Rect rect(100, 200, 300, 400); - polygon = new Polygon(rect); - - EXPECT_EQ(polygon->operator[](0).x_, 100); - EXPECT_EQ(polygon->operator[](0).y_, 200); - EXPECT_EQ(polygon->operator[](1).x_, 300); - EXPECT_EQ(polygon->operator[](1).y_, 200); - EXPECT_EQ(polygon->operator[](2).x_, 300); - EXPECT_EQ(polygon->operator[](2).y_, 400); - EXPECT_EQ(polygon->operator[](3).x_, 100); - EXPECT_EQ(polygon->operator[](3).y_, 400); - EXPECT_EQ(polygon->GetVertexNum(), 4); - delete polygon; -} - -/** - * @tc.number SUB_GRAPHIC_GEOMETRY2D_INTERSECT_0600 - * @tc.name test geometry2d intersect api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(Geometry2dTest, Graphic_Geometry2d_Test_Intersect_0600, Function | MediumTest | Level0) -{ - Vector2 pt11 = { 0, 200 }; - Vector2 pt12 = { 400, 200 }; - Line* line1 = new Line(pt11, pt12); - Vector2 pt21 = { 200, 0 }; - Vector2 pt22 = { 200, 400 }; - Line* line2 = new Line(pt21, pt22); - Vector2 pt31 = { 0, 0 }; - Vector2 pt32 = { 500, 0 }; - Line* line3 = new Line(pt31, pt32); - Vector2 out; - - EXPECT_EQ(Intersect(*line1, *line2, out), true); - EXPECT_EQ(out.x_, 200); - EXPECT_EQ(out.y_, 200); - EXPECT_EQ(Intersect(*line1, *line3, out), false); - - delete line1; - delete line2; - delete line3; -} - -/** - * @tc.number SUB_GRAPHIC_GEOMETRY2D_ISINTERSECT_0700 - * @tc.name test geometry2d if-intersected api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(Geometry2dTest, Graphic_Geometry2d_Test_IsIntersect_0700, Function | MediumTest | Level0) -{ - Vector2 pt11 = { 0, 200 }; - Vector2 pt12 = { 400, 200 }; - Line* line1 = new Line(pt11, pt12); - Vector2 pt21 = { 200, 0 }; - Vector2 pt22 = { 200, 400 }; - Line* line2 = new Line(pt21, pt22); - Vector2 pt31 = { 0, 0 }; - Vector2 pt32 = { 500, 0 }; - Line* line3 = new Line(pt31, pt32); - - EXPECT_EQ(IsIntersect(*line1, *line2), true); - EXPECT_EQ(IsIntersect(*line1, *line3), false); - - delete line1; - delete line2; - delete line3; -} - -/** - * @tc.number SUB_GRAPHIC_GEOMETRY2D_CLIP_0800 - * @tc.name test geometry2d clip api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(Geometry2dTest, Graphic_Geometry2d_Test_Clip_0800, Function | MediumTest | Level0) -{ - const Vector2 vertexes[4] = { { 0, 0 }, { 500, 100 }, { 300, 500 }, { 100, 300 } }; - Polygon* polygon = new Polygon(vertexes, 4); - const Vector2 pt11 = { 100, 300 }; - const Vector2 pt12 = { 500, 100 }; - Line* line = new Line(pt11, pt12); - Clip(*polygon, *line); - - EXPECT_EQ(polygon->GetVertexNum(), 3); - EXPECT_EQ(polygon->operator[](0).x_, 500); - EXPECT_EQ(polygon->operator[](0).y_, 100); - EXPECT_EQ(polygon->operator[](1).x_, 100); - EXPECT_EQ(polygon->operator[](1).y_, 300); - EXPECT_EQ(polygon->operator[](2).x_, 0); - EXPECT_EQ(polygon->operator[](2).y_, 0); - - delete polygon; - delete line; - - polygon = new Polygon(vertexes, 4); - Rect rect(1, 4, 3, 1); - Polygon polygon1 = SuthHodgClip(rect, *polygon); - EXPECT_EQ(polygon1[0].x_, 1); - EXPECT_EQ(polygon1[0].y_, 1); - EXPECT_EQ(polygon1[1].x_, 3); - EXPECT_EQ(polygon1[1].y_, 1); - EXPECT_EQ(polygon1[2].x_, 3); - EXPECT_EQ(polygon1[2].y_, 4); - EXPECT_EQ(polygon1[3].x_, 1); - EXPECT_EQ(polygon1[3].y_, 4); - delete polygon; -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/graphic_utils/graphic_math_posix/BUILD.gn b/graphic_lite/graphic_utils/graphic_math_posix/BUILD.gn deleted file mode 100755 index 039da721f..000000000 --- a/graphic_lite/graphic_utils/graphic_math_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsGraphicMathTest") { - suite_name = "acts" - sources = [ "src/graphic_math_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/graphic_utils/graphic_math_posix/Test.json b/graphic_lite/graphic_utils/graphic_math_posix/Test.json deleted file mode 100644 index 0456053cb..000000000 --- a/graphic_lite/graphic_utils/graphic_math_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsGraphicMathTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/graphic_utils/graphic_math_posix/src/graphic_math_test.cpp b/graphic_lite/graphic_utils/graphic_math_posix/src/graphic_math_test.cpp deleted file mode 100755 index 157b03895..000000000 --- a/graphic_lite/graphic_utils/graphic_math_posix/src/graphic_math_test.cpp +++ /dev/null @@ -1,484 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "gfx_utils/graphic_math.h" - -#include -#include - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class MathTest : public testing::Test { -public: - static void SetUpTestCase(void); - static void TearDownTestCase(void); -}; - -void MathTest::SetUpTestCase() -{ - return; -} - -void MathTest::TearDownTestCase() -{ - return; -} - -/** - * @tc.number SUB_GRAPHIC_MATH_SIN_0100 - * @tc.name test math sin api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(MathTest, Graphic_Math_Test_Sin_0100, Function | MediumTest | Level0) -{ - EXPECT_EQ(Sin(0), 0); - EXPECT_EQ(Sin(90), 1); - EXPECT_EQ(Sin(180), 0); -} - -/** - * @tc.number SUB_GRAPHIC_MATH_FASTATAN2_0200 - * @tc.name test math fast-atan2 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(MathTest, Graphic_Math_Test_FastAtan2_0200, Function | MediumTest | Level0) -{ - EXPECT_EQ(FastAtan2(0, 1), 0); - EXPECT_EQ(FastAtan2(1, 0), 90); - EXPECT_EQ(FastAtan2(0, -1), 180); - EXPECT_EQ(FastAtan2(-1, 0), 270); -} - - -/** - * @tc.number SUB_GRAPHIC_MATH_FLOATTOINT64_0300 - * @tc.name test math float-to-int64 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(MathTest, Graphic_Math_Test_FloatToInt64_0300, Function | MediumTest | Level0) -{ - EXPECT_EQ(FloatToInt64(1), 256); -} - -/** - * @tc.number SUB_GRAPHIC_MATH_SQRT_0400 - * @tc.name test math sqrt api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(MathTest, Graphic_Math_Test_Sqrt_0400, Function | MediumTest | Level0) -{ - const float testInteger = 2.0; - const float testIntegerSquared = testInteger * testInteger; - const float testFloat = 2.121320; // 2.121320: 4.5 squaring results - const float testFloatSquared = 4.5; - const float accuracy = 0.000001; - - EXPECT_EQ(Sqrt(0), 0); - float ret = Sqrt(testIntegerSquared); - if (ret > testInteger - accuracy && ret < testInteger + accuracy) { - EXPECT_EQ(0, 0); - } else { - EXPECT_NE(0, 0); - } - - ret = Sqrt(testFloatSquared); - if (ret > testFloat - accuracy && ret < testFloat + accuracy) { - EXPECT_EQ(0, 0); - } else { - EXPECT_NE(0, 0); - } -} - -/** - * @tc.number SUB_GRAPHIC_MATH_VECTOR2_DOT_0500 - * @tc.name test math vector2-dot api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(MathTest, Graphic_Vector2_Test_Dot_0500, Function | MediumTest | Level0) -{ - Vector2* vector1 = new Vector2(5, 4); - Vector2* vector2 = new Vector2(3, 2); - - EXPECT_EQ(vector1->Dot(*vector2), 23); - - delete vector1; - delete vector2; -} - -/** - * @tc.number SUB_GRAPHIC_MATH_VECTOR2_CROSS_0600 - * @tc.name test math vector2-cross api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(MathTest, Graphic_Vector2_Test_Cross_0600, Function | MediumTest | Level0) -{ - Vector2* vector1 = new Vector2(5, 4); - Vector2* vector2 = new Vector2(3, 5); - - EXPECT_EQ(vector1->Cross(*vector2), 13); - - delete vector1; - delete vector2; -} - -/** - * @tc.number SUB_GRAPHIC_MATH_VECTOR2_OPERATOR_0700 - * @tc.name test math vector2-operator-minus api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(MathTest, Graphic_Vector2_Test_operator_Minus_0700, Function | MediumTest | Level0) -{ - Vector2* vector1 = new Vector2(5, 4); - Vector2 vector2 = vector1->operator-(); - - EXPECT_EQ(vector2.x_, 65531); - EXPECT_EQ(vector2.y_, 65532); - - delete vector1; - - Vector2* vector3 = new Vector2(5, 7); - Vector2* vector4 = new Vector2(3, 5); - Vector2 vector5 = vector3->operator-(*vector4); - - EXPECT_EQ(vector5.x_, 2); - EXPECT_EQ(vector5.y_, 2); - - delete vector3; - delete vector4; -} - -/** - * @tc.number SUB_GRAPHIC_MATH_VECTOR2_OPERATOR_0800 - * @tc.name test math vector2-operator-plus api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(MathTest, Graphic_Vector2_Test_operator_Plus_0800, Function | MediumTest | Level0) -{ - Vector2* vector1 = new Vector2(5, 7); - Vector2* vector2 = new Vector2(3, 5); - Vector2 vector3 = vector1->operator+(*vector2); - - EXPECT_EQ(vector3.x_, 8); - EXPECT_EQ(vector3.y_, 12); - - delete vector1; - delete vector2; -} - -/** - * @tc.number SUB_GRAPHIC_MATH_VECTOR2_OPERATOR_0900 - * @tc.name test math vector2-operator-star api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(MathTest, Graphic_Vector2_Test_operator_Star_0900, Function | MediumTest | Level0) -{ - Vector2* vector1 = new Vector2(5, 7); - Vector2 vector2 = vector1->operator*(2); - - EXPECT_EQ(vector2.x_, 10); - EXPECT_EQ(vector2.y_, 14); - - delete vector1; -} - -/** - * @tc.number SUB_GRAPHIC_MATH_VECTOR2_OPERATOR_1000 - * @tc.name test math vector2-operator-duo-equal api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(MathTest, Graphic_Vector2_Test_operator_DuoEqual_1000, Function | MediumTest | Level0) -{ - Vector2* vector1 = new Vector2(5, 7); - Vector2* vector2 = new Vector2(5, 7); - Vector2* vector3 = new Vector2(5, 8); - - EXPECT_EQ(vector1->operator==(*vector2), true); - EXPECT_EQ(vector1->operator==(*vector3), false); - - delete vector1; - delete vector2; - delete vector3; -} - -/** - * @tc.number SUB_GRAPHIC_MATH_VECTOR2_OPERATOR_1100 - * @tc.name test math vector2-operator-equal api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(MathTest, Graphic_Vector2_Test_operator_Equal_1100, Function | MediumTest | Level0) -{ - Vector2* vector1 = new Vector2(5, 7); - Vector2* vector2 = new Vector2(1, 2); - vector1->operator=(*vector2); - EXPECT_EQ(vector1->x_, 1); - EXPECT_EQ(vector1->y_, 2); - - delete vector1; - delete vector2; -} - -/** - * @tc.number SUB_GRAPHIC_MATH_VECTOR2_OPERATOR_1200 - * @tc.name test math vector2-operator-plus-equal api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(MathTest, Graphic_Vector2_Test_operator_PlusEqual_1200, Function | MediumTest | Level0) -{ - Vector2* vector1 = new Vector2(5, 7); - Vector2* vector2 = new Vector2(1, 2); - vector1->operator+=(*vector2); - EXPECT_EQ(vector1->x_, 6); - EXPECT_EQ(vector1->y_, 9); - - delete vector1; - delete vector2; -} - -/** - * @tc.number SUB_GRAPHIC_MATH_VECTOR2_OPERATOR_1300 - * @tc.name test math vector2-operator-minus-equal api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(MathTest, Graphic_Vector2_Test_operator_MinusEqual_1300, Function | MediumTest | Level0) -{ - Vector2* vector1 = new Vector2(5, 7); - Vector2* vector2 = new Vector2(1, 2); - vector1->operator-=(*vector2); - EXPECT_EQ(vector1->x_, 4); - EXPECT_EQ(vector1->y_, 5); - - delete vector1; - delete vector2; -} - -/** - * @tc.number SUB_GRAPHIC_MATH_VECTOR3_OPERATOR_1400 - * @tc.name test math vector3-operator-brackets api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(MathTest, Graphic_Vector3_Test_operator_Brackets_1400, Function | MediumTest | Level0) -{ - Vector3* vector1 = new Vector3(3, 5, 7); - EXPECT_EQ(vector1->operator[](0), 3); - EXPECT_EQ(vector1->operator[](1), 5); - EXPECT_EQ(vector1->operator[](2), 7); - - delete vector1; -} - -/** - * @tc.number SUB_GRAPHIC_MATH_VECTOR3_OPERATOR_1500 - * @tc.name test math vector3-operator-duo-equal api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(MathTest, Graphic_Vector3_Test_operator_DuoEqual_1500, Function | MediumTest | Level0) -{ - Vector3* vector1 = new Vector3(3, 5, 7); - Vector3* vector2 = new Vector3(3, 5, 7); - Vector3* vector3 = new Vector3(3, 5, 9); - - EXPECT_EQ(vector1->operator==(*vector2), true); - EXPECT_EQ(vector1->operator==(*vector3), false); - - delete vector1; - delete vector2; - delete vector3; -} - -/** - * @tc.number SUB_GRAPHIC_MATH_MATRIX3_GETDATA_1600 - * @tc.name test math matrix3-getdata api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(MathTest, Graphic_Matrix3_Test_GetData_1600, Function | MediumTest | Level0) -{ - Matrix3* matrix = new Matrix3(1, 1, 1, 1, 1, 1, 1, 1, 1); - - EXPECT_EQ(matrix->GetData()[0], 1); - EXPECT_EQ(matrix->GetData()[5], 1); - - delete matrix; -} - -/** - * @tc.number SUB_GRAPHIC_MATH_MATRIX3_OPERATOR_1700 - * @tc.name test math matrix3-operator-star api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(MathTest, Graphic_Matrix3_Test_operator_Star_1700, Function | MediumTest | Level0) -{ - Matrix3 matrix1(1, 1, 1, 1, 1, 1, 1, 1, 1); - Matrix3 matrix2(1, 2, 3, 4, 5, 6, 7, 8, 9); - Matrix3 matrix3 = matrix1 * matrix2; - - EXPECT_EQ(matrix3.GetData()[0], 6); - EXPECT_EQ(matrix3.GetData()[1], 6); - EXPECT_EQ(matrix3.GetData()[2], 6); - EXPECT_EQ(matrix3.GetData()[3], 15); - EXPECT_EQ(matrix3.GetData()[4], 15); - EXPECT_EQ(matrix3.GetData()[5], 15); - EXPECT_EQ(matrix3.GetData()[6], 24); - EXPECT_EQ(matrix3.GetData()[7], 24); - EXPECT_EQ(matrix3.GetData()[8], 24); - - Vector3 vector1(1, 2, 3); - Vector3 vector2 = matrix1 * vector1; - - EXPECT_EQ(vector2.x_, 6); - EXPECT_EQ(vector2.y_, 6); - EXPECT_EQ(vector2.z_, 6); -} - -/** - * @tc.number SUB_GRAPHIC_MATH_MATRIX3_OPERATOR_1800 - * @tc.name test math matrix3-operator-brackets api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(MathTest, Graphic_Matrix3_Test_operator_Brackets_1800, Function | MediumTest | Level0) -{ - Matrix3* matrix = new Matrix3(1, 2, 3, 4, 5, 6, 7, 8, 9); - - EXPECT_EQ(*matrix->operator[](0), 1); - EXPECT_EQ(*matrix->operator[](1), 4); - EXPECT_EQ(*matrix->operator[](2), 7); - - delete matrix; -} - -/** - * @tc.number SUB_GRAPHIC_MATH_MATRIX3_OPERATOR_1900 - * @tc.name test math matrix3-operator-equal api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(MathTest, Graphic_Matrix3_Test_operator_Equal_1900, Function | MediumTest | Level0) -{ - Matrix3* matrix1 = new Matrix3(1, 2, 3, 4, 5, 6, 7, 8, 9); - Matrix3* matrix2 = new Matrix3(1, 1, 1, 1, 1, 1, 1, 1, 1); - matrix1->operator=(*matrix2); - EXPECT_EQ(matrix1->GetData()[0], 1); - EXPECT_EQ(matrix1->GetData()[1], 1); - EXPECT_EQ(matrix1->GetData()[2], 1); - EXPECT_EQ(matrix1->GetData()[3], 1); - EXPECT_EQ(matrix1->GetData()[4], 1); - EXPECT_EQ(matrix1->GetData()[5], 1); - EXPECT_EQ(matrix1->GetData()[6], 1); - EXPECT_EQ(matrix1->GetData()[7], 1); - EXPECT_EQ(matrix1->GetData()[8], 1); - - delete matrix1; - delete matrix2; -} - -/** - * @tc.number SUB_GRAPHIC_MATH_MATRIX3_DETERMINANT_2000 - * @tc.name test math matrix3-determinant api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(MathTest, Graphic_Matrix3_Test_Determinant_2000, Function | MediumTest | Level0) -{ - Matrix3* matrix1 = new Matrix3(1, 2, 2, 2, 1, 2, 2, 2, 1); - EXPECT_EQ(matrix1->Determinant(), 5); - - delete matrix1; -} - -/** - * @tc.number SUB_GRAPHIC_MATH_MATRIX3_INVERSE_2100 - * @tc.name test math matrix3-inverse api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(MathTest, Graphic_Matrix3_Test_Inverse_2100, Function | MediumTest | Level0) -{ - Matrix3* matrix1 = new Matrix3(1, 1, 1, 1, 1, 1, 1, 1, 1); - Matrix3 matrix2 = matrix1->Inverse(); - EXPECT_EQ(matrix2.GetData()[0], 1); - EXPECT_EQ(matrix2.GetData()[1], 1); - EXPECT_EQ(matrix2.GetData()[2], 1); - EXPECT_EQ(matrix2.GetData()[3], 1); - EXPECT_EQ(matrix2.GetData()[4], 1); - EXPECT_EQ(matrix2.GetData()[5], 1); - EXPECT_EQ(matrix2.GetData()[6], 1); - EXPECT_EQ(matrix2.GetData()[7], 1); - EXPECT_EQ(matrix2.GetData()[8], 1); - delete matrix1; -} - -/** - * @tc.number SUB_GRAPHIC_MATH_MATRIX3_OPERATOR_2200 - * @tc.name test math matrix3-operator-duo-equal api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(MathTest, Graphic_Matrix3_Test_operator_DuoEqual_2200, Function | MediumTest | Level0) -{ - Matrix3* matrix1 = new Matrix3(1, 1, 1, 1, 1, 1, 1, 1, 1); - Matrix3* matrix2 = new Matrix3(1, 1, 1, 1, 1, 1, 1, 1, 1); - Matrix3* matrix3 = new Matrix3(1, 1, 1, 1, 1, 1, 8, 1, 1); - EXPECT_EQ(matrix1->operator==(*matrix2), true); - EXPECT_EQ(matrix1->operator==(*matrix3), false); - - delete matrix1; - delete matrix2; - delete matrix3; -} - -/** - * @tc.number SUB_GRAPHIC_MATH_MATRIX3_ROTATE_2300 - * @tc.name test math matrix3-rotate api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(MathTest, Graphic_Matrix3_Test_Rotate_2300, Function | MediumTest | Level0) -{ - Matrix3 rotate = Matrix3::Rotate(0, Vector2(0, 0)); - EXPECT_EQ(rotate.GetData()[0], 1); - EXPECT_EQ(rotate.GetData()[1], 0); - EXPECT_EQ(rotate.GetData()[3], 0); - EXPECT_EQ(rotate.GetData()[4], 1); -} - -/** - * @tc.number SUB_GRAPHIC_MATH_MATRIX3_SCALE_2400 - * @tc.name test math matrix3-scale api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(MathTest, Graphic_Matrix3_Test_Scale_2400, Function | MediumTest | Level0) -{ - Matrix3 scale = Matrix3::Scale(Vector2(256, 256), Vector2(0, 0)); - EXPECT_EQ(scale.GetData()[0], 256); - EXPECT_EQ(scale.GetData()[4], 256); - EXPECT_EQ(scale.GetData()[6], 0); - EXPECT_EQ(scale.GetData()[7], 0); - EXPECT_EQ(scale.GetData()[8], 1); -} - -/** - * @tc.number SUB_GRAPHIC_MATH_MATRIX3_TRANSLATE_2500 - * @tc.name test math matrix3-translate api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(MathTest, Graphic_Matrix3_Test_Translate_2500, Function | MediumTest | Level0) -{ - Matrix3 translate = Matrix3::Translate(Vector2(0, 0)); - EXPECT_EQ(translate.GetData()[0], 1); - EXPECT_EQ(translate.GetData()[1], 0); - EXPECT_EQ(translate.GetData()[2], 0); - EXPECT_EQ(translate.GetData()[3], 0); - EXPECT_EQ(translate.GetData()[4], 1); - EXPECT_EQ(translate.GetData()[5], 0); - EXPECT_EQ(translate.GetData()[6], 0); - EXPECT_EQ(translate.GetData()[7], 0); - EXPECT_EQ(translate.GetData()[8], 1); -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/graphic_utils/heap_base_posix/BUILD.gn b/graphic_lite/graphic_utils/heap_base_posix/BUILD.gn deleted file mode 100755 index aebfc0508..000000000 --- a/graphic_lite/graphic_utils/heap_base_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsHeapBaseTest") { - suite_name = "acts" - sources = [ "src/heap_base_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/graphic_utils/heap_base_posix/Test.json b/graphic_lite/graphic_utils/heap_base_posix/Test.json deleted file mode 100644 index a9fb0e3bc..000000000 --- a/graphic_lite/graphic_utils/heap_base_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsHeapBaseTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/graphic_utils/heap_base_posix/src/heap_base_test.cpp b/graphic_lite/graphic_utils/heap_base_posix/src/heap_base_test.cpp deleted file mode 100755 index 4d654220c..000000000 --- a/graphic_lite/graphic_utils/heap_base_posix/src/heap_base_test.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "gfx_utils/heap_base.h" - -#include -#include - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class HeapBaseTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_HEAPBASE_OPERATOR_NEW_0100 - * @tc.name test heapbase operator-new api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(HeapBaseTest, Graphic_UIHeapBase_Test_operator_new_0100, Function | MediumTest | Level0) -{ - HeapBase* heap = new HeapBase(); - EXPECT_EQ(0, 0); - delete heap; - EXPECT_EQ(0, 0); -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/graphic_utils/list_posix/BUILD.gn b/graphic_lite/graphic_utils/list_posix/BUILD.gn deleted file mode 100755 index b9e85390f..000000000 --- a/graphic_lite/graphic_utils/list_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsListTest") { - suite_name = "acts" - sources = [ "src/list_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/graphic_utils/list_posix/Test.json b/graphic_lite/graphic_utils/list_posix/Test.json deleted file mode 100644 index 8a0f1e845..000000000 --- a/graphic_lite/graphic_utils/list_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsListTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/graphic_utils/list_posix/src/list_test.cpp b/graphic_lite/graphic_utils/list_posix/src/list_test.cpp deleted file mode 100755 index 81cef884d..000000000 --- a/graphic_lite/graphic_utils/list_posix/src/list_test.cpp +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "gfx_utils/list.h" -#include -#include - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class ListTest : public testing::Test { -public: - static void SetUpTestCase(void); - static void TearDownTestCase(void); -}; - -void ListTest::SetUpTestCase() -{ - return; -} - -void ListTest::TearDownTestCase() -{ - return; -} - -/** - * @tc.number SUB_GRAPHIC_LIST_FRONT_0100 - * @tc.name test list front api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ListTest, Graphic_List_Test_Front_0100, Function | MediumTest | Level0) -{ - List* list = new List(); - list->PushBack(1); - list->PushBack(2); - EXPECT_EQ(list->Front(), 1); - delete list; -} - -/** - * @tc.number SUB_GRAPHIC_LIST_BACK_0200 - * @tc.name test list back api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ListTest, Graphic_List_Test_Back_0200, Function | MediumTest | Level0) -{ - List* list = new List(); - list->PushBack(1); - list->PushBack(2); - EXPECT_EQ(list->Back(), 2); - - delete list; -} - -/** - * @tc.number SUB_GRAPHIC_LIST_PUSHBACK_0300 - * @tc.name test list pushback api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ListTest, Graphic_List_Test_PushBack_0300, Function | MediumTest | Level0) -{ - List* list = new List(); - list->PushBack(1); - list->PushBack(2); - EXPECT_EQ(list->Size(), 2); - EXPECT_EQ(list->Front(), 1); - EXPECT_EQ(list->Back(), 2); - - delete list; -} - -/** - * @tc.number SUB_GRAPHIC_LIST_PUSHFRONT_0400 - * @tc.name test list pushfront api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ListTest, Graphic_List_Test_PushFront_0400, Function | MediumTest | Level0) -{ - List* list = new List(); - list->PushFront(1); - list->PushFront(2); - EXPECT_EQ(list->Size(), 2); - EXPECT_EQ(list->Front(), 2); - EXPECT_EQ(list->Back(), 1); - - delete list; -} - -/** - * @tc.number SUB_GRAPHIC_LIST_POPBACK_0500 - * @tc.name test list popback api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ListTest, Graphic_List_Test_PopBack_0500, Function | MediumTest | Level0) -{ - List* list = new List(); - list->PushBack(1); - list->PushBack(2); - list->PopBack(); - EXPECT_EQ(list->Size(), 1); - EXPECT_EQ(list->Front(), 1); - EXPECT_EQ(list->Back(), 1); - - delete list; -} - -/** - * @tc.number SUB_GRAPHIC_LIST_POPFRONT_0600 - * @tc.name test list popfront api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ListTest, Graphic_List_Test_PopFront_0600, Function | MediumTest | Level0) -{ - List* list = new List(); - list->PushBack(1); - list->PushBack(2); - list->PopFront(); - EXPECT_EQ(list->Size(), 1); - EXPECT_EQ(list->Front(), 2); - EXPECT_EQ(list->Back(), 2); - - delete list; -} - -/** - * @tc.number SUB_GRAPHIC_LIST_INSERT_0700 - * @tc.name test list insert api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ListTest, Graphic_List_Test_Insert_0700, Function | MediumTest | Level0) -{ - List* list = new List(); - list->PushBack(1); - list->PushBack(2); - ListNode* node = list->Tail(); - list->Insert(node, 3); - EXPECT_EQ(list->Size(), 3); - EXPECT_EQ(list->Front(), 1); - EXPECT_EQ(list->Head()->next_->data_, 3); - EXPECT_EQ(list->Back(), 2); - - delete list; -} - -/** - * @tc.number SUB_GRAPHIC_LIST_REMOVE_0800 - * @tc.name test list remove api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ListTest, Graphic_List_Test_Remove_0800, Function | MediumTest | Level0) -{ - List* list = new List(); - list->PushBack(1); - list->PushBack(2); - ListNode* node = list->Head(); - list->Remove(node); - EXPECT_EQ(list->Size(), 1); - EXPECT_EQ(list->Front(), 2); - EXPECT_EQ(list->Back(), 2); - - delete list; -} - -/** - * @tc.number SUB_GRAPHIC_LIST_CLEAR_0900 - * @tc.name test list clear api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ListTest, Graphic_List_Test_Clear_0900, Function | MediumTest | Level0) -{ - List* list = new List(); - list->PushBack(1); - list->PushBack(2); - list->Clear(); - EXPECT_EQ(list->Size(), 0); - - delete list; -} - -/** - * @tc.number SUB_GRAPHIC_LIST_HEAD_1000 - * @tc.name test list head api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ListTest, Graphic_List_Test_Head_1000, Function | MediumTest | Level0) -{ - List* list = new List(); - list->PushBack(1); - list->PushBack(2); - EXPECT_EQ(list->Head()->data_, 1); - - delete list; -} - -/** - * @tc.number SUB_GRAPHIC_LIST_TAIL_1100 - * @tc.name test list tail api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ListTest, Graphic_List_Test_Tail_1100, Function | MediumTest | Level0) -{ - List* list = new List(); - list->PushBack(1); - list->PushBack(2); - EXPECT_EQ(list->Tail()->data_, 2); - - delete list; -} - -/** - * @tc.number SUB_GRAPHIC_LIST_BEGIN_1200 - * @tc.name test list begin api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ListTest, Graphic_List_Test_Begin_1200, Function | MediumTest | Level0) -{ - List* list = new List(); - list->PushBack(1); - list->PushBack(2); - EXPECT_EQ(list->Begin()->data_, 1); - - delete list; -} - -/** - * @tc.number SUB_GRAPHIC_LIST_NEXT_1300 - * @tc.name test list next api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ListTest, Graphic_List_Test_Next_1300, Function | MediumTest | Level0) -{ - List* list = new List(); - list->PushBack(1); - list->PushBack(2); - EXPECT_EQ(list->Next(list->Head())->data_, 2); - - delete list; -} - -/** - * @tc.number SUB_GRAPHIC_LIST_ISEMPTY_1400 - * @tc.name test list isempty api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ListTest, Graphic_List_Test_IsEmpty_1400, Function | MediumTest | Level0) -{ - List* list = new List(); - list->PushBack(1); - EXPECT_EQ(list->IsEmpty(), false); - list->Clear(); - EXPECT_EQ(list->IsEmpty(), true); - - delete list; -} - -/** - * @tc.number SUB_GRAPHIC_LIST_SIZE_1500 - * @tc.name test list size api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ListTest, Graphic_List_Test_Size_1500, Function | MediumTest | Level0) -{ - List* list = new List(); - list->PushBack(1); - EXPECT_EQ(list->Size(), 1); - list->Clear(); - EXPECT_EQ(list->Size(), 0); - - delete list; -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/graphic_utils/mem_api_posix/BUILD.gn b/graphic_lite/graphic_utils/mem_api_posix/BUILD.gn deleted file mode 100755 index 9c1d31f9f..000000000 --- a/graphic_lite/graphic_utils/mem_api_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsGraphMemApiTest") { - suite_name = "acts" - sources = [ "src/mem_api_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/graphic_utils/mem_api_posix/Test.json b/graphic_lite/graphic_utils/mem_api_posix/Test.json deleted file mode 100755 index 91433b113..000000000 --- a/graphic_lite/graphic_utils/mem_api_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsGraphMemApiTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/graphic_utils/mem_api_posix/src/mem_api_test.cpp b/graphic_lite/graphic_utils/mem_api_posix/src/mem_api_test.cpp deleted file mode 100755 index e885c07e1..000000000 --- a/graphic_lite/graphic_utils/mem_api_posix/src/mem_api_test.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "gfx_utils/mem_api.h" - -#include -#include - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class MemapiTest : public testing::Test { -public: - static void SetUpTestCase(void); - static void TearDownTestCase(void); -}; - -void MemapiTest::SetUpTestCase() -{ - return; -} - -void MemapiTest::TearDownTestCase() -{ - return; -} - -/** - * @tc.number SUB_GRAPHIC_MEMAPI_IMAGECACHEMALLOC_0100 - * @tc.name test memapi image-cache-malloc api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(MemapiTest, Graphic_UIAnimatorTest_Test_ImageCacheMalloc_0100, Function | MediumTest | Level0) -{ - ImageInfo* info = new ImageInfo(); - free(ImageCacheMalloc(*info)); - EXPECT_EQ(0, 0); - ImageCacheFree(*info); - delete info; -} - -/** - * @tc.number SUB_GRAPHIC_MEMAPI_UIMALLOC_0200 - * @tc.name test memapi uimalloc api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(MemapiTest, Graphic_UIAnimatorTest_Test_UIMalloc_0200, Function | MediumTest | Level0) -{ - void* size = UIMalloc(3); - EXPECT_EQ(0, 0); - free(size); -} - -/** - * @tc.number SUB_GRAPHIC_MEMAPI_UIFREE_0300 - * @tc.name test memapi uifree api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(MemapiTest, Graphic_UIAnimatorTest_Test_UIFree_0300, Function | MediumTest | Level0) -{ - void* buffer = nullptr; - UIFree(buffer); - EXPECT_EQ(0, 0); -} -} \ No newline at end of file diff --git a/graphic_lite/graphic_utils/rect_posix/BUILD.gn b/graphic_lite/graphic_utils/rect_posix/BUILD.gn deleted file mode 100755 index a2fc00d6f..000000000 --- a/graphic_lite/graphic_utils/rect_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsRectTest") { - suite_name = "acts" - sources = [ "src/rect_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/graphic_utils/rect_posix/Test.json b/graphic_lite/graphic_utils/rect_posix/Test.json deleted file mode 100644 index 6e0801a8d..000000000 --- a/graphic_lite/graphic_utils/rect_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsRectTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/graphic_utils/rect_posix/src/rect_test.cpp b/graphic_lite/graphic_utils/rect_posix/src/rect_test.cpp deleted file mode 100755 index 98a8753e9..000000000 --- a/graphic_lite/graphic_utils/rect_posix/src/rect_test.cpp +++ /dev/null @@ -1,496 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "gfx_utils/rect.h" - -#include -#include - -using namespace std; -using namespace testing::ext; - -namespace OHOS { -class RectTest : public testing::Test { -public: - static void SetUpTestCase(void); - static void TearDownTestCase(void); -}; - -void RectTest::SetUpTestCase() -{ - return; -} - -void RectTest::TearDownTestCase() -{ - return; -} - -/** - * @tc.number SUB_GRAPHIC_RECT_OPERATOR_EQUAL_0100 - * @tc.name test rect operator-equal api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(RectTest, Graphic_Rect_Test_operator_Equal_0100, Function | MediumTest | Level0) -{ - Rect* rect1 = new Rect(); - rect1->SetRect(100, 200, 300, 400); - Rect* rect = new Rect(); - rect->operator=(*rect1); - - EXPECT_EQ(rect->GetLeft(), 100); - EXPECT_EQ(rect->GetTop(), 200); - EXPECT_EQ(rect->GetRight(), 300); - EXPECT_EQ(rect->GetBottom(), 400); - - delete rect1; - delete rect; -} - -/** - * @tc.number SUB_GRAPHIC_RECT_SETRECT_0200 - * @tc.name test rect set-rect api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(RectTest, Graphic_Rect_Test_SetRect_0200, Function | MediumTest | Level0) -{ - Rect* rect = new Rect(); - rect->SetRect(100, 200, 300, 400); - - EXPECT_EQ(rect->GetLeft(), 100); - EXPECT_EQ(rect->GetTop(), 200); - EXPECT_EQ(rect->GetRight(), 300); - EXPECT_EQ(rect->GetBottom(), 400); - - delete rect; -} - -/** - * @tc.number SUB_GRAPHIC_RECT_GETWIDTH_0300 - * @tc.name test rect get-width api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(RectTest, Graphic_Rect_Test_GetWidth_0300, Function | MediumTest | Level0) -{ - Rect* rect = new Rect(); - rect->SetRect(100, 200, 300, 400); - - EXPECT_EQ(rect->GetWidth(), 201); - delete rect; -} - -/** - * @tc.number SUB_GRAPHIC_RECT_GETHEIGHT_0400 - * @tc.name test rect get-height api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(RectTest, Graphic_Rect_Test_GetHeight_0400, Function | MediumTest | Level0) -{ - Rect* rect = new Rect(); - rect->SetRect(100, 200, 300, 400); - - EXPECT_EQ(rect->GetHeight(), 201); - delete rect; -} - -/** - * @tc.number SUB_GRAPHIC_RECT_GETX_0500 - * @tc.name test rect getX api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(RectTest, Graphic_Rect_Test_GetX_0500, Function | MediumTest | Level0) -{ - Rect* rect = new Rect(); - rect->SetRect(100, 200, 300, 400); - - EXPECT_EQ(rect->GetX(), 100); - delete rect; -} - -/** - * @tc.number SUB_GRAPHIC_RECT_GETY_0600 - * @tc.name test rect getY api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(RectTest, Graphic_Rect_Test_GetY_0600, Function | MediumTest | Level0) -{ - Rect* rect = new Rect(); - rect->SetRect(100, 200, 300, 400); - - EXPECT_EQ(rect->GetY(), 200); - delete rect; -} - -/** - * @tc.number SUB_GRAPHIC_RECT_GETLEFT_0700 - * @tc.name test rect get-left api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(RectTest, Graphic_Rect_Test_GetLeft_0700, Function | MediumTest | Level0) -{ - Rect* rect = new Rect(); - rect->SetRect(100, 200, 300, 400); - - EXPECT_EQ(rect->GetLeft(), 100); - delete rect; -} - -/** - * @tc.number SUB_GRAPHIC_RECT_GETTOP_0800 - * @tc.name test rect get-top api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(RectTest, Graphic_Rect_Test_GetTop_0800, Function | MediumTest | Level0) -{ - Rect* rect = new Rect(); - rect->SetRect(100, 200, 300, 400); - - EXPECT_EQ(rect->GetTop(), 200); - delete rect; -} - -/** - * @tc.number SUB_GRAPHIC_RECT_GETRIGHT_0900 - * @tc.name test rect get-right api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(RectTest, Graphic_Rect_Test_GetRight_0900, Function | MediumTest | Level0) -{ - Rect* rect = new Rect(); - rect->SetRect(100, 200, 300, 400); - - EXPECT_EQ(rect->GetRight(), 300); - - delete rect; -} - -/** - * @tc.number SUB_GRAPHIC_RECT_GETBOTTOM_1000 - * @tc.name test rect get-bottom api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(RectTest, Graphic_Rect_Test_GetBottom_1000, Function | MediumTest | Level0) -{ - Rect* rect = new Rect(); - rect->SetRect(100, 200, 300, 400); - - EXPECT_EQ(rect->GetBottom(), 400); - - delete rect; -} - -/** - * @tc.number SUB_GRAPHIC_RECT_SETX_1100 - * @tc.name test rect setX api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(RectTest, Graphic_Rect_Test_SetX_1100, Function | MediumTest | Level0) -{ - Rect* rect = new Rect(); - rect->SetRect(100, 200, 300, 400); - rect->SetX(200); - - EXPECT_EQ(rect->GetLeft(), 200); - EXPECT_EQ(rect->GetRight(), 400); - - delete rect; -} - -/** - * @tc.number SUB_GRAPHIC_RECT_SETY_1200 - * @tc.name test rect setY api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(RectTest, Graphic_Rect_Test_SetY_1200, Function | MediumTest | Level0) -{ - Rect* rect = new Rect(); - rect->SetRect(100, 200, 300, 400); - rect->SetY(300); - - EXPECT_EQ(rect->GetTop(), 300); - EXPECT_EQ(rect->GetBottom(), 500); - - delete rect; -} - -/** - * @tc.number SUB_GRAPHIC_RECT_SETPOSITION_1300 - * @tc.name test rect set-position api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(RectTest, Graphic_Rect_Test_SetPosition_1300, Function | MediumTest | Level0) -{ - Rect* rect = new Rect(); - rect->SetRect(100, 200, 300, 400); - rect->SetPosition(200, 300); - - EXPECT_EQ(rect->GetLeft(), 200); - EXPECT_EQ(rect->GetRight(), 400); - EXPECT_EQ(rect->GetTop(), 300); - EXPECT_EQ(rect->GetBottom(), 500); - - delete rect; -} - -/** - * @tc.number SUB_GRAPHIC_RECT_SETWIDTH_1400 - * @tc.name test rect set-width api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(RectTest, Graphic_Rect_Test_SetWidth_1400, Function | MediumTest | Level0) -{ - Rect* rect = new Rect(); - rect->SetRect(100, 200, 300, 400); - rect->SetWidth(300); - - EXPECT_EQ(rect->GetRight(), 399); - - delete rect; -} - -/** - * @tc.number SUB_GRAPHIC_RECT_SETHEIGHT_1500 - * @tc.name test rect set-height api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(RectTest, Graphic_Rect_Test_SetHeight_1500, Function | MediumTest | Level0) -{ - Rect* rect = new Rect(); - rect->SetRect(100, 200, 300, 400); - rect->SetHeight(300); - - EXPECT_EQ(rect->GetBottom(), 499); - - delete rect; -} - -/** - * @tc.number SUB_GRAPHIC_RECT_SETLEFT_1600 - * @tc.name test rect set-left api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(RectTest, Graphic_Rect_Test_SetLeft_1600, Function | MediumTest | Level0) -{ - Rect* rect = new Rect(); - rect->SetLeft(200); - - EXPECT_EQ(rect->GetLeft(), 200); - - delete rect; -} - -/** - * @tc.number SUB_GRAPHIC_RECT_SETTOP_1700 - * @tc.name test rect set-top api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(RectTest, Graphic_Rect_Test_SetTop_1700, Function | MediumTest | Level0) -{ - Rect* rect = new Rect(); - rect->SetTop(200); - - EXPECT_EQ(rect->GetTop(), 200); - - delete rect; -} - -/** - * @tc.number SUB_GRAPHIC_RECT_SETRIGHT_1800 - * @tc.name test rect set-right api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(RectTest, Graphic_Rect_Test_SetRight_1800, Function | MediumTest | Level0) -{ - Rect* rect = new Rect(); - rect->SetRight(200); - - EXPECT_EQ(rect->GetRight(), 200); - - delete rect; -} - -/** - * @tc.number SUB_GRAPHIC_RECT_SETBOTTOM_1900 - * @tc.name test rect set-bottom api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(RectTest, Graphic_Rect_Test_SetBottom_1900, Function | MediumTest | Level0) -{ - Rect* rect = new Rect(); - rect->SetBottom(200); - - EXPECT_EQ(rect->GetBottom(), 200); - - delete rect; -} - -/** - * @tc.number SUB_GRAPHIC_RECT_RESIZE_2000 - * @tc.name test rect resize api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(RectTest, Graphic_Rect_Test_Resize_2000, Function | MediumTest | Level0) -{ - Rect* rect = new Rect(); - rect->SetRect(100, 200, 300, 400); - rect->Resize(300, 300); - - EXPECT_EQ(rect->GetLeft(), 100); - EXPECT_EQ(rect->GetTop(), 200); - EXPECT_EQ(rect->GetRight(), 399); - EXPECT_EQ(rect->GetBottom(), 499); - - delete rect; -} - -/** - * @tc.number SUB_GRAPHIC_RECT_GETSIZE_2100 - * @tc.name test rect get-size api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(RectTest, Graphic_Rect_Test_GetSize_2100, Function | MediumTest | Level0) -{ - Rect* rect = new Rect(); - rect->SetRect(100, 200, 300, 400); - - EXPECT_EQ(rect->GetSize(), 40401); - - delete rect; -} - -/** - * @tc.number SUB_GRAPHIC_RECT_INTERSECT_2200 - * @tc.name test rect intersect api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(RectTest, Graphic_Rect_Test_Intersect_2200, Function | MediumTest | Level0) -{ - Rect* rect1 = new Rect(100, 200, 300, 400); - Rect* rect2 = new Rect(0, 0, 500, 600); - Rect* rect3 = new Rect(100, 500, 300, 600); - - EXPECT_EQ(rect1->Intersect(*rect1, *rect2), true); - EXPECT_EQ(rect1->Intersect(*rect1, *rect3), false); - - delete rect1; - delete rect2; - delete rect3; -} - -/** - * @tc.number SUB_GRAPHIC_RECT_JOIN_2300 - * @tc.name test rect join api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(RectTest, Graphic_Rect_Test_Join_2300, Function | MediumTest | Level0) -{ - Rect* rect1 = new Rect(100, 200, 300, 400); - Rect* rect2 = new Rect(0, 0, 500, 600); - Rect* rect3 = new Rect(100, 500, 300, 700); - - rect1->Join(*rect1, *rect2); - EXPECT_EQ(rect1->GetLeft(), 0); - EXPECT_EQ(rect1->GetTop(), 0); - EXPECT_EQ(rect1->GetRight(), 500); - EXPECT_EQ(rect1->GetBottom(), 600); - - rect1->Join(*rect1, *rect3); - EXPECT_EQ(rect1->GetLeft(), 0); - EXPECT_EQ(rect1->GetTop(), 0); - EXPECT_EQ(rect1->GetRight(), 500); - EXPECT_EQ(rect1->GetBottom(), 700); - - - delete rect1; - delete rect2; - delete rect3; -} - -/** - * @tc.number SUB_GRAPHIC_RECT_ISCONTAINS_2400 - * @tc.name test rect judge-whether-contains api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(RectTest, Graphic_Rect_Test_IsContains_2400, Function | MediumTest | Level0) -{ - Rect* rect1 = new Rect(100, 200, 300, 400); - Vector2 pt1 = { 200, 300 }; - Vector2 pt2 = { 0, 0 }; - - EXPECT_EQ(rect1->IsContains(pt1), true); - EXPECT_EQ(rect1->IsContains(pt2), false); - - delete rect1; -} - -/** - * @tc.number SUB_GRAPHIC_RECT_ISCONTAINS_2500 - * @tc.name test rect judge-whether-contains2 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(RectTest, Graphic_Rect_Test_IsContains_2500, Function | MediumTest | Level0) -{ - Rect* rect1 = new Rect(100, 200, 300, 400); - Point pt1; - pt1.x = 200; - pt1.y = 300; - Point pt2; - pt2.x = 0; - pt2.y = 0; - - EXPECT_EQ(rect1->IsContains(pt1), true); - EXPECT_EQ(rect1->IsContains(pt2), false); - - delete rect1; -} - -/** - * @tc.number SUB_GRAPHIC_RECT_ISINTERSECT_2600 - * @tc.name test rect judge-whether-intersect api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(RectTest, Graphic_Rect_Test_IsIntersect_2600, Function | MediumTest | Level0) -{ - Rect* rect1 = new Rect(100, 200, 300, 400); - Rect* rect2 = new Rect(0, 0, 500, 600); - Rect* rect3 = new Rect(100, 500, 300, 700); - - EXPECT_EQ(rect1->IsIntersect(*rect2), true); - EXPECT_EQ(rect1->IsIntersect(*rect3), false); - - delete rect1; - delete rect2; - delete rect3; -} - -/** - * @tc.number SUB_GRAPHIC_RECT_ISCONTAINS_2700 - * @tc.name test rect judge-whether-contains3 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(RectTest, Graphic_Rect_Test_IsContains_2700, Function | MediumTest | Level0) -{ - Rect* rect1 = new Rect(100, 200, 300, 400); - Rect* rect2 = new Rect(0, 0, 500, 600); - Rect* rect3 = new Rect(100, 500, 300, 700); - - EXPECT_EQ(rect2->IsContains(*rect1), true); - EXPECT_EQ(rect2->IsContains(*rect3), false); - - delete rect1; - delete rect2; - delete rect3; -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/graphic_utils/sys_info_posix/BUILD.gn b/graphic_lite/graphic_utils/sys_info_posix/BUILD.gn deleted file mode 100755 index 9cbf70ba5..000000000 --- a/graphic_lite/graphic_utils/sys_info_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsSysInfoTest") { - suite_name = "acts" - sources = [ "src/sys_info_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/graphic_utils/sys_info_posix/Test.json b/graphic_lite/graphic_utils/sys_info_posix/Test.json deleted file mode 100644 index 3761fa0a4..000000000 --- a/graphic_lite/graphic_utils/sys_info_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsSysInfoTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/graphic_utils/sys_info_posix/src/sys_info_test.cpp b/graphic_lite/graphic_utils/sys_info_posix/src/sys_info_test.cpp deleted file mode 100755 index 5b27bec92..000000000 --- a/graphic_lite/graphic_utils/sys_info_posix/src/sys_info_test.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "../utils/sys_info.h" - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class SysInfoTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -class OnFPSChangedInstance : public SysInfo::OnFPSChangedListener { - void OnFPSChanged(float newFPS) override - { - return; - } -}; - -/** - * @tc.number SUB_GRAPHIC_SYSINFO_FPSCALCULATETYPE_0100 - * @tc.name test themes-manager FPS-calculate-type api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(SysInfoTest, Graphic_SysInfo_Test_FPSCalculateType_0100, Function | MediumTest | Level0) -{ - SysInfo::FPSCalculateType type; - auto* fpsChangedListener = new OnFPSChangedInstance; - fpsChangedListener->SetFPSCalculateType(type); - EXPECT_EQ(fpsChangedListener->GetFPSCalculateType(), type); - delete fpsChangedListener; -} - -/** - * @tc.number SUB_GRAPHIC_SYSINFO_GETFPS_0200 - * @tc.name test themes-manager get-FPS api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(SysInfoTest, Graphic_SysInfo_Test_GetFPS_0200, Function | MediumTest | Level0) -{ - float value = 0.0; - value = SysInfo::GetFPS(); - EXPECT_EQ(0, 0); -} - -/** - * @tc.number SUB_GRAPHIC_SYSINFO_REGISTERFPSCHANGEDLISTENER_0300 - * @tc.name test themes-manager register-FPS-changed-listener api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(SysInfoTest, Graphic_SysInfo_Test_RegisterFPSChangedListener_0300, Function | MediumTest | Level0) -{ - auto* fpsChangedListener = new OnFPSChangedInstance; - SysInfo::RegisterFPSChangedListener(fpsChangedListener); - EXPECT_EQ(0, 0); - delete fpsChangedListener; -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/graphic_utils/transform_posix/BUILD.gn b/graphic_lite/graphic_utils/transform_posix/BUILD.gn deleted file mode 100755 index f0858fe22..000000000 --- a/graphic_lite/graphic_utils/transform_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsTransformTest") { - suite_name = "acts" - sources = [ "src/transform_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/graphic_utils/transform_posix/Test.json b/graphic_lite/graphic_utils/transform_posix/Test.json deleted file mode 100644 index 7980f2d1a..000000000 --- a/graphic_lite/graphic_utils/transform_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsTransformTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/graphic_utils/transform_posix/src/transform_test.cpp b/graphic_lite/graphic_utils/transform_posix/src/transform_test.cpp deleted file mode 100755 index 70a7373ca..000000000 --- a/graphic_lite/graphic_utils/transform_posix/src/transform_test.cpp +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "gfx_utils/transform.h" -#include -#include - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class TransformTest : public testing::Test { -public: - static void SetUpTestCase(void); - static void TearDownTestCase(void); -}; - -void TransformTest::SetUpTestCase() -{ - return; -} - -void TransformTest::TearDownTestCase() -{ - return; -} - -/** - * @tc.number SUB_GRAPHIC_TRANSFORM_SETPOLYGON_0100 - * @tc.name test transform set-polygon api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TransformTest, Graphic_Transform_Test_SetPolygon_0100, Function | MediumTest | Level0) -{ - TransformMap *transform = new TransformMap(); - Polygon poly; - uint8_t vertexNum = 8; - poly.SetVertexNum(vertexNum); - transform->SetPolygon(poly); - EXPECT_EQ(transform->GetPolygon().GetVertexNum(), vertexNum); - delete transform; -} - -/** - * @tc.number SUB_GRAPHIC_TRANSFORM_GETPIVOT_0200 - * @tc.name test transform get-pivot api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TransformTest, Graphic_Transform_Test_GetPivot_0200, Function | MediumTest | Level0) -{ - TransformMap *transform = new TransformMap(); - - EXPECT_EQ(transform->GetPivot().x_, 0); - EXPECT_EQ(transform->GetPivot().y_, 0); - delete transform; -} - -/** - * @tc.number SUB_GRAPHIC_TRANSFORM_GETCLOCKWISE_0300 - * @tc.name test transform get-clockwise api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TransformTest, Graphic_Transform_Test_GetClockWise_0300, Function | MediumTest | Level0) -{ - TransformMap *transform = new TransformMap(); - transform->GetPolygon().SetVertexNum(2); // 2 < VERTEX_NUM_MIN - EXPECT_EQ(transform->GetClockWise(), false); - delete transform; -} - -/** - * @tc.number SUB_GRAPHIC_TRANSFORM_ISINVALID_0400 - * @tc.name test transform judge-whether-invalid api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TransformTest, Graphic_Transform_Test_IsInvalid_0400, Function | MediumTest | Level0) -{ - TransformMap *transform = new TransformMap(); - EXPECT_EQ(transform->IsInvalid(), true); - delete transform; -} - -/** - * @tc.number SUB_GRAPHIC_TRANSFORM_ISINVALID_0500 - * @tc.name test transform judge-whether-invalid2 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TransformTest, Graphic_Transform_Test_IsInvalid_0500, Function | MediumTest | Level0) -{ - TransformMap *transform = new TransformMap(Rect(100, 200, 300, 400)); - EXPECT_EQ(transform->IsInvalid(), true); - delete transform; -} - -/** - * @tc.number SUB_GRAPHIC_TRANSFORM_GETTRANSMAPRECT_0600 - * @tc.name test transform get-transmaprect api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TransformTest, Graphic_Transform_Test_GetTransMapRect_0600, Function | MediumTest | Level0) -{ - TransformMap *transform = new TransformMap(Rect(100, 200, 300, 400)); - EXPECT_EQ(transform->GetTransMapRect().GetLeft(), 100); - EXPECT_EQ(transform->GetTransMapRect().GetTop(), 200); - EXPECT_EQ(transform->GetTransMapRect().GetRight(), 300); - EXPECT_EQ(transform->GetTransMapRect().GetBottom(), 400); - delete transform; -} - -/** - * @tc.number SUB_GRAPHIC_TRANSFORM_GETBOXRECT_0700 - * @tc.name test transform getboxrect api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TransformTest, Graphic_Transform_Test_GetBoxRect_0700, Function | MediumTest | Level0) -{ - TransformMap *transform = new TransformMap(Rect(100, 200, 300, 400)); - EXPECT_EQ(transform->GetBoxRect().GetLeft(), 100); - EXPECT_EQ(transform->GetBoxRect().GetTop(), 200); - EXPECT_EQ(transform->GetBoxRect().GetRight(), 300); - EXPECT_EQ(transform->GetBoxRect().GetBottom(), 400); - delete transform; -} - -/** - * @tc.number SUB_GRAPHIC_TRANSFORM_ROTATE_0800 - * @tc.name test transform rotate api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TransformTest, Graphic_Transform_Test_Rotate_0800, Function | MediumTest | Level0) -{ - TransformMap *transform = new TransformMap(); - int16_t angle = 0; - Vector2 pivot = {0, 0}; - transform->Rotate(angle, pivot); - EXPECT_EQ(0, 0); - delete transform; -} - -/** - * @tc.number SUB_GRAPHIC_TRANSFORM_SCAL_0900 - * @tc.name test transform scal api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TransformTest, Graphic_Transform_Test_Scal_0900, Function | MediumTest | Level0) -{ - TransformMap *transform = new TransformMap(); - Vector2 scale = {0, 0}; - Vector2 pivot = {0, 0}; - transform->Scale(scale, pivot); - EXPECT_EQ(0, 0); - delete transform; -} - -/** - * @tc.number SUB_GRAPHIC_TRANSFORM_ROTATE_1000 - * @tc.name test transform rotate2 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TransformTest, Graphic_Transform_Test_Rotate_1000, Function | MediumTest | Level0) -{ - Vector2 point = {0, 0}; - int16_t angle = 0; - Vector2 pivot = {0, 0}; - Vector2 out = {0, 0}; - Rotate(point, angle, pivot, out); - EXPECT_EQ(0, 0); -} - -/** - * @tc.number SUB_GRAPHIC_TRANSFORM_ROTATE_1100 - * @tc.name test transform rotate3 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TransformTest, Graphic_Transform_Test_Rotate_1100, Function | MediumTest | Level0) -{ - Line* origLine = new Line(); - int16_t angle = 0; - Vector2 pivot = {0, 0}; - Line* out =new Line(); - Rotate(*origLine, angle, pivot, *out); - EXPECT_EQ(0, 0); - delete out; - delete origLine; -} - -/** - * @tc.number SUB_GRAPHIC_TRANSFORM_ROTATE_1200 - * @tc.name test transform rotate4 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TransformTest, Graphic_Transform_Test_Rotate_1200, Function | MediumTest | Level0) -{ - Rect* origRect = new Rect(); - int16_t angle = 0; - Vector2 pivot = {0, 0}; - Polygon* out =new Polygon(); - Rotate(*origRect, angle, pivot, *out); - EXPECT_EQ(0, 0); - delete out; - delete origRect; -} -} // namespace OHOS diff --git a/graphic_lite/graphic_utils/version_posix/BUILD.gn b/graphic_lite/graphic_utils/version_posix/BUILD.gn deleted file mode 100755 index be39c4217..000000000 --- a/graphic_lite/graphic_utils/version_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsGraphVersionTest") { - suite_name = "acts" - sources = [ "src/version_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/graphic_utils/version_posix/Test.json b/graphic_lite/graphic_utils/version_posix/Test.json deleted file mode 100755 index ce0c3539c..000000000 --- a/graphic_lite/graphic_utils/version_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsGraphVersionTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/graphic_utils/version_posix/src/version_test.cpp b/graphic_lite/graphic_utils/version_posix/src/version_test.cpp deleted file mode 100755 index 97a5f4ca6..000000000 --- a/graphic_lite/graphic_utils/version_posix/src/version_test.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "gfx_utils/version.h" - -#include -#include - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class VersionTest : public testing::Test { -public: - static void SetUpTestCase(void); - static void TearDownTestCase(void); -}; - -void VersionTest::SetUpTestCase() -{ - return; -} - -void VersionTest::TearDownTestCase() -{ - return; -} - -/** - * @tc.number SUB_GRAPHIC_VERSION_GETVERSION_0100 - * @tc.name test version get-version api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(VersionTest, Graphic_VersionTest_Test_GetVersion_0100, Function | MediumTest | Level0) -{ - GetVersion(); - EXPECT_EQ(0, 0); -} - -/** - * @tc.number SUB_GRAPHIC_VERSION_GETLIBDSC_0200 - * @tc.name test version get-lib-dsc api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(VersionTest, Graphic_VersionTest_Test_GetLibDsc_0200, Function | MediumTest | Level0) -{ - GetLibDsc(); - EXPECT_EQ(0, 0); -} -} \ No newline at end of file diff --git a/graphic_lite/surface/BUILD.gn b/graphic_lite/surface/BUILD.gn deleted file mode 100755 index 560eab618..000000000 --- a/graphic_lite/surface/BUILD.gn +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -group("uikit_test2") { - deps = [ - "//test/xts/acts/graphic_lite/surface/surface_posix:ActsSurfaceTest", - ] -} diff --git a/graphic_lite/surface/surface_posix/BUILD.gn b/graphic_lite/surface/surface_posix/BUILD.gn deleted file mode 100755 index d5aacb3e6..000000000 --- a/graphic_lite/surface/surface_posix/BUILD.gn +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsSurfaceTest") { - suite_name = "acts" - sources = [ - "src/surface_test.cpp", - #"src/surface_surface_test.cpp" - ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/surface/surface_posix/Test.json b/graphic_lite/surface/surface_posix/Test.json deleted file mode 100644 index 30810bf49..000000000 --- a/graphic_lite/surface/surface_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsSurfaceTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/surface/surface_posix/src/surface_surface_test.cpp b/graphic_lite/surface/surface_posix/src/surface_surface_test.cpp deleted file mode 100755 index 18fd04762..000000000 --- a/graphic_lite/surface/surface_posix/src/surface_surface_test.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "surface_buffer.h" - -#include -#include - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class SurfaceSurfaceTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_SURFACE_SURFACE_GETVIRADDR_0100 - * @tc.name test surface-surface get-vir-addr api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(SurfaceSurfaceTest, Graphic_SurfaceSurface_Test_GetVirAddr_0100, Function | MediumTest | Level0) -{ - Surface* surfaceVar = new Surface(); - surfaceVar->GetVirAddr(); - EXPECT_EQ(0, 0); - - delete surfaceVar; -} - -/** - * @tc.number SUB_GRAPHIC_SURFACE_SURFACE_INT32_0200 - * @tc.name test surface int32 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(SurfaceSurfaceTest, Graphic_SurfaceSurface_Test_Int32_0200, Function | MediumTest | Level0) -{ - Surface* surfaceVar = new Surface(); - uint32_t key = 0x00001000; - int32_t value = 0x00002000; - int32_t testReturn = surfaceVar->SetInt32(key, value); - if (testReturn) { - EXPECT_EQ(surfaceVar->GetInt32(key, value), value); - } - delete surfaceVar; -} - -/** - * @tc.number SUB_GRAPHIC_SURFACE_SURFACE_INT64_0300 - * @tc.name test surface int64 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(SurfaceSurfaceTest, Graphic_SurfaceSurface_Test_Int64_0300, Function | MediumTest | Level0) -{ - Surface* surfaceVar = new Surface(); - uint32_t key = 0x00001000; - int64_t value_ = 0x0000000000002000; - int64_t testReturn = surfaceVar->SetInt64(key, value); - if (testReturn) { - EXPECT_EQ(surfaceVar->GetInt32(key, value), value); - } - delete surfaceVar; -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/surface/surface_posix/src/surface_test.cpp b/graphic_lite/surface/surface_posix/src/surface_test.cpp deleted file mode 100755 index ed2ed00b6..000000000 --- a/graphic_lite/surface/surface_posix/src/surface_test.cpp +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "buffer_common.h" -#include "surface.h" -#include "surface_impl.h" -#include -#include - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class SurfaceTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_SURFACE_FORMAT_0100 - * @tc.name test surface format api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(SurfaceTest, Graphic_Surface_Test_Format_0100, Function | MediumTest | Level0) -{ - uint32_t format = 0x00001000; - Surface* surface = Surface::CreateSurface(); - if (surface != nullptr) { - surface->SetFormat(format); - surface->GetFormat(); - delete surface; - } - EXPECT_EQ(0, 0); -} - -/** - * @tc.number SUB_GRAPHIC_SURFACE_SIZE_0200 - * @tc.name test surface size api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(SurfaceTest, Graphic_Surface_Test_Size_0200, Function | MediumTest | Level0) -{ - uint32_t size = 0x00001000; - Surface* surface = Surface::CreateSurface(); - if (surface != nullptr) { - surface->SetSize(size); - } - if (surface != nullptr) { - EXPECT_EQ(surface->GetSize(), size); - } - delete surface; -} - -/** - * @tc.number SUB_GRAPHIC_SURFACE_STRIDEALIGNMENT_0300 - * @tc.name test surface stride-alignment api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(SurfaceTest, Graphic_Surface_Test_StrideAlignment_0300, Function | MediumTest | Level0) -{ - uint32_t strideAlignment = 0x00001000; - Surface* surface = Surface::CreateSurface(); - if (surface != nullptr) { - surface->SetStrideAlignment(strideAlignment); - surface->GetStrideAlignment(); - delete surface; - } - EXPECT_EQ(0, 0); -} - -/** - * @tc.number SUB_GRAPHIC_SURFACE_USAGE_0400 - * @tc.name test surface usage api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(SurfaceTest, Graphic_Surface_Test_Usage_0400, Function | MediumTest | Level0) -{ - uint32_t usage = 0x00001000; - Surface* surface = Surface::CreateSurface(); - if (surface != nullptr) { - surface->SetUsage(usage); - surface->GetUsage(); - delete surface; - } - EXPECT_EQ(0, 0); -} - -/** - * @tc.number SUB_GRAPHIC_SURFACE_RELEASEBUFFER_0500 - * @tc.name test surface release-buffer api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(SurfaceTest, Graphic_Surface_Test_ReleaseBuffer_0500, Function | MediumTest | Level0) -{ - Surface* surface = Surface::CreateSurface(); - if (surface != nullptr) { - surface->AcquireBuffer(); - delete surface; - } - EXPECT_EQ(0, 0); -} - -/** - * @tc.number SUB_GRAPHIC_SURFACE_FLUSHBUFFER_0600 - * @tc.name test surface flush-buffer api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(SurfaceTest, Graphic_Surface_Test_FlushBuffer_0600, Function | MediumTest | Level0) -{ - Surface* surface = Surface::CreateSurface(); - if (surface != nullptr) { - surface->SetSize(1024); - SurfaceBuffer* buffer = surface->RequestBuffer(); - surface->ReleaseBuffer(buffer); - delete surface; - } - EXPECT_EQ(0, 0); -} - -/** - * @tc.number SUB_GRAPHIC_SURFACE_ACQUIREBUFFER_0700 - * @tc.name test surface acquire-buffer api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(SurfaceTest, Graphic_Surface_Test_AcquireBuffer_0700, Function | MediumTest | Level0) -{ - Surface* surface = Surface::CreateSurface(); - if (surface != nullptr) { - surface->AcquireBuffer(); - } - EXPECT_EQ(0, 0); - delete surface; -} - -/** - * @tc.number SUB_GRAPHIC_SURFACE_REQUESTBUFFER_0800 - * @tc.name test surface request-buffer api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(SurfaceTest, Graphic_Surface_Test_RequestBuffer_0800, Function | MediumTest | Level0) -{ - uint8_t wait = 100; - Surface* surface = Surface::CreateSurface(); - if (surface != nullptr) { - surface->RequestBuffer(wait); - } - EXPECT_EQ(0, 0); - delete surface; -} - -/** - * @tc.number SUB_GRAPHIC_SURFACE_CANCELBUFFER_0900 - * @tc.name test surface cancel-buffer api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(SurfaceTest, Graphic_Surface_Test_CancelBuffer_0900, Function | MediumTest | Level0) -{ - Surface* surface = Surface::CreateSurface(); - if (surface != nullptr) { - surface->SetSize(1024); - SurfaceBuffer* buffer = surface->RequestBuffer(); - surface->CancelBuffer(buffer); - } - EXPECT_EQ(0, 0); - delete surface; -} - - -/** - * @tc.number SUB_GRAPHIC_SURFACE_USERDATA_1000 - * @tc.name test surface user-data api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(SurfaceTest, Graphic_Surface_Test_UserData_1000, Function | MediumTest | Level0) -{ - std::string key = "testWord"; - std::string value = "testValue"; - Surface* surface = Surface::CreateSurface(); - if (surface != nullptr) { - surface->SetUserData(key, value); - } - if (surface != nullptr) { - EXPECT_EQ(surface->GetUserData(key), value); - } - delete surface; -} - -/** - * @tc.number SUB_GRAPHIC_SURFACE_GETSTRIDE_1100 - * @tc.name test surface get-stride api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(SurfaceTest, Graphic_Surface_Test_GetStride_1100, Function | MediumTest | Level0) -{ - Surface* surface = Surface::CreateSurface(); - if (surface != nullptr) { - surface->GetStride(); - } - EXPECT_EQ(0, 0); - delete surface; -} - -/** - * @tc.number SUB_GRAPHIC_SURFACE_SETWIDTHANDHEIGHT_1200 - * @tc.name test surface set-width-and-height api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(SurfaceTest, Graphic_Surface_Test_SetWidthAndHeight_1200, Function | MediumTest | Level0) -{ - uint32_t width = 0x00000200; - uint32_t height = 0x00000100; - Surface* surface = Surface::CreateSurface(); - if (surface != nullptr) { - surface->SetWidthAndHeight(width, height); - } - EXPECT_EQ(0, 0); - delete surface; -} - -/** - * @tc.number SUB_GRAPHIC_SURFACE_SETQUEUESIZE_1300 - * @tc.name test surface set-queue-size api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(SurfaceTest, Graphic_Surface_Test_SetQueueSize_1300, Function | MediumTest | Level0) -{ - uint8_t queueSize = 100; - Surface* surface = Surface::CreateSurface(); - if (surface != nullptr) { - surface->SetQueueSize(queueSize); - } - EXPECT_EQ(0, 0); - delete surface; -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/BUILD.gn b/graphic_lite/ui/BUILD.gn deleted file mode 100755 index 907dcfed4..000000000 --- a/graphic_lite/ui/BUILD.gn +++ /dev/null @@ -1,64 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -group("uikit_test3") { - deps = [ - "//test/xts/acts/graphic_lite/ui/a:ActsUiInterfaceTest", - "//test/xts/acts/graphic_lite/ui/animator_posix:ActsAnimatorTest", - "//test/xts/acts/graphic_lite/ui/easing_equation_posix:ActsEasingEquationTest", - "//test/xts/acts/graphic_lite/ui/events_posix:ActsEventsTest", - "//test/xts/acts/graphic_lite/ui/flexlayout_posix:ActsFlexlaoutTest", - "//test/xts/acts/graphic_lite/ui/gridlayout_posix:ActsGridLayoutTest", - "//test/xts/acts/graphic_lite/ui/image_posix:ActsImageTest", - "//test/xts/acts/graphic_lite/ui/interpolation_posix:ActsInterpoliationTest", - "//test/xts/acts/graphic_lite/ui/layout_posix:ActsLayoutTest", - "//test/xts/acts/graphic_lite/ui/listlayout_posix:ActsListlayoutTest", - "//test/xts/acts/graphic_lite/ui/screen_posix:ActsScreenTest", - "//test/xts/acts/graphic_lite/ui/style_posix:ActsStyleTest", - "//test/xts/acts/graphic_lite/ui/theme_posix:ActsThemeTest", - "//test/xts/acts/graphic_lite/ui/ui_abstract_progress_posix:ActsUIAbstractProgressTest", - "//test/xts/acts/graphic_lite/ui/ui_analog_clock_posix:ActsUIAnalogClockTest", - "//test/xts/acts/graphic_lite/ui/ui_arc_lable_posix:ActsUIArcLabelTest", - "//test/xts/acts/graphic_lite/ui/ui_axis_posix:ActsUIAxisTest", - "//test/xts/acts/graphic_lite/ui/ui_box_porgress_posix:ActsUIBoxProgressTest", - "//test/xts/acts/graphic_lite/ui/ui_button_posix:ActsUIButtonTest", - "//test/xts/acts/graphic_lite/ui/ui_canvas_posix:ActsUICanvasTest", - "//test/xts/acts/graphic_lite/ui/ui_chart_posix:ActsUIChartTest", - "//test/xts/acts/graphic_lite/ui/ui_checbox_posix:ActsUICheckboxTest", - "//test/xts/acts/graphic_lite/ui/ui_circle_progress_posix:ActsUICircleProgressTest", - "//test/xts/acts/graphic_lite/ui/ui_digital_clock_posix:ActsUIDigitalClockTest", - "//test/xts/acts/graphic_lite/ui/ui_image_animator_posix:ActsUIImageAnimatorTest", - "//test/xts/acts/graphic_lite/ui/ui_image_posix:ActsUIImageTest", - "//test/xts/acts/graphic_lite/ui/ui_label_button_posix:ActsUILabelButtonTest", - "//test/xts/acts/graphic_lite/ui/ui_label_posix:ActsUILabelTest", - "//test/xts/acts/graphic_lite/ui/ui_list_posix:ActsUIListTest", - "//test/xts/acts/graphic_lite/ui/ui_picker_posix:ActsUIPickerTest", - "//test/xts/acts/graphic_lite/ui/ui_radio_button_posix:ActsUIRadioButtonTest", - "//test/xts/acts/graphic_lite/ui/ui_repeat_button_posix:ActsUIRepeatButtonTest", - "//test/xts/acts/graphic_lite/ui/ui_screenshot_posix:ActsUIScreenshotTest", - "//test/xts/acts/graphic_lite/ui/ui_scroll_view_posix:ActsUIScrollViewTest", - "//test/xts/acts/graphic_lite/ui/ui_slider_posix:ActsUISliderTest", - "//test/xts/acts/graphic_lite/ui/ui_surface_view_posix:ActsUISurfaceViewTest", - "//test/xts/acts/graphic_lite/ui/ui_swipe_view_posix:ActsUISwipeViewTest", - "//test/xts/acts/graphic_lite/ui/ui_text_posix:ActsUITextTest", - "//test/xts/acts/graphic_lite/ui/ui_texture_mapper_posix:ActsUITextureMapperTest", - "//test/xts/acts/graphic_lite/ui/ui_time_picker_posix:ActsUITimePickerTest", - "//test/xts/acts/graphic_lite/ui/ui_toggle_button_posix:ActsUIToggleButtonTest", - "//test/xts/acts/graphic_lite/ui/ui_view_group_posix:ActsUIViewGroupTest", - "//test/xts/acts/graphic_lite/ui/ui_view_posix:ActsUIViewTest", - "//test/xts/acts/graphic_lite/ui/uianimator_posix:ActsUIAnimatorTest", - - #"//test/xts/acts/graphic_lite/ui/uidfx_posix:ActsUIDfxTest", - #"//test/xts/acts/graphic_lite/ui/uifont_posix:ActsUIFontTest", - ] -} diff --git a/graphic_lite/ui/a/BUILD.gn b/graphic_lite/ui/a/BUILD.gn deleted file mode 100755 index bee6356f6..000000000 --- a/graphic_lite/ui/a/BUILD.gn +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build/lite/config/component/lite_component.gni") -import("//build/lite/config/subsystem/graphic/config.gni") -import("//build/lite/ndk/ndk.gni") -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUiInterfaceTest") { - suite_name = "acts" - if (enable_graphic_font) { - sources = [ - "src/UiInterfaceTest.cpp", - "src/window_test.cpp", - ] - } else { - sources = [ "src/UiInterfaceTest.cpp" ] - } - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/a/Test.json b/graphic_lite/ui/a/Test.json deleted file mode 100755 index e13fc4c83..000000000 --- a/graphic_lite/ui/a/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "ui interface coverage filled", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUiInterfaceTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/a/src/UiInterfaceTest.cpp b/graphic_lite/ui/a/src/UiInterfaceTest.cpp deleted file mode 100755 index 21cce6429..000000000 --- a/graphic_lite/ui/a/src/UiInterfaceTest.cpp +++ /dev/null @@ -1,965 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "UiInterfaceTest.h" - -#include "common/graphic_startup.h" -#include "components/root_view.h" -#include "components/text_adapter.h" -#include "components/ui_abstract_clock.h" -#include "components/ui_analog_clock.h" -#include "components/ui_axis.h" -#include "components/ui_button.h" -#include "components/ui_canvas.h" -#include "components/ui_checkbox.h" -#include "components/ui_image_animator.h" -#include "components/ui_scroll_view.h" -#include "components/ui_swipe_view.h" -#include "components/ui_time_picker.h" -#include "components/ui_view.h" -#include "components/ui_view_group.h" -#include "dfx/event_injector.h" -#include "dfx/ui_screenshot.h" -#include "events/aod_callback.h" -#include "events/press_event.h" -#include "events/virtual_device_event.h" -#include "gfx_utils/graphic_math.h" -#include "themes/theme_manager.h" -#include "window/window.h" - -#include -#include - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class UiInterfaceTest : public testing::Test { -public: - static void SetUpTestCase(void){} - static void TearDownTestCase(void){} -}; - -class TestListener : public OHOS::UICheckBox::OnChangeListener { -public: - bool OnChange(UICheckBox::UICheckBoxState state) override - { - return true; - } -}; - -class TestAnimatorCallback : public AnimatorCallback { -public: - TestAnimatorCallback() {} - - ~TestAnimatorCallback() {} - - void Callback(UIView* view) override {} -}; - -class Font { -public: - void SetDynamicFontId() const {}; - void SetAnimatorSpeed() const {}; - void GetLongMode() const {}; - void Scal() const {}; - void Itoa() const {}; - void GetCrossPoint() const {}; - void IsLineSegmentCross() const {}; - void IsRectCross() const {}; - void SetOnChangeListener() const {}; - void SetLineAndTextOpacity() const {}; - void OnClickEventHappen() const {}; -}; - -class KeyActListener { -public: - void OnDragEndEventHappen() const {}; - void OnLongPressEventHappen() const {}; - void OnFPSChangedListener() const {}; - void OnFPSChanged() const {}; - void GetFPS() const {}; - void RegisterFPSChangedListener() const {}; - void CreateSurface() const {}; - void GetQueueSize() const {}; - void RegisterConsumerListener() const {}; - void UnregisterConsumerListener() const {}; - void GetInt64() const {}; - void GetSurface() const {}; - void OnKeyAct() const {}; - void OnKeyEvent() const {}; - void SetOnKeyActListener() const {}; - void ClearOnKeyActListener() const {}; -}; - -class RootViewManage { -public: - void OnVirtualDeviceEvent() const {}; - void SetOnVirtualDeviceEventListener() const {}; - void ClearOnVirtualDeviceEventListener() const {}; - void EnableCursor() const {}; - void GetCursor() const {}; - void DrawTop() const {}; - void GetTopUIView() const {}; - void FindSubView() const {}; - void SetFilePath() const {}; -}; -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_0100 - * @tc.name test InvalidateRect api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_0100, Function | MediumTest | Level0) -{ - UIView* view = new UIView(); - view->InvalidateRect(view->GetRect()); - EXPECT_EQ(0, 0); -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_0200 - * @tc.name test OnLongPressEvent api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_0200, Function | MediumTest | Level0) -{ - UIView* view = new UIView(); - Point initPos = {100, 200}; - TimeType timeStamp = 10; - LongPressEvent* longPressEvent = new LongPressEvent(initPos, timeStamp); - view->OnLongPressEvent(*longPressEvent); - EXPECT_EQ(0, 0); - delete longPressEvent; - delete view; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_0300 - * @tc.name test OnDragStartEvent api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_0300, Function | MediumTest | Level0) -{ - UIView* view = new UIView(); - Point initPos = {100, 200}; - DragEvent* dragEvent = new DragEvent(initPos, initPos, initPos); - view->OnDragStartEvent(*dragEvent); - EXPECT_EQ(0, 0); - delete dragEvent; - delete view; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_0400 - * @tc.name test OnDragEvent api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_0400, Function | MediumTest | Level0) -{ - UIView* view = new UIView(); - Point initPos = {100, 200}; - DragEvent* dragEvent = new DragEvent(initPos, initPos, initPos); - view->OnDragEvent(*dragEvent); - EXPECT_EQ(0, 0); - delete dragEvent; - delete view; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_0500 - * @tc.name test OnDragEndEvent api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_0500, Function | MediumTest | Level0) -{ - UIView* view = new UIView(); - Point initPos = {100, 200}; - DragEvent* dragEvent = new DragEvent(initPos, initPos, initPos); - view->OnDragEndEvent(*dragEvent); - EXPECT_EQ(0, 0); - delete dragEvent; - delete view; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_0600 - * @tc.name test OnPressEvent api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_0600, Function | MediumTest | Level0) -{ - UIView* view = new UIView(); - Point initPos = {100, 200}; - PressEvent* pressEvent = new PressEvent(initPos); - view->OnPressEvent(*pressEvent); - EXPECT_EQ(0, 0); - delete pressEvent; - delete view; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_0700 - * @tc.name test OnCancelEvent api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_0700, Function | MediumTest | Level0) -{ - UIView* view = new UIView(); - Point initPos = {100, 200}; - CancelEvent* cancelEvent = new CancelEvent(initPos); - view->OnCancelEvent(*cancelEvent); - EXPECT_EQ(0, 0); - delete cancelEvent; - delete view; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_0800 - * @tc.name test GetMaskedRect api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_0800, Function | MediumTest | Level0) -{ - UIView* view = new UIView(); - view->GetMaskedRect(); - EXPECT_EQ(0, 0); - delete view; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_0900 - * @tc.name test GetOrigRect api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_0900, Function | MediumTest | Level0) -{ - UIView* view = new UIView(); - view->GetOrigRect(); - EXPECT_EQ(0, 0); - delete view; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_1000 - * @tc.name test GetRelativeRect api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_1000, Function | MediumTest | Level0) -{ - UIView* view = new UIView(); - view->GetRelativeRect(); - EXPECT_EQ(0, 0); - delete view; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_1100 - * @tc.name test AlignVerCenterToSibling api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_1100, Function | MediumTest | Level0) -{ - UIView* view = new UIView(); - view->AlignVerCenterToSibling("refView"); - EXPECT_EQ(0, 0); - delete view; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_1200 - * @tc.name test GetStyleConst api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_1200, Function | MediumTest | Level0) -{ - UIView* view = new UIView(); - view->GetStyleConst(); - EXPECT_EQ(0, 0); - delete view; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_1300 - * @tc.name test TranslateToPixel api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_1300, Function | MediumTest | Level0) -{ - UIXAxis* axis = new UIXAxis(); - int16_t x = 12; - axis->TranslateToPixel(x); - EXPECT_EQ(0, 0); - delete axis; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_1400 - * @tc.name test SetAutoSize api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_1400, Function | MediumTest | Level0) -{ - UIViewGroup* group = new UIViewGroup(); - group->SetAutoSize(true); - EXPECT_EQ(0, 0); - delete group; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_1500 - * @tc.name test GetChildrenHead api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_1500, Function | MediumTest | Level0) -{ - UIViewGroup* group = new UIViewGroup(); - group->GetChildrenHead(); - EXPECT_EQ(0, 0); - delete group; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_1600 - * @tc.name test MoveChildByOffset api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_1600, Function | MediumTest | Level0) -{ - UIViewGroup* group = new UIViewGroup(); - group->MoveChildByOffset(1, 1); - EXPECT_EQ(0, 0); - delete group; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_1700 - * @tc.name test OnTimePickerStoped api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_1700, Function | MediumTest | Level0) -{ - UITimePicker::SelectedListener* listener = new UITimePicker::SelectedListener(); - UITimePicker* timePicker = new UITimePicker(); - listener->OnTimePickerStoped(*timePicker); - EXPECT_EQ(0, 0); - delete timePicker; - delete listener; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_1800 - * @tc.name test GetSelectSecond api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_1800, Function | MediumTest | Level0) -{ - UITimePicker* timePicker = new UITimePicker(); - timePicker->GetSelectSecond(); - EXPECT_EQ(0, 0); - delete timePicker; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_1900 - * @tc.name test GetSelectMinute api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_1900, Function | MediumTest | Level0) -{ - UITimePicker* timePicker = new UITimePicker(); - timePicker->GetSelectMinute(); - EXPECT_EQ(0, 0); - delete timePicker; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_2000 - * @tc.name test GetSelectHour api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_2000, Function | MediumTest | Level0) -{ - UITimePicker* timePicker = new UITimePicker(); - timePicker->GetSelectHour(); - EXPECT_EQ(0, 0); - delete timePicker; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_2100 - * @tc.name test GetSelectValue api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_2100, Function | MediumTest | Level0) -{ - UITimePicker* timePicker = new UITimePicker(); - timePicker->GetSelectValue(); - EXPECT_EQ(0, 0); - delete timePicker; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_2200 - * @tc.name test SetOnSwipeListener api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_2200, Function | MediumTest | Level0) -{ - UISwipeView* uiSwipeView = new UISwipeView(); - uiSwipeView->SetOnSwipeListener(uiSwipeView->GetOnSwipeListener()); - EXPECT_EQ(0, 0); - delete uiSwipeView; -} - - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_2300 - * @tc.name test OnScrollEnd api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_2300, Function | MediumTest | Level0) -{ - UIScrollView::OnScrollListener* listScrollListener = new UIScrollView::OnScrollListener(); - listScrollListener->OnScrollEnd(); - EXPECT_EQ(0, 0); - delete listScrollListener; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_2400 - * @tc.name test OnScrollStart api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_2400, Function | MediumTest | Level0) -{ - UIScrollView::OnScrollListener* listScrollListener = new UIScrollView::OnScrollListener(); - listScrollListener->OnScrollStart(); - EXPECT_EQ(0, 0); - delete listScrollListener; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_2500 - * @tc.name test RegisterScrollListener api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_2500, Function | MediumTest | Level0) -{ - UIScrollView* uiScrollView = new UIScrollView(); - UIScrollView::OnScrollListener* onScrollListener = new UIScrollView::OnScrollListener(); - uiScrollView->RegisterScrollListener(onScrollListener); - EXPECT_EQ(0, 0); - delete onScrollListener; - delete uiScrollView; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_2600 - * @tc.name test OnPickerStoped api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_2600, Function | MediumTest | Level0) -{ - UIPicker::SelectedListener* selectedListener = new UIPicker::SelectedListener(); - UIPicker* uiPicker = new UIPicker(); - selectedListener->OnPickerStoped(*uiPicker); - EXPECT_EQ(0, 0); - delete uiPicker; - delete selectedListener; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_2700 - * @tc.name test EnableAutoAlign api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_2700, Function | MediumTest | Level0) -{ - UIList* uiList = new UIList(); - uiList->EnableAutoAlign(true); - EXPECT_EQ(0, 0); - delete uiList; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_2800 - * @tc.name test GetText api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_2800, Function | MediumTest | Level0) -{ - UILabel* uiLabel = new UILabel(); - uiLabel->GetText(); - EXPECT_EQ(0, 0); - delete uiLabel; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_2900 - * @tc.name test VirtualDeviceEvent api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_2900, Function | MediumTest | Level0) -{ - VirtualDeviceEvent* virtualDeviceEvent = new VirtualDeviceEvent(1, 1); - EXPECT_EQ(0, 0); - delete virtualDeviceEvent; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_3000 - * @tc.name test PressEvent api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_3000, Function | MediumTest | Level0) -{ - Point* point = new Point(); - PressEvent* pressEvent = new PressEvent(*point); - EXPECT_EQ(0, 0); - delete point; - delete pressEvent; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_3100 - * @tc.name test DragEvent api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_3100, Function | MediumTest | Level0) -{ - Point* point = new Point(); - DragEvent* dragEvent = new DragEvent(*point, *point, *point); - EXPECT_EQ(0, 0); - delete dragEvent; - delete point; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_4600 - * @tc.name test GetCurImageSrc api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_4600, Function | MediumTest | Level0) -{ - UIButton* uiButton = new UIButton(); - uiButton->GetCurImageSrc(); - EXPECT_EQ(0, 0); - delete uiButton; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_4700 - * @tc.name test Paint api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_4700, Function | MediumTest | Level0) -{ - Paint* paint = new Paint(); - EXPECT_EQ(0, 0); - delete paint; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_4800 - * @tc.name test OnChange api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_4800, Function | MediumTest | Level0) -{ - auto* onChangeListener = new TestListener(); - UICheckBox::UICheckBoxState* state = new UICheckBox::UICheckBoxState(); - onChangeListener->OnChange(*state); - EXPECT_EQ(0, 0); - delete state; - delete onChangeListener; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_4900 - * @tc.name test SetOnChangeListener api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_4900, Function | MediumTest | Level0) -{ - UICheckBox* uICheckBox = new UICheckBox(); - uICheckBox->SetOnChangeListener(NULL); - EXPECT_EQ(0, 0); - delete uICheckBox; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_5000 - * @tc.name test GetOpacity api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_5000, Function | MediumTest | Level0) -{ - Paint* paint = new Paint(); - paint->GetOpacity(); - EXPECT_EQ(0, 0); - delete paint; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_5100 - * @tc.name test OnAnimatorStop api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_5100, Function | MediumTest | Level0) -{ - UIImageAnimatorView::AnimatorStopListener* animatorStopListener = new UIImageAnimatorView::AnimatorStopListener(); - UIView* uiView = new UIView(); - animatorStopListener->OnAnimatorStop(*uiView); - EXPECT_EQ(0, 0); - delete uiView; - delete animatorStopListener; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_5200 - * @tc.name test Callback api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_5200, Function | MediumTest | Level0) -{ - auto* animatorCallback = new TestAnimatorCallback(); - UIView* view = new UIView(); - animatorCallback->Callback(view); - EXPECT_EQ(0, 0); - delete view; - delete animatorCallback; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_5400 - * @tc.name test SetMarkNum api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_5400, Function | MediumTest | Level0) -{ - UIXAxis* uixAxis = new UIXAxis(); - uixAxis->SetMarkNum(0); - EXPECT_EQ(0, 0); - delete uixAxis; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_5500 - * @tc.name test GetCurrent api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_5500, Function | MediumTest | Level0) -{ - ThemeManager& themeManager = ThemeManager::GetInstance(); - themeManager.GetCurrent(); - EXPECT_EQ(0, 0); -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_5600 - * @tc.name test SetCurrent api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_5600, Function | MediumTest | Level0) -{ - ThemeManager& themeManager = ThemeManager::GetInstance(); - Theme* theme = themeManager.GetCurrent(); - themeManager.SetCurrent(theme); - EXPECT_EQ(0, 0); -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_6000 - * @tc.name test GetCount api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_6000, Function | MediumTest | Level0) -{ - TextAdapter* textAdapter = new TextAdapter(); - textAdapter->GetCount(); - EXPECT_EQ(0, 0); - delete textAdapter; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_6100 - * @tc.name test GetView api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_6100, Function | MediumTest | Level0) -{ - TextAdapter* textAdapter = new TextAdapter(); - UIView* inView = new UIView(); - int16_t index = 1; - Font* font = new Font(); - font->SetDynamicFontId(); - font->SetAnimatorSpeed(); - font->GetLongMode(); - textAdapter->GetView(inView, index); - EXPECT_EQ(0, 0); - delete font; - delete inView; - delete textAdapter; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_6200 - * @tc.name test DeleteView api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_6200, Function | MediumTest | Level0) -{ - TextAdapter* textAdapter = new TextAdapter(); - UIView* view = new UIView(); - Font* font = new Font(); - font->Scal(); - font->Itoa(); - font->GetCrossPoint(); - textAdapter->DeleteView(view); - EXPECT_EQ(0, 0); - delete font; - delete view; - delete textAdapter; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_6300 - * @tc.name test OnPostDraw api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_6300, Function | MediumTest | Level0) -{ - UIView* uiView = new UIView(); - Rect* rect = new Rect(); - Font* font = new Font(); - font->IsLineSegmentCross(); - font->IsRectCross(); - font->SetOnChangeListener(); - uiView->OnPostDraw(*rect); - EXPECT_EQ(0, 0); - delete font; - delete rect; - delete uiView; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_6400 - * @tc.name test DrawArc api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_6400, Function | MediumTest | Level0) -{ - UICanvas* canvas = new UICanvas(); - Paint paint; - Font* font = new Font(); - font->SetLineAndTextOpacity(); - font->OnClickEventHappen(); - canvas->DrawArc({100, 150}, 50, 135, 270, paint); - EXPECT_EQ(0, 0); - delete font; - delete canvas; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_6500 - * @tc.name test SetData api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_6500, Function | MediumTest | Level0) -{ - List* adapterData = new List(); - TextAdapter* adapter = new TextAdapter(); - auto* keyActListener = new KeyActListener(); - keyActListener->OnDragEndEventHappen(); - keyActListener->OnLongPressEventHappen(); - keyActListener->OnFPSChangedListener(); - adapter->SetData(adapterData); - EXPECT_EQ(0, 0); - delete keyActListener; - delete adapter; - delete adapterData; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_6600 - * @tc.name test IncOneSecond api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_6600, Function | MediumTest | Level0) -{ - UIAbstractClock* uIAbstractClock = new UIAbstractClock(); - auto* keyActListener = new KeyActListener(); - keyActListener->OnFPSChanged(); - keyActListener->GetFPS(); - keyActListener->RegisterFPSChangedListener(); - keyActListener->CreateSurface(); - uIAbstractClock->IncOneSecond(); - EXPECT_EQ(0, 0); - delete keyActListener; - delete uIAbstractClock; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_6700 - * @tc.name test UpdateClock api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_6700, Function | MediumTest | Level0) -{ - UIAbstractClock* uIAbstractClock = new UIAbstractClock(); - auto* keyActListener = new KeyActListener(); - keyActListener->GetQueueSize(); - keyActListener->RegisterConsumerListener(); - keyActListener->UnregisterConsumerListener(); - keyActListener->GetInt64(); - uIAbstractClock->UpdateClock(false); - EXPECT_EQ(0, 0); - delete keyActListener; - delete uIAbstractClock; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_6800 - * @tc.name test OnKeyEvent api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_6800, Function | MediumTest | Level0) -{ - UIAbstractClock* uIAbstractClock = new UIAbstractClock(); - UIAbstractClock::WorkMode workMode = {}; - uIAbstractClock->SetWorkMode(workMode); - auto* keyActListener = new KeyActListener(); - keyActListener->GetSurface(); - keyActListener->OnKeyAct(); - keyActListener->OnKeyEvent(); - EXPECT_EQ(0, 0); - delete uIAbstractClock; - delete keyActListener; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_6900 - * @tc.name test ClearOnKeyActListener api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_6900, Function | MediumTest | Level0) -{ - UIAbstractClock* uIAbstractClock = new UIAbstractClock(); - uIAbstractClock->GetWorkMode(); - auto* keyActListener = new KeyActListener(); - keyActListener->SetOnKeyActListener(); - keyActListener->ClearOnKeyActListener(); - EXPECT_EQ(0, 0); - delete keyActListener; - delete uIAbstractClock; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_7000 - * @tc.name test SetHandImage api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_7000, Function | MediumTest | Level0) -{ - UIAnalogClock* hand = new UIAnalogClock(); - UIImageView* uiImageView = new UIImageView(); - EXPECT_EQ(0, 0); - delete uiImageView; - delete hand; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_7100 - * @tc.name test ClearOnVirtualDeviceEventListener api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_7100, Function | MediumTest | Level0) -{ - EventInjector* eventInjector = EventInjector::GetInstance(); - EventDataType* type = new EventDataType(); - eventInjector->RegisterEventInjector(*type); - auto* rootViewManage = new RootViewManage(); - rootViewManage->OnVirtualDeviceEvent(); - rootViewManage->SetOnVirtualDeviceEventListener(); - rootViewManage->ClearOnVirtualDeviceEventListener(); - EXPECT_EQ(0, 0); - delete rootViewManage; - delete type; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_7200 - * @tc.name test DrawTop api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_7200, Function | MediumTest | Level0) -{ - EventInjector* eventInjector = EventInjector::GetInstance(); - EventDataType* type = new EventDataType(); - eventInjector->UnregisterEventInjector(*type); - auto* rootViewManage = new RootViewManage(); - rootViewManage->EnableCursor(); - rootViewManage->GetCursor(); - rootViewManage->DrawTop(); - EXPECT_EQ(0, 0); - delete rootViewManage; - delete type; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_7300 - * @tc.name test IsEventInjectorRegistered api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_7300, Function | MediumTest | Level0) -{ - EventInjector* eventInjector = EventInjector::GetInstance(); - EventDataType* type = new EventDataType(); - eventInjector->IsEventInjectorRegistered(*type); - EXPECT_EQ(0, 0); - delete type; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_7400 - * @tc.name test SetInjectEvent api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_7400, Function | MediumTest | Level0) -{ - EventInjector* eventInjector = EventInjector::GetInstance(); - EventDataType* type = new EventDataType(); - DeviceData* dataArray = new DeviceData(); - uint16_t arrayLength = 1; - eventInjector->SetInjectEvent(dataArray, arrayLength, *type); - EXPECT_EQ(0, 0); - delete dataArray; - delete type; -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_7500 - * @tc.name test ScreenshotToFile api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiInterfaceTest, SUB_GRAPHIC_INTERFACE_FIRST_7500, Function | MediumTest | Level0) -{ - auto* rootViewManage = new RootViewManage(); - rootViewManage->GetTopUIView(); - rootViewManage->FindSubView(); - rootViewManage->SetFilePath(); - EXPECT_EQ(0, 0); - delete rootViewManage; -} -} // namespace OHOS diff --git a/graphic_lite/ui/a/src/UiInterfaceTest.h b/graphic_lite/ui/a/src/UiInterfaceTest.h deleted file mode 100755 index 695c3f5ef..000000000 --- a/graphic_lite/ui/a/src/UiInterfaceTest.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef XTS_HITS_UI_INTERFACE_API_EXPECT_H -#define XTS_HITS_UI_INTERFACE_API_EXPECT_H - -#endif \ No newline at end of file diff --git a/graphic_lite/ui/a/src/window_test.cpp b/graphic_lite/ui/a/src/window_test.cpp deleted file mode 100644 index 3213ac3db..000000000 --- a/graphic_lite/ui/a/src/window_test.cpp +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "common/graphic_startup.h" -#include "window/window.h" - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class WindowTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_WINDOW_DESTORYWINDOW_0200 - * @tc.name test window destory-window api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(WindowTest, Graphic_Window_Test_DestoryWindow_0200, Function | MediumTest | Level0) -{ - Window* testObj = NULL; - Window::DestoryWindow(testObj); - EXPECT_EQ(0, 0); -} - -/** - * @tc.number SUB_GRAPHIC_WINDOW_SHOW_0300 - * @tc.name test window show api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(WindowTest, Graphic_Window_Test_Show_0300, Function | MediumTest | Level0) -{ - OHOS::GraphicStartUp::Init(); - WindowConfig config = {}; - config.rect.SetRect(0, 0, 100, 100); - Window* testObj = Window::CreateWindow(config); - if (testObj != nullptr) { - testObj->Show(); - } - EXPECT_EQ(0, 0); -} - -/** - * @tc.number SUB_GRAPHIC_WINDOW_HIDE_0400 - * @tc.name test window hide api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(WindowTest, Graphic_Window_Test_Hide_0400, Function | MediumTest | Level0) -{ - OHOS::GraphicStartUp::Init(); - WindowConfig config = {}; - config.rect.SetRect(0, 0, 100, 100); - Window* testObj = Window::CreateWindow(config); - if (testObj != nullptr) { - testObj->Hide(); - } - EXPECT_EQ(0, 0); -} - -/** - * @tc.number SUB_GRAPHIC_WINDOW_MOVETO_0500 - * @tc.name test window move-to api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(WindowTest, Graphic_Window_Test_MoveTo_0500, Function | MediumTest | Level0) -{ - OHOS::GraphicStartUp::Init(); - WindowConfig config = {}; - config.rect.SetRect(0, 0, 100, 100); - Window* testObj = Window::CreateWindow(config); - int16_t xInt = 64; - int16_t yInt = 128; - if (testObj != nullptr) { - testObj->MoveTo(xInt, yInt); - testObj->RaiseToTop(); - testObj->LowerToBottom(); - } -} - -/** - * @tc.number SUB_GRAPHIC_WINDOW_RESIZE_0600 - * @tc.name test window resize api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(WindowTest, Graphic_Window_Test_Resize_0600, Function | MediumTest | Level0) -{ - OHOS::GraphicStartUp::Init(); - WindowConfig config = {}; - config.rect.SetRect(0, 0, 100, 100); - Window* testObj = Window::CreateWindow(config); - int16_t width = 64; - int16_t height = 128; - if (testObj != nullptr) { - testObj->Resize(width, height); - } - EXPECT_EQ(0, 0); -} - -/** - * @tc.number SUB_GRAPHIC_WINDOW_BINDROOTVIEW_0700 - * @tc.name test window bind-root-view api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(WindowTest, Graphic_Window_Test_BindRootView_0700, Function | MediumTest | Level0) -{ - OHOS::GraphicStartUp::Init(); - WindowConfig config = {}; - config.rect.SetRect(0, 0, 100, 100); - Window* testObj = Window::CreateWindow(config); - if (testObj != nullptr) { - testObj->BindRootView(RootView::GetInstance()); - } - EXPECT_EQ(0, 0); - if (testObj != nullptr) { - EXPECT_EQ(testObj->GetRootView(), RootView::GetInstance()); - testObj->UnbindRootView(); - } -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_5800 - * @tc.name test DestoryWindow api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(WindowTest, SUB_GRAPHIC_INTERFACE_FIRST_5800, Function | MediumTest | Level0) -{ - OHOS::GraphicStartUp::Init(); - WindowConfig windowConfig = {}; - Window* window = Window::CreateWindow(windowConfig); - Window::DestoryWindow(window); - EXPECT_EQ(0, 0); -} - -/** - * @tc.number SUB_GRAPHIC_INTERFACE_FIRST_5900 - * @tc.name test BindRootView api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(WindowTest, SUB_GRAPHIC_INTERFACE_FIRST_5900, Function | MediumTest | Level0) -{ - OHOS::GraphicStartUp::Init(); - WindowConfig windowConfig = {}; - Window* window = Window::CreateWindow(windowConfig); - RootView* rootView = RootView::GetInstance(); - if (window!=nullptr) { - window->BindRootView(rootView); - } - EXPECT_EQ(0, 0); -} -} // namespace OHOS diff --git a/graphic_lite/ui/animator_posix/BUILD.gn b/graphic_lite/ui/animator_posix/BUILD.gn deleted file mode 100755 index 4fe8c00d2..000000000 --- a/graphic_lite/ui/animator_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsAnimatorTest") { - suite_name = "acts" - sources = [ "src/animator_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/animator_posix/Test.json b/graphic_lite/ui/animator_posix/Test.json deleted file mode 100644 index 928d33d2a..000000000 --- a/graphic_lite/ui/animator_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsAnimatorTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/animator_posix/src/animator_test.cpp b/graphic_lite/ui/animator_posix/src/animator_test.cpp deleted file mode 100755 index ffe4c7d2f..000000000 --- a/graphic_lite/ui/animator_posix/src/animator_test.cpp +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "animator/animator.h" - -#include -#include - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class AnimatorTest : public testing::Test { -public: - static void SetUpTestCase(void) - { - if (animator == nullptr) { - animator = new Animator(); - } - } - static void TearDownTestCase(void) - { - if (animator != nullptr) { - delete animator; - animator = nullptr; - } - } - static Animator* animator; -}; -Animator* AnimatorTest::animator = nullptr; - -/** - * @tc.number SUB_GRAPHIC_ANIMATOR_START_0100 - * @tc.name test animator start api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(AnimatorTest, Graphic_Animator_Test_Start_0100, Function | MediumTest | Level0) -{ - animator->Start(); - EXPECT_EQ(animator->GetState(), Animator::START); -} - -/** - * @tc.number SUB_GRAPHIC_ANIMATOR_STOP_0200 - * @tc.name test animator stop api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(AnimatorTest, Graphic_Animator_Test_Stop_0200, Function | MediumTest | Level0) -{ - animator->Stop(); - EXPECT_EQ(animator->GetState(), Animator::STOP); -} - -/** - * @tc.number SUB_GRAPHIC_ANIMATOR_PAUSE_0300 - * @tc.name test animator pause api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(AnimatorTest, Graphic_Animator_Test_Pause_0300, Function | MediumTest | Level0) -{ - animator->Pause(); - EXPECT_EQ(animator->GetState(), Animator::PAUSE); -} - -/** - * @tc.number SUB_GRAPHIC_ANIMATOR_RESUME_0400 - * @tc.name test animator resume api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(AnimatorTest, Graphic_Animator_Test_Resume_0400, Function | MediumTest | Level0) -{ - animator->Resume(); - EXPECT_EQ(animator->GetState(), Animator::START); -} - -/** - * @tc.number SUB_GRAPHIC_ANIMATOR_SETSTATE_0500 - * @tc.name test animator set-state api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(AnimatorTest, Graphic_Animator_Test_SetState_0500, Function | MediumTest | Level0) -{ - animator->SetState(Animator::START); - EXPECT_EQ(animator->GetState(), Animator::START); -} - -/** - * @tc.number SUB_GRAPHIC_ANIMATOR_SETTIME_0600 - * @tc.name test animator set-time api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(AnimatorTest, Graphic_Animator_Test_SetTime_0600, Function | MediumTest | Level0) -{ - uint16_t time = 300; - animator->SetTime(time); - EXPECT_EQ(animator->GetTime(), time); -} - -/** - * @tc.number SUB_GRAPHIC_ANIMATOR_SETRUNTIME_0700 - * @tc.name test animator set-runtime api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(AnimatorTest, Graphic_Animator_Test_SetRunTime_0700, Function | MediumTest | Level0) -{ - uint16_t time = 300; - animator->SetRunTime(time); - EXPECT_EQ(animator->GetRunTime(), time); -} - -/** - * @tc.number SUB_GRAPHIC_ANIMATOR_ISRPEAT_0800 - * @tc.name test animator if-repeat api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(AnimatorTest, Graphic_Animator_Test_IsRepeat_0800, Function | MediumTest | Level0) -{ - EXPECT_EQ(animator->IsRepeat(), false); -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/easing_equation_posix/BUILD.gn b/graphic_lite/ui/easing_equation_posix/BUILD.gn deleted file mode 100755 index 2988a3a12..000000000 --- a/graphic_lite/ui/easing_equation_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsEasingEquationTest") { - suite_name = "acts" - sources = [ "src/test_easing_equation.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/easing_equation_posix/Test.json b/graphic_lite/ui/easing_equation_posix/Test.json deleted file mode 100644 index 4286d83ea..000000000 --- a/graphic_lite/ui/easing_equation_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsEasingEquationTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/easing_equation_posix/src/test_easing_equation.cpp b/graphic_lite/ui/easing_equation_posix/src/test_easing_equation.cpp deleted file mode 100755 index a32eece1f..000000000 --- a/graphic_lite/ui/easing_equation_posix/src/test_easing_equation.cpp +++ /dev/null @@ -1,246 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "animator/easing_equation.h" - -#include -#include - -using namespace std; -using namespace testing::ext; - -namespace OHOS { -class TestEasingEquation : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_EASING_EQUATION_BACKEASEOUT_0100 - * @tc.name test ui_view BackEaseOut api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TestEasingEquation, Graphic_EasingEquation_Test_BackEaseOut_0100, Function | MediumTest | Level0) -{ - EasingEquation* animator = new EasingEquation(); - EXPECT_EQ(animator->BackEaseOut(0, 1, 10, 5), 1); - delete animator; -} - -/** - * @tc.number SUB_GRAPHIC_EASING_EQUATION_BACKEASEINOUT_0200 - * @tc.name test ui_view BackEaseInOut api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TestEasingEquation, Graphic_EasingEquation_Test_BackEaseInOut_0200, Function | MediumTest | Level0) -{ - EasingEquation* animator = new EasingEquation(); - EXPECT_EQ(animator->BackEaseInOut(0, 1, 10, 5), 1); - delete animator; -} - -/** - * @tc.number SUB_GRAPHIC_EASING_EQUATION_CIRCEASEIN_0300 - * @tc.name test ui_view CircEaseIn api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TestEasingEquation, Graphic_EasingEquation_Test_CircEaseIn_0300, Function | MediumTest | Level0) -{ - EasingEquation* animator = new EasingEquation(); - EXPECT_EQ(animator->CircEaseIn(0, 1, 10, 5), 1); - delete animator; -} - -/** - * @tc.number SUB_GRAPHIC_EASING_EQUATION_CIRCEASEOUT_0400 - * @tc.name test ui_view CircEaseOut api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TestEasingEquation, Graphic_EasingEquation_Test_CircEaseOut_0400, Function | MediumTest | Level0) -{ - EasingEquation* animator = new EasingEquation(); - EXPECT_EQ(animator->CircEaseOut(0, 1, 10, 5), 1); - delete animator; -} - -/** - * @tc.number SUB_GRAPHIC_EASING_EQUATION_CIRCEASEINOUT_0500 - * @tc.name test ui_view CircEaseInOut api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TestEasingEquation, Graphic_EasingEquation_Test_CircEaseInOut_0500, Function | MediumTest | Level0) -{ - EasingEquation* animator = new EasingEquation(); - EXPECT_EQ(animator->CircEaseInOut(0, 1, 10, 5), 1); - delete animator; -} - -/** - * @tc.number SUB_GRAPHIC_EASING_EQUATION_CUBICEASEIN_0600 - * @tc.name test ui_view CubicEaseIn api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TestEasingEquation, Graphic_EasingEquation_Test_CubicEaseIn_0600, Function | MediumTest | Level0) -{ - EasingEquation* animator = new EasingEquation(); - EXPECT_EQ(animator->CubicEaseIn(0, 1, 10, 5), 1); - delete animator; -} - -/** - * @tc.number SUB_GRAPHIC_EASING_EQUATION_CUBICEASEOUT_0700 - * @tc.name test ui_view CubicEaseOut api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TestEasingEquation, Graphic_EasingEquation_Test_CubicEaseOut_0700, Function | MediumTest | Level0) -{ - EasingEquation* animator = new EasingEquation(); - EXPECT_EQ(animator->CubicEaseOut(0, 1, 10, 5), 1); - delete animator; -} - -/** - * @tc.number SUB_GRAPHIC_EASING_EQUATION_CUBICEASEINOUT_0800 - * @tc.name test ui_view CubicEaseInOut api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TestEasingEquation, Graphic_EasingEquation_Test_CubicEaseInOut_0800, Function | MediumTest | Level0) -{ - EasingEquation* animator = new EasingEquation(); - EXPECT_EQ(animator->CubicEaseInOut(0, 1, 10, 5), 1); - delete animator; -} - -/** - * @tc.number SUB_GRAPHIC_EASING_EQUATION_LINEAREASENONE_0900 - * @tc.name test ui_view LinearEaseNone api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TestEasingEquation, Graphic_EasingEquation_Test_LinearEaseNone_0900, Function | MediumTest | Level0) -{ - EasingEquation* animator = new EasingEquation(); - EXPECT_EQ(animator->LinearEaseNone(0, 1, 10, 5), 1); - delete animator; -} - -/** - * @tc.number SUB_GRAPHIC_EASING_EQUATION_QUADEASEIN_1000 - * @tc.name test ui_view QuadEaseIn api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TestEasingEquation, Graphic_EasingEquation_Test_QuadEaseIn_1000, Function | MediumTest | Level0) -{ - EasingEquation* animator = new EasingEquation(); - EXPECT_EQ(animator->QuadEaseIn(0, 1, 10, 5), 1); - delete animator; -} - -/** - * @tc.number SUB_GRAPHIC_EASING_EQUATION_QUADEASEOUT_1100 - * @tc.name test ui_view QuadEaseOut api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TestEasingEquation, Graphic_EasingEquation_Test_QuadEaseOut_1100, Function | MediumTest | Level0) -{ - EasingEquation* animator = new EasingEquation(); - EXPECT_EQ(animator->QuadEaseOut(0, 1, 10, 5), 1); - delete animator; -} - -/** - * @tc.number SUB_GRAPHIC_EASING_EQUATION_QUADEASEINOUT_1200 - * @tc.name test ui_view QuadEaseInOut api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TestEasingEquation, Graphic_EasingEquation_Test_QuadEaseInOut_1200, Function | MediumTest | Level0) -{ - EasingEquation* animator = new EasingEquation(); - EXPECT_EQ(animator->QuadEaseInOut(0, 1, 10, 5), 1); - delete animator; -} - -/** - * @tc.number SUB_GRAPHIC_EASING_EQUATION_QUINTEASEIN_1300 - * @tc.name test ui_view QuintEaseIn api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TestEasingEquation, Graphic_EasingEquation_Test_QuintEaseIn_1300, Function | MediumTest | Level0) -{ - EasingEquation* animator = new EasingEquation(); - EXPECT_EQ(animator->QuintEaseIn(0, 1, 10, 5), 1); - delete animator; -} - -/** - * @tc.number SUB_GRAPHIC_EASING_EQUATION_QUINTEASEOUT_1400 - * @tc.name test ui_view QuintEaseOut api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TestEasingEquation, Graphic_EasingEquation_Test_QuintEaseOut_1400, Function | MediumTest | Level0) -{ - EasingEquation* animator = new EasingEquation(); - EXPECT_EQ(animator->QuintEaseOut(0, 1, 10, 5), 1); - delete animator; -} - -/** - * @tc.number SUB_GRAPHIC_EASING_EQUATION_QUINTEASEINOUT_1500 - * @tc.name test ui_view QuintEaseInOut api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TestEasingEquation, Graphic_EasingEquation_Test_QuintEaseInOut_1500, Function | MediumTest | Level0) -{ - EasingEquation* animator = new EasingEquation(); - EXPECT_EQ(animator->QuintEaseInOut(0, 1, 10, 5), 1); - delete animator; -} - -/** - * @tc.number SUB_GRAPHIC_EASING_EQUATION_SINEEASEIN_1600 - * @tc.name test ui_view SineEaseIn api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TestEasingEquation, Graphic_EasingEquation_Test_SineEaseIn_1600, Function | MediumTest | Level0) -{ - EasingEquation* animator = new EasingEquation(); - EXPECT_EQ(animator->SineEaseIn(0, 1, 10, 5), 1); - delete animator; -} - -/** - * @tc.number SUB_GRAPHIC_EASING_EQUATION_SINEEASEOUT_1700 - * @tc.name test ui_view SineEaseOut api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TestEasingEquation, Graphic_EasingEquation_Test_SineEaseOut_1700, Function | MediumTest | Level0) -{ - EasingEquation* animator = new EasingEquation(); - EXPECT_EQ(animator->SineEaseOut(0, 1, 10, 5), 1); - delete animator; -} - -/** - * @tc.number SUB_GRAPHIC_EASING_EQUATION_SINEEASEINOUT_1800 - * @tc.name test ui_view SineEaseInOut api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TestEasingEquation, Graphic_EasingEquation_Test_SineEaseInOut_1800, Function | MediumTest | Level0) -{ - EasingEquation* animator = new EasingEquation(); - EXPECT_EQ(animator->SineEaseInOut(0, 1, 10, 5), 1); - delete animator; -} -} \ No newline at end of file diff --git a/graphic_lite/ui/events_posix/BUILD.gn b/graphic_lite/ui/events_posix/BUILD.gn deleted file mode 100755 index 00f2ba3b5..000000000 --- a/graphic_lite/ui/events_posix/BUILD.gn +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsEventsTest") { - suite_name = "acts" - sources = [ - "src/cancel_event_test.cpp", - "src/click_event_test.cpp", - "src/drag_event_test.cpp", - "src/event_test.cpp", - "src/key_event_test.cpp", - "src/long_press_event_test.cpp", - "src/press_event_test.cpp", - "src/release_event_test.cpp", - "src/virtual_device_event_test.cpp", - ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/events_posix/Test.json b/graphic_lite/ui/events_posix/Test.json deleted file mode 100644 index b4c0fa6c8..000000000 --- a/graphic_lite/ui/events_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsEventsTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/events_posix/src/cancel_event_test.cpp b/graphic_lite/ui/events_posix/src/cancel_event_test.cpp deleted file mode 100755 index 44f9e9ed0..000000000 --- a/graphic_lite/ui/events_posix/src/cancel_event_test.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "events/cancel_event.h" - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class CancelEventTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_CANCELEVENT_CONSTRUCTOR_0100 - * @tc.name test cancel-event constructor api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(CancelEventTest, Graphic_CancelEvent_Test_Constructor_0100, Function | MediumTest | Level0) -{ - Point pos = {100, 200}; - CancelEvent *cancelEvent = new CancelEvent(pos); - EXPECT_EQ(cancelEvent->GetCurrentPos().x, pos.x); - EXPECT_EQ(cancelEvent->GetCurrentPos().y, pos.y); - delete cancelEvent; -} -} // namespace OHOS diff --git a/graphic_lite/ui/events_posix/src/click_event_test.cpp b/graphic_lite/ui/events_posix/src/click_event_test.cpp deleted file mode 100755 index e2fa42cc7..000000000 --- a/graphic_lite/ui/events_posix/src/click_event_test.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "events/click_event.h" - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class ClickEventTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_CLICKEVENT_CONSTRUCTOR_0100 - * @tc.name test click-event constructor api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ClickEventTest, Graphic_ClickEvent_Test_Constructor_0100, Function | MediumTest | Level0) -{ - Point pos = {100, 200}; - ClickEvent *clickEvent = new ClickEvent(pos); - EXPECT_EQ(clickEvent->GetCurrentPos().x, pos.x); - EXPECT_EQ(clickEvent->GetCurrentPos().y, pos.y); - delete clickEvent; -} -} // namespace OHOS diff --git a/graphic_lite/ui/events_posix/src/drag_event_test.cpp b/graphic_lite/ui/events_posix/src/drag_event_test.cpp deleted file mode 100755 index 12e533b5b..000000000 --- a/graphic_lite/ui/events_posix/src/drag_event_test.cpp +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "events/drag_event.h" - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class DragEventTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_DRAYEVENT_CONSTRUCTOR_0100 - * @tc.name test dray-event constructor api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(DragEventTest, Graphic_DrayEvent_Test_Constructor_0100, Function | MediumTest | Level0) -{ - Point newPos = { 100, 200 }; - Point lastPos = { 150, 250 }; - Point totalLen = { 50, 150 }; - DragEvent *daryEvent = new DragEvent(newPos, lastPos, totalLen); - EXPECT_EQ(daryEvent->GetCurrentPos().x, newPos.x); - EXPECT_EQ(daryEvent->GetCurrentPos().y, newPos.y); - delete daryEvent; -} - -/** - * @tc.number SUB_GRAPHIC_DRAYEVENT_CONSTRUCTOR_0200 - * @tc.name test dray-event get-last-point api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(DragEventTest, Graphic_DrayEvent_Test_GetLastPoint_0200, Function | MediumTest | Level0) -{ - Point newPos = {100, 200}; - Point lastPos = {150, 250}; - Point totalLen = {50, 150}; - DragEvent *daryEvent = new DragEvent(newPos, lastPos, totalLen); - EXPECT_EQ(daryEvent->GetLastPoint().x, lastPos.x); - EXPECT_EQ(daryEvent->GetLastPoint().y, lastPos.y); - delete daryEvent; -} - -/** - * @tc.number SUB_GRAPHIC_DRAYEVENT_CONSTRUCTOR_0300 - * @tc.name test dray-event get-start-point api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(DragEventTest, Graphic_DrayEvent_Test_GetStartPoint_0300, Function | MediumTest | Level0) -{ - Point newPos = {100, 200}; - Point lastPos = {150, 250}; - Point totalLen = {50, 150}; - DragEvent *daryEvent = new DragEvent(newPos, lastPos, totalLen); - EXPECT_EQ(daryEvent->GetStartPoint().x, newPos.x - totalLen.x); - EXPECT_EQ(daryEvent->GetStartPoint().y, newPos.y - totalLen.y); - delete daryEvent; -} - -/** - * @tc.number SUB_GRAPHIC_DRAYEVENT_CONSTRUCTOR_0400 - * @tc.name test dray-event set-prelast-point api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(DragEventTest, Graphic_DrayEvent_Test_SetPreLastPoint_0400, Function | MediumTest | Level0) -{ - Point newPos = {100, 200}; - Point lastPos = {150, 250}; - Point totalLen = {50, 150}; - DragEvent *daryEvent = new DragEvent(newPos, lastPos, totalLen); - - Point preLastPos = {20, 40}; - daryEvent->SetPreLastPoint(preLastPos); - EXPECT_EQ(daryEvent->GetPreLastPoint().x, preLastPos.x); - EXPECT_EQ(daryEvent->GetPreLastPoint().y, preLastPos.y); - delete daryEvent; -} - -/** - * @tc.number SUB_GRAPHIC_DRAYEVENT_CONSTRUCTOR_0500 - * @tc.name test dray-event get-drag-direction api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(DragEventTest, Graphic_DrayEvent_Test_GetDragDirection_0500, Function | MediumTest | Level0) -{ - Point newPos = {100, 200}; - Point lastPos = {150, 250}; - Point totalLen = {50, 150}; - DragEvent *daryEvent = new DragEvent(newPos, lastPos, totalLen); - - EXPECT_EQ(daryEvent->GetDragDirection(), 2); - delete daryEvent; -} - -/** - * @tc.number SUB_GRAPHIC_DRAYEVENT_CONSTRUCTOR_0600 - * @tc.name test dray-event get-deltaX api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(DragEventTest, Graphic_DrayEvent_Test_GetDeltaX_0600, Function | MediumTest | Level0) -{ - Point newPos = {100, 200}; - Point lastPos = {150, 250}; - Point totalLen = {50, 150}; - DragEvent *daryEvent = new DragEvent(newPos, lastPos, totalLen); - - EXPECT_EQ(daryEvent->GetDeltaX(), newPos.x - lastPos.x); - delete daryEvent; -} - -/** - * @tc.number SUB_GRAPHIC_DRAYEVENT_CONSTRUCTOR_0700 - * @tc.name test dray-event get-deltaY api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(DragEventTest, Graphic_DrayEvent_Test_GetDeltaY_0700, Function | MediumTest | Level0) -{ - Point newPos = {100, 200}; - Point lastPos = {150, 250}; - Point totalLen = {50, 150}; - DragEvent *daryEvent = new DragEvent(newPos, lastPos, totalLen); - - EXPECT_EQ(daryEvent->GetDeltaY(), newPos.y - lastPos.y); - delete daryEvent; -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/events_posix/src/event_test.cpp b/graphic_lite/ui/events_posix/src/event_test.cpp deleted file mode 100755 index 98c06d5c8..000000000 --- a/graphic_lite/ui/events_posix/src/event_test.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "events/event.h" - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class EventTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_EVENT_CONSTRUCTOR_0100 - * @tc.name test event constructor api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(EventTest, Graphic_Event_Test_Constructor_0100, Function | MediumTest | Level0) -{ - Point pos = {100, 200}; - Event *event = new Event(pos); - EXPECT_EQ(event->GetCurrentPos().x, pos.x); - EXPECT_EQ(event->GetCurrentPos().y, pos.y); - delete event; -} - -/** - * @tc.number SUB_GRAPHIC_EVENT_SETTIMESTAMP_0200 - * @tc.name test event set-time-stamp api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(EventTest, Graphic_Event_Test_SetTimeStamp_0200, Function | MediumTest | Level0) -{ - Point pos = {100, 200}; - Event *event = new Event(pos); - TimeType timeType = 100; - event->SetTimeStamp(timeType); - EXPECT_EQ(event->GetTimeStamp(), timeType); - delete event; -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/events_posix/src/key_event_test.cpp b/graphic_lite/ui/events_posix/src/key_event_test.cpp deleted file mode 100755 index 8071c7ee3..000000000 --- a/graphic_lite/ui/events_posix/src/key_event_test.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "events/key_event.h" - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class KeyEventTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_KEYEVENT_GETKEYID_0100 - * @tc.name test key-event get-keyID api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(KeyEventTest, Graphic_KeyEvent_Test_GetKeyId_0100, Function | MediumTest | Level0) -{ - uint16_t keyId = 10; - uint16_t state = 20; - KeyEvent *keyEvent = new KeyEvent(keyId, state); - - EXPECT_EQ(keyEvent->GetKeyId(), keyId); - delete keyEvent; -} - -/** - * @tc.number SUB_GRAPHIC_KEYEVENT_GETSTATE_0200 - * @tc.name test key-event get-state api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(KeyEventTest, Graphic_KeyEvent_Test_GetState_0200, Function | MediumTest | Level0) -{ - uint16_t keyId = 10; - uint16_t state = 20; - KeyEvent *keyEvent = new KeyEvent(keyId, state); - - EXPECT_EQ(keyEvent->GetState(), state); - delete keyEvent; -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/events_posix/src/long_press_event_test.cpp b/graphic_lite/ui/events_posix/src/long_press_event_test.cpp deleted file mode 100755 index fff4ad62c..000000000 --- a/graphic_lite/ui/events_posix/src/long_press_event_test.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "events/long_press_event.h" - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class LongPressEventTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_LONGPRESS_GETCURRENTPOS_0100 - * @tc.name test long-press get-current-pos api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(LongPressEventTest, Graphic_LongPressEvent_Test_GetCurrentPos_0100, Function | MediumTest | Level0) -{ - Point pos = {100, 200}; - TimeType timeStamp = 20; - LongPressEvent *longPressEvent = new LongPressEvent(pos, timeStamp); - - EXPECT_EQ(longPressEvent->GetCurrentPos().x, pos.x); - EXPECT_EQ(longPressEvent->GetCurrentPos().y, pos.y); - delete longPressEvent; -} - -/** - * @tc.number SUB_GRAPHIC_LONGPRESS_GETTIMESTAMP_0200 - * @tc.name test long-press get-time-stamp api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(LongPressEventTest, Graphic_LongPressEvent_Test_GetTimeStamp_0200, Function | MediumTest | Level0) -{ - Point pos = {100, 200}; - TimeType timeStamp = 20; - LongPressEvent *longPressEvent = new LongPressEvent(pos, timeStamp); - - EXPECT_EQ(longPressEvent->GetTimeStamp(), timeStamp); - delete longPressEvent; -} -} // namespace OHOS diff --git a/graphic_lite/ui/events_posix/src/press_event_test.cpp b/graphic_lite/ui/events_posix/src/press_event_test.cpp deleted file mode 100755 index a50ad705c..000000000 --- a/graphic_lite/ui/events_posix/src/press_event_test.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "events/press_event.h" - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class PressEventTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_PRESS_CONSTRUCTOR_0100 - * @tc.name test press constructor api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(PressEventTest, Graphic_PressEvent_Test_Constructor_0100, Function | MediumTest | Level0) -{ - Point pos = {100, 200}; - PressEvent *pressEvent = new PressEvent(pos); - - EXPECT_EQ(pressEvent->GetCurrentPos().x, pos.x); - EXPECT_EQ(pressEvent->GetCurrentPos().y, pos.y); - delete pressEvent; -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/events_posix/src/release_event_test.cpp b/graphic_lite/ui/events_posix/src/release_event_test.cpp deleted file mode 100755 index afe65c488..000000000 --- a/graphic_lite/ui/events_posix/src/release_event_test.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "events/release_event.h" - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class ReleaseEventTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_RELEASE_CONSTRUCTOR_0100 - * @tc.name test release constructor api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ReleaseEventTest, Graphic_ReleaseEvent_Test_Constructor_0100, Function | MediumTest | Level0) -{ - Point pos = {100, 200}; - ReleaseEvent *releaseEvent = new ReleaseEvent(pos); - - EXPECT_EQ(releaseEvent->GetCurrentPos().x, pos.x); - EXPECT_EQ(releaseEvent->GetCurrentPos().y, pos.y); - delete releaseEvent; -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/events_posix/src/virtual_device_event_test.cpp b/graphic_lite/ui/events_posix/src/virtual_device_event_test.cpp deleted file mode 100755 index 530cc7674..000000000 --- a/graphic_lite/ui/events_posix/src/virtual_device_event_test.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "events/virtual_device_event.h" - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class VirtualDeviceEventTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_VIRTUALDEVICE_GETTYPE_0100 - * @tc.name test virtual-device get-type api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(VirtualDeviceEventTest, Graphic_VirtualDeviceEvent_Test_GetType_0100, Function | MediumTest | Level0) -{ - uint16_t type = 10; - uint16_t value = 20; - VirtualDeviceEvent *virtualDeviceEvent = new VirtualDeviceEvent(type, value); - EXPECT_EQ(virtualDeviceEvent->GetType(), type); - delete virtualDeviceEvent; -} - -/** - * @tc.number SUB_GRAPHIC_VIRTUALDEVICE_GETSTATE_0200 - * @tc.name test virtual-device get-state api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(VirtualDeviceEventTest, Graphic_VirtualDeviceEvent_Test_GetState_0200, Function | MediumTest | Level0) -{ - uint16_t type = 10; - uint16_t value = 20; - VirtualDeviceEvent *virtualDeviceEvent = new VirtualDeviceEvent(type, value); - EXPECT_EQ(virtualDeviceEvent->GetState(), value); - delete virtualDeviceEvent; -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/flexlayout_posix/BUILD.gn b/graphic_lite/ui/flexlayout_posix/BUILD.gn deleted file mode 100755 index a9698b9a5..000000000 --- a/graphic_lite/ui/flexlayout_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsFlexlaoutTest") { - suite_name = "acts" - sources = [ "src/test_flex_layout.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/flexlayout_posix/Test.json b/graphic_lite/ui/flexlayout_posix/Test.json deleted file mode 100644 index 59385a293..000000000 --- a/graphic_lite/ui/flexlayout_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsFlexlaoutTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/flexlayout_posix/src/test_flex_layout.cpp b/graphic_lite/ui/flexlayout_posix/src/test_flex_layout.cpp deleted file mode 100755 index e01700944..000000000 --- a/graphic_lite/ui/flexlayout_posix/src/test_flex_layout.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "layout/flex_layout.h" - -#include -#include - -using namespace std; -using namespace testing::ext; - -namespace OHOS { -class TestFlexLayout : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} - virtual void SetUp() {} - virtual void TearDown() {} -}; - -/** - * @tc.number SUB_GRAPHIC_FLEXLAYOUT_SETMAJORAXISALIGN_0100 - * @tc.name test FlexLayout SetMajorAxisAlign api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TestFlexLayout, SUB_GRAPHIC_FLEXLAYOUT_SETMAJORAXISALIGN_0100, Function | MediumTest | Level0) -{ - FlexLayout* layout = new FlexLayout(); - layout->SetMajorAxisAlign(ALIGN_END); - EXPECT_EQ(0, 0); - delete layout; -} - -/** - * @tc.number SUB_GRAPHIC_FLEXLAYOUT_SETSECONDARYAXISALIGN_0200 - * @tc.name test FlexLayout SetSecondaryAxisAlign api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TestFlexLayout, SUB_GRAPHIC_FLEXLAYOUT_SetSecondaryAxisAlign_0200, Function | MediumTest | Level0) -{ - FlexLayout* layout = new FlexLayout(); - layout->SetSecondaryAxisAlign(ALIGN_END); - EXPECT_EQ(0, 0); - delete layout; -} - -/** - * @tc.number SUB_GRAPHIC_FLEXLAYOUT_SETFLEXWRAP_0300 - * @tc.name test FlexLayout SetFlexWrap api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TestFlexLayout, SUB_GRAPHIC_FLEXLAYOUT_SetFlexWrap_0300, Function | MediumTest | Level0) -{ - FlexLayout* layout = new FlexLayout(); - layout->SetFlexWrap(true); - EXPECT_EQ(0, 0); - delete layout; -} - -/** - * @tc.number SUB_GRAPHIC_FLEXLAYOUT_LAYOUTCHILDREN_0400 - * @tc.name test FlexLayout LayoutChildren api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(TestFlexLayout, SUB_GRAPHIC_FLEXLAYOUT_LayoutChildren_0400, Function | MediumTest | Level0) -{ - FlexLayout* layout = new FlexLayout(); - layout->LayoutChildren(true); - EXPECT_EQ(0, 0); - delete layout; -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/gridlayout_posix/BUILD.gn b/graphic_lite/ui/gridlayout_posix/BUILD.gn deleted file mode 100755 index 42e9ebeb5..000000000 --- a/graphic_lite/ui/gridlayout_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsGridLayoutTest") { - suite_name = "acts" - sources = [ "src/test_grid_layout.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/gridlayout_posix/Test.json b/graphic_lite/ui/gridlayout_posix/Test.json deleted file mode 100644 index 3502668c8..000000000 --- a/graphic_lite/ui/gridlayout_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsGridLayoutTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/gridlayout_posix/src/test_grid_layout.cpp b/graphic_lite/ui/gridlayout_posix/src/test_grid_layout.cpp deleted file mode 100755 index ed345c0dd..000000000 --- a/graphic_lite/ui/gridlayout_posix/src/test_grid_layout.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "layout/grid_layout.h" - -#include -#include -#include "common/screen.h" - -using namespace testing::ext; -namespace OHOS { -class GridLayoutTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_GRIDLAYOUT_LAYOUTCHILDREN_0100 - * @tc.name test grid-layout layout-children api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(GridLayoutTest, Graphic_GridLayout_Test_LayoutChildren_0100, Function | MediumTest | Level0) -{ - GridLayout* layout = new GridLayout(); - layout->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); - layout->SetLayoutDirection(LAYOUT_HOR); - layout->SetRows(5); // 5: row - layout->SetCols(4); // 4: col - layout->LayoutChildren(); - EXPECT_EQ(0, 0); - delete layout; -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/image_posix/BUILD.gn b/graphic_lite/ui/image_posix/BUILD.gn deleted file mode 100755 index ae530849a..000000000 --- a/graphic_lite/ui/image_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsImageTest") { - suite_name = "acts" - sources = [ "src/image_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/image_posix/Test.json b/graphic_lite/ui/image_posix/Test.json deleted file mode 100644 index 6a070e158..000000000 --- a/graphic_lite/ui/image_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsImageTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/image_posix/src/image_test.cpp b/graphic_lite/ui/image_posix/src/image_test.cpp deleted file mode 100755 index 2ec83dcd7..000000000 --- a/graphic_lite/ui/image_posix/src/image_test.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "common/image.h" - -#include -#include - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class ImageTest : public testing::Test { -public: - static void SetUpTestCase(void) - { - if (imageObject == nullptr) { - imageObject = new Image(); - } - } - static void TearDownTestCase(void) - { - if (imageObject != nullptr) { - delete imageObject; - imageObject = nullptr; - } - } - static Image* imageObject; -}; -Image* ImageTest::imageObject = nullptr; - -/** - * @tc.number SUB_GRAPHIC_IMAGE_GETHEADER_0100 - * @tc.name test image get-header api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ImageTest, Graphic_UIImage_Test_GetHeader_0100, Function | MediumTest | Level0) -{ - int colorMode = 1; - ImageHeader header = {0}; - header.colorMode = colorMode; - header.reserved = 2; - header.width = 3; - header.height = 4; - imageObject->GetHeader(header); - EXPECT_EQ(header.colorMode, colorMode); -} -} \ No newline at end of file diff --git a/graphic_lite/ui/interpolation_posix/BUILD.gn b/graphic_lite/ui/interpolation_posix/BUILD.gn deleted file mode 100755 index 2ba18c3ba..000000000 --- a/graphic_lite/ui/interpolation_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsInterpoliationTest") { - suite_name = "acts" - sources = [ "src/interpolation_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/interpolation_posix/Test.json b/graphic_lite/ui/interpolation_posix/Test.json deleted file mode 100644 index d96e2c2fa..000000000 --- a/graphic_lite/ui/interpolation_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsInterpoliationTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/interpolation_posix/src/interpolation_test.cpp b/graphic_lite/ui/interpolation_posix/src/interpolation_test.cpp deleted file mode 100755 index 84b5bbbdd..000000000 --- a/graphic_lite/ui/interpolation_posix/src/interpolation_test.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "animator/interpolation.h" - -#include -#include - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class InterpolationTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_INTERPOLATION_GETBEZIERINTERPOLATION_0100 - * @tc.name test interpolation get-bezier-interpolation api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(InterpolationTest, Graphic_UIInterpolationTest_Test_GetBezierInterpolation_0100, - Function | MediumTest | Level0) -{ - Interpolation *interpolation = new Interpolation(); - int16_t t = 0; - int16_t u0 = 1; - int16_t u1 = 1; - int16_t u2 = 1; - int16_t u3 = 1; - int16_t temp = 1; - - EXPECT_EQ(interpolation->GetBezierInterpolation(t, u0, u1, u2, u3), temp); - delete interpolation; -} -} \ No newline at end of file diff --git a/graphic_lite/ui/layout_posix/BUILD.gn b/graphic_lite/ui/layout_posix/BUILD.gn deleted file mode 100755 index af2b887e0..000000000 --- a/graphic_lite/ui/layout_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsLayoutTest") { - suite_name = "acts" - sources = [ "src/test_layout.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/layout_posix/Test.json b/graphic_lite/ui/layout_posix/Test.json deleted file mode 100644 index edef7dea6..000000000 --- a/graphic_lite/ui/layout_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsLayoutTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/layout_posix/src/test_layout.cpp b/graphic_lite/ui/layout_posix/src/test_layout.cpp deleted file mode 100755 index bb4e7c311..000000000 --- a/graphic_lite/ui/layout_posix/src/test_layout.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "layout/layout.h" - -#include -#include - -using namespace std; -using namespace testing::ext; - -namespace OHOS { -class LayoutTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} - virtual void SetUp() {} - virtual void TearDown() {} -}; - -class LayoutIn : public Layout { -public: - uint8_t GetLayoutDirection(void) const - { - return direction_; - } -}; -/** - * @tc.number SUB_GRAPHIC_LAYOUT_SetLayoutDirection_0100 - * @tc.name test ui_view SetLayoutDirection api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(LayoutTest, SUB_GRAPHIC_FLEXLAOUT_SetLayoutDirection_0100, Function | MediumTest | Level0) -{ - LayoutIn* layout = new LayoutIn(); - uint8_t direction = 1; - layout->SetLayoutDirection(direction); - EXPECT_EQ(layout->GetLayoutDirection(), direction); - delete layout; -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/listlayout_posix/BUILD.gn b/graphic_lite/ui/listlayout_posix/BUILD.gn deleted file mode 100755 index 0762d7d52..000000000 --- a/graphic_lite/ui/listlayout_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsListlayoutTest") { - suite_name = "acts" - sources = [ "src/list_layout_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/listlayout_posix/Test.json b/graphic_lite/ui/listlayout_posix/Test.json deleted file mode 100644 index 99b826bd7..000000000 --- a/graphic_lite/ui/listlayout_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsListlayoutTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/listlayout_posix/src/list_layout_test.cpp b/graphic_lite/ui/listlayout_posix/src/list_layout_test.cpp deleted file mode 100755 index af544517e..000000000 --- a/graphic_lite/ui/listlayout_posix/src/list_layout_test.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "layout/list_layout.h" - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class ListLayoutTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_LISTLAYOUT_SETDIRECTION_0100 - * @tc.name test list-layout set-direction api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ListLayoutTest, Graphic_ListLayout_Test_SetDirection_0100, Function | MediumTest | Level0) -{ - ListLayout *listLayout = new ListLayout(); - uint8_t direction = 10; - listLayout->SetDirection(direction); - EXPECT_EQ(listLayout->GetDirection(), direction); - delete listLayout; -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/screen_posix/BUILD.gn b/graphic_lite/ui/screen_posix/BUILD.gn deleted file mode 100755 index 8dfa19520..000000000 --- a/graphic_lite/ui/screen_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsScreenTest") { - suite_name = "acts" - sources = [ "src/screen_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/screen_posix/Test.json b/graphic_lite/ui/screen_posix/Test.json deleted file mode 100644 index 7a5881275..000000000 --- a/graphic_lite/ui/screen_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsScreenTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/screen_posix/src/screen_test.cpp b/graphic_lite/ui/screen_posix/src/screen_test.cpp deleted file mode 100755 index 697760e7f..000000000 --- a/graphic_lite/ui/screen_posix/src/screen_test.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "common/screen.h" -#include "graphic_config.h" - -#include -#include - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class ScreenTest : public testing::Test { -public: - static void SetUpTestCase(void){} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_SCREEN_GETWIDTH_0100 - * @tc.name test screen get-width api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ScreenTest, Graphic_ScreenTest_Test_GetWidth_0100, Function | MediumTest | Level0) -{ - EXPECT_EQ(Screen::GetInstance().GetWidth(), HORIZONTAL_RESOLUTION); -} - -/** - * @tc.number SUB_GRAPHIC_IMAGE_GETHEIGHT_0200 - * @tc.name test image get-height api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ScreenTest, Graphic_ScreenTest_Test_GetHeight_0200, Function | MediumTest | Level0) -{ - EXPECT_EQ(Screen::GetInstance().GetHeight(), VERTICAL_RESOLUTION); -} -} \ No newline at end of file diff --git a/graphic_lite/ui/style_posix/BUILD.gn b/graphic_lite/ui/style_posix/BUILD.gn deleted file mode 100755 index 9186e380d..000000000 --- a/graphic_lite/ui/style_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsStyleTest") { - suite_name = "acts" - sources = [ "src/style_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/style_posix/Test.json b/graphic_lite/ui/style_posix/Test.json deleted file mode 100644 index 94e6d086c..000000000 --- a/graphic_lite/ui/style_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsStyleTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/style_posix/src/style_test.cpp b/graphic_lite/ui/style_posix/src/style_test.cpp deleted file mode 100755 index 0de1994b5..000000000 --- a/graphic_lite/ui/style_posix/src/style_test.cpp +++ /dev/null @@ -1,447 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "gfx_utils/style.h" - -#include -#include - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class StyleTest : public testing::Test { -public: - static void SetUpTestCase(void); - static void TearDownTestCase(void); - static Style* styleVar; - static StyleDefault* styleDefault_; -}; -Style* StyleTest::styleVar = nullptr; - -void StyleTest::SetUpTestCase() -{ - styleVar = new (std::nothrow) Style(); - if (styleVar == nullptr) { - printf("Failed to apply for memory.\n"); - return; - } -} - -void StyleTest::TearDownTestCase() -{ - if (styleVar != nullptr) { - delete styleVar; - styleVar = nullptr; - } -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_SETSTYLE_0100 - * @tc.name test style set-style01 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_SetStyle_0100, Function | MediumTest | Level0) -{ - styleVar->SetStyle(STYLE_BACKGROUND_COLOR, Color::Gray().full); - EXPECT_EQ(styleVar->GetStyle(STYLE_BACKGROUND_COLOR), Color::Gray().full); -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_SETSTYLE_0200 - * @tc.name test style set-style02 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_SetStyle_0200, Function | MediumTest | Level0) -{ - styleVar->SetStyle(STYLE_BACKGROUND_OPA, OPA_OPAQUE); - EXPECT_EQ(styleVar->GetStyle(STYLE_BACKGROUND_OPA), OPA_OPAQUE); -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_SETSTYLE_0300 - * @tc.name test style set-style03 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_SetStyle_0300, Function | MediumTest | Level0) -{ - styleVar->SetStyle(STYLE_BORDER_RADIUS, 50); - EXPECT_EQ(styleVar->GetStyle(STYLE_BORDER_RADIUS), 50); -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_SETSTYLE_0400 - * @tc.name test style set-style04 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_SetStyle_0400, Function | MediumTest | Level0) -{ - styleVar->SetStyle(STYLE_BORDER_COLOR, Color::Gray().full); - EXPECT_EQ(styleVar->GetStyle(STYLE_BORDER_COLOR), Color::Gray().full); -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_SETSTYLE_0500 - * @tc.name test style set-style05 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_SetStyle_0500, Function | MediumTest | Level0) -{ - styleVar->SetStyle(STYLE_BORDER_OPA, OPA_OPAQUE); - EXPECT_EQ(styleVar->GetStyle(STYLE_BORDER_OPA), OPA_OPAQUE); -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_SETSTYLE_0600 - * @tc.name test style set-style06 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_SetStyle_0600, Function | MediumTest | Level0) -{ - styleVar->SetStyle(STYLE_BORDER_WIDTH, 100); - EXPECT_EQ(styleVar->GetStyle(STYLE_BORDER_WIDTH), 100); -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_SETSTYLE_0700 - * @tc.name test style set-style07 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_SetStyle_0700, Function | MediumTest | Level0) -{ - styleVar->SetStyle(STYLE_PADDING_LEFT, 50); - EXPECT_EQ(styleVar->GetStyle(STYLE_PADDING_LEFT), 50); -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_SETSTYLE_0800 - * @tc.name test style set-style08 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_SetStyle_0800, Function | MediumTest | Level0) -{ - styleVar->SetStyle(STYLE_PADDING_RIGHT, 100); - EXPECT_EQ(styleVar->GetStyle(STYLE_PADDING_RIGHT), 100); -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_SETSTYLE_0900 - * @tc.name test style set-style09 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_SetStyle_0900, Function | MediumTest | Level0) -{ - styleVar->SetStyle(STYLE_PADDING_TOP, 100); - EXPECT_EQ(styleVar->GetStyle(STYLE_PADDING_TOP), 100); -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_SETSTYLE_1000 - * @tc.name test style set-style10 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_SetStyle_1000, Function | MediumTest | Level0) -{ - styleVar->SetStyle(STYLE_PADDING_BOTTOM, 100); - EXPECT_EQ(styleVar->GetStyle(STYLE_PADDING_BOTTOM), 100); -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_SETSTYLE_1100 - * @tc.name test style set-style11 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_SetStyle_1100, Function | MediumTest | Level0) -{ - styleVar->SetStyle(STYLE_MARGIN_LEFT, 10); - EXPECT_EQ(styleVar->GetStyle(STYLE_MARGIN_LEFT), 10); -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_SETSTYLE_1200 - * @tc.name test style set-style12 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_SetStyle_1200, Function | MediumTest | Level0) -{ - styleVar->SetStyle(STYLE_MARGIN_RIGHT, 20); - EXPECT_EQ(styleVar->GetStyle(STYLE_MARGIN_RIGHT), 20); -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_SETSTYLE_1300 - * @tc.name test style set-style13 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_SetStyle_1300, Function | MediumTest | Level0) -{ - styleVar->SetStyle(STYLE_MARGIN_TOP, 30); - EXPECT_EQ(styleVar->GetStyle(STYLE_MARGIN_TOP), 30); -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_SETSTYLE_1400 - * @tc.name test style set-style14 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_SetStyle_1400, Function | MediumTest | Level0) -{ - styleVar->SetStyle(STYLE_MARGIN_BOTTOM, 40); - EXPECT_EQ(styleVar->GetStyle(STYLE_MARGIN_BOTTOM), 40); -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_SETSTYLE_1500 - * @tc.name test style set-style15 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_SetStyle_1500, Function | MediumTest | Level0) -{ - styleVar->SetStyle(STYLE_IMAGE_OPA, OPA_OPAQUE); - EXPECT_EQ(styleVar->GetStyle(STYLE_IMAGE_OPA), OPA_OPAQUE); -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_SETSTYLE_1600 - * @tc.name test style set-style16 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_SetStyle_1600, Function | MediumTest | Level0) -{ - styleVar->SetStyle(STYLE_TEXT_COLOR, Color::Gray().full); - EXPECT_EQ(styleVar->GetStyle(STYLE_TEXT_COLOR), Color::Gray().full); -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_SETSTYLE_1700 - * @tc.name test style set-style17 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_SetStyle_1700, Function | MediumTest | Level0) -{ - styleVar->SetStyle(STYLE_TEXT_FONT, 16); - EXPECT_EQ(styleVar->GetStyle(STYLE_TEXT_FONT), 16); -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_SETSTYLE_1800 - * @tc.name test style set-style18 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_SetStyle_1800, Function | MediumTest | Level0) -{ - styleVar->SetStyle(STYLE_LETTER_SPACE, 4); - EXPECT_EQ(styleVar->GetStyle(STYLE_LETTER_SPACE), 4); -} - - -/** - * @tc.number SUB_GRAPHIC_STYLE_SETSTYLE_1900 - * @tc.name test style set-style19 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_SetStyle_1900, Function | MediumTest | Level0) -{ - styleVar->SetStyle(STYLE_LINE_SPACE, 4); - EXPECT_EQ(styleVar->GetStyle(STYLE_LINE_SPACE), 4); -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_SETSTYLE_2000 - * @tc.name test style set-style20 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_SetStyle_2000, Function | MediumTest | Level0) -{ - styleVar->SetStyle(STYLE_TEXT_OPA, OPA_OPAQUE); - EXPECT_EQ(styleVar->GetStyle(STYLE_TEXT_OPA), OPA_OPAQUE); -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_SETSTYLE_2100 - * @tc.name test style set-style21 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_SetStyle_2100, Function | MediumTest | Level0) -{ - styleVar->SetStyle(STYLE_LINE_COLOR, Color::Gray().full); - EXPECT_EQ(styleVar->GetStyle(STYLE_LINE_COLOR), Color::Gray().full); -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_SETSTYLE_2200 - * @tc.name test style set-style22 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_SetStyle_2200, Function | MediumTest | Level0) -{ - styleVar->SetStyle(STYLE_LINE_WIDTH, 4); - EXPECT_EQ(styleVar->GetStyle(STYLE_LINE_WIDTH), 4); -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_SETSTYLE_2300 - * @tc.name test style set-style23 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_SetStyle_2300, Function | MediumTest | Level0) -{ - styleVar->SetStyle(STYLE_LINE_OPA, OPA_OPAQUE); - EXPECT_EQ(styleVar->GetStyle(STYLE_LINE_OPA), OPA_OPAQUE); -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_SETSTYLE_2400 - * @tc.name test style set-style24 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_SetStyle_2400, Function | MediumTest | Level0) -{ - styleVar->SetStyle(STYLE_LINE_CAP, CapType::CAP_ROUND); - EXPECT_EQ(styleVar->GetStyle(STYLE_LINE_CAP), CapType::CAP_ROUND); -} - - -/** - * @tc.number SUB_GRAPHIC_STYLE_INIT_2500 - * @tc.name test style init api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_Init_2500, Function | MediumTest | Level0) -{ - // static Style* styleVar; - styleDefault_->Init(); - EXPECT_EQ(0, 0); -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_GETBUTTONPRESSEDSTYLE_2600 - * @tc.name test style get-button-pressed-style api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_GetButtonPressedStyle_2600, Function | MediumTest | Level0) -{ - // static Style* styleVar; - styleDefault_->GetButtonPressedStyle(); - EXPECT_EQ(0, 0); -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_GETBUTTONRELEASEDSTYLE_2700 - * @tc.name test style get-button-released-style api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_GetButtonReleasedStyle_2700, Function | MediumTest | Level0) -{ - // static Style* styleVar; - styleDefault_->GetButtonReleasedStyle(); - EXPECT_EQ(0, 0); -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_GETBUTTONINACTIVESTYLE_2800 - * @tc.name test style get-button-inactived-style api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_GetButtonInactiveStyle_2800, Function | MediumTest | Level0) -{ - // static Style* styleVar; - styleDefault_->GetButtonInactiveStyle(); - EXPECT_EQ(0, 0); -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_GETLABELSTYLE_2900 - * @tc.name test style get-label-style api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_GetLabelStyle_2900, Function | MediumTest | Level0) -{ - // static Style* styleVar; - styleDefault_->GetButtonInactiveStyle(); - EXPECT_EQ(0, 0); -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_GETPICKERGROUNDSTYLE_3000 - * @tc.name test style get-picker-background-style api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_GetPickerBackgroundStyle_3000, Function | MediumTest | Level0) -{ - // static Style* styleVar; - styleDefault_->GetPickerBackgroundStyle(); - EXPECT_EQ(0, 0); -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_GETPICKERHIGHLIGHTSTYLE_3100 - * @tc.name test style get-picker-highlight-style api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_GetPickerHighlightStyle_3100, Function | MediumTest | Level0) -{ - // static Style* styleVar; - styleDefault_->GetPickerHighlightStyle(); - EXPECT_EQ(0, 0); -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_GETPROGRESSBACKGROUNDSTYLE_3200 - * @tc.name test style get-progress-background-style api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_GetProgressBackgroundStyle_3200, Function | MediumTest | Level0) -{ - // static Style* styleVar; - styleDefault_->GetProgressBackgroundStyle(); - EXPECT_EQ(0, 0); -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_GETPROGRESSFOREGROUNDSTYLE_3300 - * @tc.name test style get-progress-foreground-style api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_GetProgressForegroundStyle_3300, Function | MediumTest | Level0) -{ - // static Style* styleVar; - styleDefault_->GetProgressForegroundStyle(); - EXPECT_EQ(0, 0); -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_GETSLIDERKNOBSTYLE_3400 - * @tc.name test style get-slider-knob-style api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_GetSliderKnobStyle_3400, Function | MediumTest | Level0) -{ - // static Style* styleVar; - styleDefault_->GetSliderKnobStyle(); - EXPECT_EQ(0, 0); -} - -/** - * @tc.number SUB_GRAPHIC_STYLE_GETBACKGROUNDTRANSPARENTSTYLE_3500 - * @tc.name test style get-background-transparent-style api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(StyleTest, Graphic_Style_Test_GetBackgroundTransparentStyle_3500, Function | MediumTest | Level0) -{ - // static Style* styleVar; - styleDefault_->GetBackgroundTransparentStyle(); - EXPECT_EQ(0, 0); -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/theme_posix/BUILD.gn b/graphic_lite/ui/theme_posix/BUILD.gn deleted file mode 100755 index b1b6d034c..000000000 --- a/graphic_lite/ui/theme_posix/BUILD.gn +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsThemeTest") { - suite_name = "acts" - sources = [ - "src/theme_manager_test.cpp", - "src/theme_test.cpp", - ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/theme_posix/Test.json b/graphic_lite/ui/theme_posix/Test.json deleted file mode 100644 index ff01e2386..000000000 --- a/graphic_lite/ui/theme_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsThemeTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/theme_posix/src/theme_manager_test.cpp b/graphic_lite/ui/theme_posix/src/theme_manager_test.cpp deleted file mode 100755 index 91673b677..000000000 --- a/graphic_lite/ui/theme_posix/src/theme_manager_test.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "themes/theme_manager.h" - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class ThemeManagerTest : public testing::Test { -public: - static void SetUpTestCase(void); - static void TearDownTestCase(void); -}; - -void ThemeManagerTest::SetUpTestCase(void) -{ -} - -void ThemeManagerTest::TearDownTestCase(void) -{ -} - -/** - * @tc.number SUB_GRAPHIC_THEMESMANAGER_SETCURRENT_0100 - * @tc.name test themes-manager set-current api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ThemeManagerTest, Graphic_ThemesManager_Test_SetCurrent_0100, Function | MediumTest | Level0) -{ - Theme* theme = new Theme(); - ThemeManager::GetInstance().SetCurrent(theme); - EXPECT_EQ(ThemeManager::GetInstance().GetCurrent(), theme); -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/theme_posix/src/theme_test.cpp b/graphic_lite/ui/theme_posix/src/theme_test.cpp deleted file mode 100755 index cfc7c232d..000000000 --- a/graphic_lite/ui/theme_posix/src/theme_test.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "themes/theme.h" - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class ThemeTest : public testing::Test { -public: - static void SetUpTestCase(void); - static void TearDownTestCase(void); -}; - -void ThemeTest::SetUpTestCase(void) -{ - return; -} - -void ThemeTest::TearDownTestCase(void) -{ - return; -} - -/** - * @tc.number SUB_GRAPHIC_THEME_GETMAINSTYLE_0100 - * @tc.name test theme get-main-style api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ThemeTest, Graphic_Theme_Test_GetMainStyle_0100, Function | MediumTest | Level0) -{ - Theme* testObj = new Theme(); - testObj->GetMainStyle(); - EXPECT_EQ(0, 0); - - delete testObj; -} - -/** - * @tc.number SUB_GRAPHIC_THEME_GETBUTTONSTYLE_0200 - * @tc.name test theme get-button-style api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ThemeTest, Graphic_Theme_Test_GetButtonStyle_0200, Function | MediumTest | Level0) -{ - Theme* testObj = new Theme(); - testObj->GetButtonStyle(); - EXPECT_EQ(0, 0); - - delete testObj; -} - -/** - * @tc.number SUB_GRAPHIC_THEME_GETLABELSTYLE_0300 - * @tc.name test theme get-label-style api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ThemeTest, Graphic_Theme_Test_GetLabelStyle_0300, Function | MediumTest | Level0) -{ - Theme* testObj = new Theme(); - testObj->GetLabelStyle(); - EXPECT_EQ(0, 0); - - delete testObj; -} - -/** - * @tc.number SUB_GRAPHIC_THEME_GETPICKERBACKGROUNDSTYLE_0400 - * @tc.name test theme get-picker-background-style api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ThemeTest, Graphic_Theme_Test_GetPickerBackgroundStyle_0400, Function | MediumTest | Level0) -{ - Theme* testObj = new Theme(); - testObj->GetPickerBackgroundStyle(); - EXPECT_EQ(0, 0); - - delete testObj; -} - -/** - * @tc.number SUB_GRAPHIC_THEME_GETPICKERHIGHLIGHTSTYLE_0500 - * @tc.name test theme get-picker-highlight-style api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ThemeTest, Graphic_Theme_Test_GetPickerHighlightStyle_0500, Function | MediumTest | Level0) -{ - Theme* testObj = new Theme(); - testObj->GetPickerHighlightStyle(); - EXPECT_EQ(0, 0); - - delete testObj; -} - -/** - * @tc.number SUB_GRAPHIC_THEME_GETPROGRESSBACKGROUNDSTYLE_0600 - * @tc.name test theme get-progress-background-style api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ThemeTest, Graphic_Theme_Test_GetProgressBackgroundStyle_0600, Function | MediumTest | Level0) -{ - Theme* testObj = new Theme(); - testObj->GetProgressBackgroundStyle(); - EXPECT_EQ(0, 0); - - delete testObj; -} - -/** - * @tc.number SUB_GRAPHIC_THEME_GETPROGRESSFOREGROUNDSTYLE_0700 - * @tc.name test theme get-progress-foreground-style api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ThemeTest, Graphic_Theme_Test_GetProgressForegroundStyle_0700, Function | MediumTest | Level0) -{ - Theme* testObj = new Theme(); - testObj->GetProgressForegroundStyle(); - EXPECT_EQ(0, 0); - - delete testObj; -} - -/** - * @tc.number SUB_GRAPHIC_THEME_GETSLIDERKNOBSTYLE_0800 - * @tc.name test theme get-slider-knob-style api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ThemeTest, Graphic_Theme_Test_GetSliderKnobStyle_0800, Function | MediumTest | Level0) -{ - Theme* testObj = new Theme(); - testObj->GetSliderKnobStyle(); - EXPECT_EQ(0, 0); - - delete testObj; -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/ui_abstract_progress_posix/BUILD.gn b/graphic_lite/ui/ui_abstract_progress_posix/BUILD.gn deleted file mode 100755 index bc5dc42b3..000000000 --- a/graphic_lite/ui/ui_abstract_progress_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUIAbstractProgressTest") { - suite_name = "acts" - sources = [ "src/ui_abstract_progress_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/ui_abstract_progress_posix/Test.json b/graphic_lite/ui/ui_abstract_progress_posix/Test.json deleted file mode 100644 index 9b33c35a8..000000000 --- a/graphic_lite/ui/ui_abstract_progress_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUIAbstractProgressTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_abstract_progress_posix/src/ui_abstract_progress_test.cpp b/graphic_lite/ui/ui_abstract_progress_posix/src/ui_abstract_progress_test.cpp deleted file mode 100755 index dfeb7d8e5..000000000 --- a/graphic_lite/ui/ui_abstract_progress_posix/src/ui_abstract_progress_test.cpp +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "components/ui_abstract_progress.h" - -#include -#include - -using namespace std; -using namespace testing::ext; - -namespace OHOS { -class UiAbstractProgressTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_ABSTRACTPAOGRESS_GETVIEWTYPE_0100 - * @tc.name test abstract get-viewtype api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiAbstractProgressTest, Graphic_UIAbsatrctProgressTest_Test_GetViewType_0100, Function | MediumTest | Level0) -{ - UIAbstractProgress *abstractProgress = new UIAbstractProgress(); - EXPECT_EQ(abstractProgress->GetViewType(), UI_ABSTRACT_PROGRESS); - delete abstractProgress; -} - -/** - * @tc.number SUB_GRAPHIC_ABSTRACTPAOGRESS_SETVALUE_0200 - * @tc.name test abstract set-value api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiAbstractProgressTest, Graphic_UIAbsatrctProgressTest_Test_SetValue_0200, Function | MediumTest | Level0) -{ - UIAbstractProgress *abstractProgress = new UIAbstractProgress(); - int16_t value = 8; - abstractProgress->SetValue(value); - EXPECT_EQ(abstractProgress->GetValue(), value); - delete abstractProgress; -} - -/** - * @tc.number SUB_GRAPHIC_ABSTRACTPAOGRESS_SETRANGE_0300 - * @tc.name test abstract set-range api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiAbstractProgressTest, Graphic_UIAbsatrctProgressTest_Test_SetRange_0300, Function | MediumTest | Level0) -{ - UIAbstractProgress *abstractProgress = new UIAbstractProgress(); - int16_t rangeMax = 8; - int16_t rangeMin = 2; - abstractProgress->SetRange(rangeMax, rangeMin); - EXPECT_EQ(abstractProgress->GetRangeMin(), rangeMin); - EXPECT_EQ(abstractProgress->GetRangeMax(), rangeMax); - delete abstractProgress; -} - -/** - * @tc.number SUB_GRAPHIC_ABSTRACTPAOGRESS_SETSTEP_0400 - * @tc.name test abstract set-step api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiAbstractProgressTest, Graphic_UIAbsatrctProgressTest_Test_SetStep_0400, Function | MediumTest | Level0) -{ - UIAbstractProgress *abstractProgress = new UIAbstractProgress(); - uint16_t step = 8; - abstractProgress->SetStep(step); - EXPECT_EQ(abstractProgress->GetStep(), step); - delete abstractProgress; -} - -/** - * @tc.number SUB_GRAPHIC_ABSTRACTPAOGRESS_SETBACKGROUNDSTYLE_0500 - * @tc.name test abstract set-background-style api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiAbstractProgressTest, - Graphic_UIAbsatrctProgressTest_Test_SetBackgroundStyle_0500, - Function | MediumTest | Level0) -{ - UIAbstractProgress *abstractProgress = new UIAbstractProgress(); - Style style; - style.imageOpa_ = 100; - style.lineOpa_ = 100; - style.borderRadius_ = 10; - abstractProgress->SetBackgroundStyle(style); - EXPECT_EQ(abstractProgress->GetBackgroundStyle().imageOpa_, 100); - - abstractProgress->SetBackgroundStyle(STYLE_BACKGROUND_COLOR, 1); - EXPECT_EQ(abstractProgress->GetBackgroundStyle(STYLE_BACKGROUND_COLOR), 1); - - delete abstractProgress; -} - -/** - * @tc.number SUB_GRAPHIC_ABSTRACTPAOGRESS_SETFOREGROUNDSTYLE_0600 - * @tc.name test abstract set-foreground-style api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiAbstractProgressTest, - Graphic_UIAbsatrctProgressTest_Test_SetForegroundStyle_0600, - Function | MediumTest | Level0) -{ - UIAbstractProgress *abstractProgress = new UIAbstractProgress(); - Style style; - style.imageOpa_ = 100; - style.lineOpa_ = 100; - style.borderRadius_ = 10; - abstractProgress->SetForegroundStyle(style); - EXPECT_EQ(abstractProgress->GetForegroundStyle().imageOpa_, 100); - - abstractProgress->SetForegroundStyle(STYLE_BACKGROUND_COLOR, 1); - EXPECT_EQ(abstractProgress->GetForegroundStyle(STYLE_BACKGROUND_COLOR), 1); - - delete abstractProgress; -} - - -/** - * @tc.number SUB_GRAPHIC_ABSTRACTPAOGRESS_ENABLEBACKGROUND_0700 - * @tc.name test abstract enable-background api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiAbstractProgressTest, - Graphic_UIAbsatrctProgressTest_Test_EnableBackground_0700, - Function | MediumTest | Level0) -{ - UIAbstractProgress *abstractProgress = new UIAbstractProgress(); - - abstractProgress->EnableBackground(true); - EXPECT_EQ(0, 0); - - delete abstractProgress; -} - -/** - * @tc.number SUB_GRAPHIC_ABSTRACTPAOGRESS_SETIMAGE_0800 - * @tc.name test abstract SetImage api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiAbstractProgressTest, Graphic_UIAbsatrctProgressTest_Test_SetImage_0800, Function | MediumTest | Level0) -{ - UIAbstractProgress *abstractProgress = new UIAbstractProgress(); - - abstractProgress->SetImage("..\\config\\images\\A021_006.bin", "..\\config\\images\\A021_005.bin"); - EXPECT_EQ(0, 0); - - abstractProgress->SetImage(static_cast(nullptr)); - EXPECT_EQ(0, 0); - - delete abstractProgress; -} - -/** - * @tc.number SUB_GRAPHIC_ABSTRACTPAOGRESS_SETCAPTYPE_0900 - * @tc.name test abstract set-cap-type api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UiAbstractProgressTest, Graphic_UIAbsatrctProgressTest_Test_SetCapType_0900, Function | MediumTest | Level0) -{ - UIAbstractProgress *abstractProgress = new UIAbstractProgress(); - - abstractProgress->SetCapType(CapType::CAP_NONE); - EXPECT_EQ(0, 0); - delete abstractProgress; -} -} diff --git a/graphic_lite/ui/ui_analog_clock_posix/BUILD.gn b/graphic_lite/ui/ui_analog_clock_posix/BUILD.gn deleted file mode 100755 index 248fb72e9..000000000 --- a/graphic_lite/ui/ui_analog_clock_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUIAnalogClockTest") { - suite_name = "acts" - sources = [ "src/ui_analog_clock_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/ui_analog_clock_posix/Test.json b/graphic_lite/ui/ui_analog_clock_posix/Test.json deleted file mode 100644 index 0f7e485eb..000000000 --- a/graphic_lite/ui/ui_analog_clock_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUIAnalogClockTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_analog_clock_posix/src/ui_analog_clock_test.cpp b/graphic_lite/ui/ui_analog_clock_posix/src/ui_analog_clock_test.cpp deleted file mode 100755 index 97f3385c8..000000000 --- a/graphic_lite/ui/ui_analog_clock_posix/src/ui_analog_clock_test.cpp +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "components/ui_abstract_clock.h" -#include "components/ui_analog_clock.h" -#include "components/ui_image_view.h" - -#include -#include - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class UIAnalogClockTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_ANALOGCLOCK_GETVIEWTYPE_0100 - * @tc.name test analog-clock get-viewtype api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIAnalogClockTest, Graphic_UIAnalogClockTest_Test_GetViewType_0100, Function | MediumTest | Level0) -{ - UIAnalogClock* clock = new UIAnalogClock(); - EXPECT_EQ(clock->GetViewType(), UI_ANALOG_CLOCK); - delete clock; -} - -/** - * @tc.number SUB_GRAPHIC_ANALOGCLOCK_GETVIEWTYPE_0200 - * @tc.name test analog-clock get-viewtype2 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIAnalogClockTest, Graphic_UIAnalogClockTest_Test_GetViewType_0200, Function | MediumTest | Level0) -{ - UIAnalogClock* clock = new UIAnalogClock(); - clock->SetPosition(10, 20); - EXPECT_EQ(clock->GetY(), 20); - - clock->SetPosition(100, 200, 300, 400); - EXPECT_EQ(clock->GetY(), 200); - delete clock; -} - -/** - * @tc.number SUB_GRAPHIC_ANALOGCLOCK_SETTIME24HOUR_0300 - * @tc.name test analog-clock set-time-24hour api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIAnalogClockTest, Graphic_UIAnalogClockTest_Test_SetTime24Hour_0300, Function | MediumTest | Level0) -{ - UIAnalogClock* clock = new UIAnalogClock(); - uint8_t currentHour = 14; - uint8_t currentMinute = 40; - uint8_t currentSecond = 30; - clock->SetTime24Hour(currentHour, currentMinute, currentSecond); - - EXPECT_EQ(clock->GetCurrentHour(), currentHour); - EXPECT_EQ(clock->GetCurrentMinute(), currentMinute); - EXPECT_EQ(clock->GetCurrentSecond(), currentSecond); - delete clock; -} - -/** - * @tc.number SUB_GRAPHIC_ANALOGCLOCK_SETTIME12HOUR_0400 - * @tc.name test analog-clock set-time-12hour-am api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIAnalogClockTest, Graphic_UIAnalogClockTest_Test_SetTime12Hour_0400, Function | MediumTest | Level0) -{ - UIAnalogClock* clock = new UIAnalogClock(); - uint8_t currentHour = 10; - uint8_t currentMinute = 40; - uint8_t currentSecond = 30; - clock->SetTime12Hour(currentHour, currentMinute, currentSecond, true); - - EXPECT_EQ(clock->GetCurrentHour(), currentHour); - EXPECT_EQ(clock->GetCurrentMinute(), currentMinute); - EXPECT_EQ(clock->GetCurrentSecond(), currentSecond); - delete clock; -} - -/** - * @tc.number SUB_GRAPHIC_ANALOGCLOCK_SETTIME12HOUR_0500 - * @tc.name test analog-clock set-time-12hour-pm api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIAnalogClockTest, Graphic_UIAnalogClockTest_Test_SetTime12Hour_0500, Function | MediumTest | Level0) -{ - UIAnalogClock* clock = new UIAnalogClock(); - uint8_t currentHour = 10; - uint8_t currentMinute = 40; - uint8_t currentSecond = 30; - clock->SetTime12Hour(currentHour, currentMinute, currentSecond, false); - - EXPECT_EQ(clock->GetCurrentHour(), currentHour + 12); - EXPECT_EQ(clock->GetCurrentMinute(), currentMinute); - EXPECT_EQ(clock->GetCurrentSecond(), currentSecond); - delete clock; -} - -/** - * @tc.number SUB_GRAPHIC_ANALOGCLOCK_SETHANDIMAGE_0600 - * @tc.name test analog-clock set-hand-image api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIAnalogClockTest, Graphic_UIAnalogClockTest_Test_SetHandImage_0600, Function | MediumTest | Level0) -{ - UIAnalogClock* clock = new UIAnalogClock(); - Point position = { 214, 3 }; - Point center = { 14, 223 }; - clock->SetHandLine(UIAnalogClock::HandType::SECOND_HAND, position, center, Color::White(), 1, 223, 255); - EXPECT_EQ(clock->GetHandPosition(UIAnalogClock::HandType::SECOND_HAND).x, position.x); - EXPECT_EQ(clock->GetHandPosition(UIAnalogClock::HandType::SECOND_HAND).y, position.y); - EXPECT_EQ(clock->GetHandRotateCenter(UIAnalogClock::HandType::SECOND_HAND).x, center.x); - EXPECT_EQ(clock->GetHandRotateCenter(UIAnalogClock::HandType::SECOND_HAND).y, center.y); - delete clock; -} - -/** - * @tc.number SUB_GRAPHIC_ANALOGCLOCK_SETINITTIME24HOUR_0700 - * @tc.name test analog-clock set-init-time-24hour api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIAnalogClockTest, Graphic_UIAnalogClockTest_Test_SetInitTime24Hour_0700, Function | MediumTest | Level0) -{ - uint8_t initHour = 6; - uint8_t initMinute = 0; - uint8_t initSecond = 0; - UIAnalogClock* clock = new UIAnalogClock(); - clock->SetInitTime24Hour(initHour, initMinute, initSecond); - EXPECT_EQ(clock->GetCurrentHour(), initHour); - EXPECT_EQ(clock->GetCurrentMinute(), initMinute); - EXPECT_EQ(clock->GetCurrentSecond(), initSecond); - EXPECT_EQ(clock->GetHandInitAngle(UIAnalogClock::HandType::HOUR_HAND), 180); - EXPECT_EQ(clock->GetHandCurrentAngle(UIAnalogClock::HandType::HOUR_HAND), 180); - - uint8_t currentHour = 9; - uint8_t currentMinute = 0; - uint8_t currentSecond = 0; - clock->SetTime24Hour(currentHour, currentMinute, currentSecond); - EXPECT_EQ(clock->GetHandInitAngle(UIAnalogClock::HandType::HOUR_HAND), 180); - EXPECT_EQ(clock->GetHandCurrentAngle(UIAnalogClock::HandType::HOUR_HAND), 270); - delete clock; -} - -/** - * @tc.number SUB_GRAPHIC_ANALOGCLOCK_SETINITTIME12HOUR_0800 - * @tc.name test analog-clock set-init-time-12hour-am api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIAnalogClockTest, Graphic_UIAnalogClockTest_Test_SetInitTime12Hour_0800, Function | MediumTest | Level0) -{ - uint8_t initHour = 6; - uint8_t initMinute = 0; - uint8_t initSecond = 0; - UIAnalogClock* clock = new UIAnalogClock(); - clock->SetInitTime12Hour(initHour, initMinute, initSecond, true); - EXPECT_EQ(clock->GetCurrentHour(), initHour); - EXPECT_EQ(clock->GetCurrentMinute(), initMinute); - EXPECT_EQ(clock->GetCurrentSecond(), initSecond); - EXPECT_EQ(clock->GetHandInitAngle(UIAnalogClock::HandType::HOUR_HAND), 180); - EXPECT_EQ(clock->GetHandCurrentAngle(UIAnalogClock::HandType::HOUR_HAND), 180); - delete clock; -} - -/** - * @tc.number SUB_GRAPHIC_ANALOGCLOCK_SETINITTIME12HOUR_0900 - * @tc.name test analog-clock set-init-time-12hour-pm api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIAnalogClockTest, Graphic_UIAnalogClockTest_Test_SetInitTime12Hour_0900, Function | MediumTest | Level0) -{ - uint8_t initHour = 6; - uint8_t initMinute = 0; - uint8_t initSecond = 0; - UIAnalogClock* clock = new UIAnalogClock(); - clock->SetInitTime12Hour(initHour, initMinute, initSecond, false); - EXPECT_EQ(clock->GetCurrentHour(), initHour + 12); - EXPECT_EQ(clock->GetCurrentMinute(), initMinute); - EXPECT_EQ(clock->GetCurrentSecond(), initSecond); - EXPECT_EQ(clock->GetHandInitAngle(UIAnalogClock::HandType::HOUR_HAND), 180); - EXPECT_EQ(clock->GetHandCurrentAngle(UIAnalogClock::HandType::HOUR_HAND), 180); - delete clock; -} -} diff --git a/graphic_lite/ui/ui_arc_lable_posix/BUILD.gn b/graphic_lite/ui/ui_arc_lable_posix/BUILD.gn deleted file mode 100755 index b6b80698d..000000000 --- a/graphic_lite/ui/ui_arc_lable_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUIArcLabelTest") { - suite_name = "acts" - sources = [ "src/ui_arc_label_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/ui_arc_lable_posix/Test.json b/graphic_lite/ui/ui_arc_lable_posix/Test.json deleted file mode 100644 index 2dc42f7f4..000000000 --- a/graphic_lite/ui/ui_arc_lable_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUIArcLabelTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_arc_lable_posix/src/ui_arc_label_test.cpp b/graphic_lite/ui/ui_arc_lable_posix/src/ui_arc_label_test.cpp deleted file mode 100755 index d8f266aac..000000000 --- a/graphic_lite/ui/ui_arc_lable_posix/src/ui_arc_label_test.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "components/ui_arc_label.h" - -using namespace std; -using namespace testing::ext; - -namespace OHOS { -class UIArcLabelTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_ARCLABEL_GETVIEWTYPE_0100 - * @tc.name test arc-label get-viewtype api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIArcLabelTest, Graphic_UIArcLabelTest_Test_GetViewType_0100, Function | MediumTest | Level0) -{ - UIArcLabel *arcLabel = new UIArcLabel(); - EXPECT_EQ(arcLabel->GetViewType(), UI_ARC_LABEL); - delete arcLabel; -} - -/** - * @tc.number SUB_GRAPHIC_ARCLABEL_GETWIDTH_0200 - * @tc.name test arc-label get-width api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIArcLabelTest, Graphic_UIArcLabelTest_Test_GetWidth_0200, Function | MediumTest | Level0) -{ - UIArcLabel *arcLabel = new UIArcLabel(); - int16_t width = 100; - arcLabel->SetWidth(width); - EXPECT_EQ(arcLabel->GetWidth(), width); - delete arcLabel; -} - -/** - * @tc.number SUB_GRAPHIC_ARCLABEL_GETHEIGHT_0300 - * @tc.name test arc-label get-height api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIArcLabelTest, Graphic_UIArcLabelTest_Test_GetHeight_0300, Function | MediumTest | Level0) -{ - UIArcLabel *arcLabel = new UIArcLabel(); - int16_t height = 100; - arcLabel->SetHeight(height); - EXPECT_EQ(arcLabel->GetHeight(), height); - delete arcLabel; -} - -/** - * @tc.number SUB_GRAPHIC_ARCLABEL_SETTEXT_0400 - * @tc.name test arc-label set-text api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIArcLabelTest, Graphic_UIArcLabelTest_Test_SetText_0400, Function | MediumTest | Level0) -{ - UIArcLabel *arcLabel = new UIArcLabel(); - const char* text = "abc"; - arcLabel->SetText(text); - EXPECT_EQ(strcmp(arcLabel->GetText(), text), 0); - delete arcLabel; -} - -/** - * @tc.number SUB_GRAPHIC_ARCLABEL_SETALIGN_0500 - * @tc.name test arc-label set-align api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIArcLabelTest, Graphic_UIArcLabelTest_Test_SetAlign_0500, Function | MediumTest | Level0) -{ - UIArcLabel *arcLabel = new UIArcLabel(); - UITextLanguageAlignment horizontalAlign = TEXT_ALIGNMENT_LEFT; - arcLabel->SetAlign(horizontalAlign); - EXPECT_EQ(arcLabel->GetHorAlign(), horizontalAlign); - delete arcLabel; -} - -/** - * @tc.number SUB_GRAPHIC_ARCLABEL_SETARCTEXTCENTER_0600 - * @tc.name test arc-label set-arc-text-canter api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIArcLabelTest, Graphic_UIArcLabelTest_Test_SetArcTextCenter_0600, Function | MediumTest | Level0) -{ - UIArcLabel *arcLabel = new UIArcLabel(); - int16_t x = 10; - int16_t y = 15; - arcLabel->SetArcTextCenter(x, y); - EXPECT_EQ(arcLabel->GetArcTextCenter().x, x); - EXPECT_EQ(arcLabel->GetArcTextCenter().y, y); - delete arcLabel; -} - -/** - * @tc.number SUB_GRAPHIC_ARCLABEL_SETARCTEXTRADIO_0700 - * @tc.name test arc-label set-arc-text-radio api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIArcLabelTest, Graphic_UIArcLabelTest_Test_SetArcTextRadius_0700, Function | MediumTest | Level0) -{ - UIArcLabel *arcLabel = new UIArcLabel(); - int16_t radius = 10; - arcLabel->SetArcTextRadius(radius); - EXPECT_EQ(arcLabel->GetArcTextRadius(), radius); - delete arcLabel; -} - -/** - * @tc.number SUB_GRAPHIC_ARCLABEL_SETARCTEXTANGLE_0800 - * @tc.name test arc-label set-arc-text-angle api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIArcLabelTest, Graphic_UIArcLabelTest_Test_SetArcTextAngle_0800, Function | MediumTest | Level0) -{ - UIArcLabel *arcLabel = new UIArcLabel(); - int16_t startAngle = 10; - int16_t endAngle = 20; - arcLabel->SetArcTextAngle(startAngle, endAngle); - EXPECT_EQ(arcLabel->GetArcTextStartAngle(), startAngle); - EXPECT_EQ(arcLabel->GetArcTextEndAngle(), endAngle); - delete arcLabel; -} - -/** - * @tc.number SUB_GRAPHIC_ARCLABEL_SETARCTEXTORIENTATION_0900 - * @tc.name test arc-label set-arc-text-orientation api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIArcLabelTest, Graphic_UIArcLabelTest_Test_SetArcTextOrientation_0900, Function | MediumTest | Level0) -{ - UIArcLabel *arcLabel = new UIArcLabel(); - arcLabel->SetArcTextOrientation(UIArcLabel::TextOrientation::INSIDE); - EXPECT_EQ(arcLabel->GetArcTextOrientation(), - UIArcLabel::TextOrientation::INSIDE); - arcLabel->SetArcTextOrientation(UIArcLabel::TextOrientation::OUTSIDE); - EXPECT_EQ(arcLabel->GetArcTextOrientation(), - UIArcLabel::TextOrientation::OUTSIDE); - delete arcLabel; -} -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_axis_posix/BUILD.gn b/graphic_lite/ui/ui_axis_posix/BUILD.gn deleted file mode 100755 index 60e9a2c39..000000000 --- a/graphic_lite/ui/ui_axis_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUIAxisTest") { - suite_name = "acts" - sources = [ "src/ui_axis_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/ui_axis_posix/Test.json b/graphic_lite/ui/ui_axis_posix/Test.json deleted file mode 100644 index 306edba11..000000000 --- a/graphic_lite/ui/ui_axis_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUIAxisTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_axis_posix/src/ui_axis_test.cpp b/graphic_lite/ui/ui_axis_posix/src/ui_axis_test.cpp deleted file mode 100755 index 79a6b7ce7..000000000 --- a/graphic_lite/ui/ui_axis_posix/src/ui_axis_test.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "components/ui_axis.h" - -using namespace std; -using namespace testing::ext; - -namespace OHOS { -class UIAxisTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_AXIS_GETVIEWTYPE_0100 - * @tc.name test axis get-viewtype api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIAxisTest, Graphic_UIAxisTest_Test_GetViewType_0100, Function | MediumTest | Level0) -{ - UIXAxis *axis = new UIXAxis(); - EXPECT_EQ(axis->GetViewType(), UI_AXIS); - delete axis; -} - -/** - * @tc.number SUB_GRAPHIC_AXIS_SETDATARANGE_0200 - * @tc.name test axis set-data-rangX api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIAxisTest, Graphic_UIAxisTest_Test_SetDataRange_0200, Function | MediumTest | Level0) -{ - UIXAxis *axis = new UIXAxis(); - uint16_t min = 10; - uint16_t max = 100; - EXPECT_EQ(axis->SetDataRange(min, max), true); - delete axis; -} - -/** - * @tc.number SUB_GRAPHIC_AXIS_SETDATARANGE_0300 - * @tc.name test axis set-data-rangX2 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIAxisTest, Graphic_UIAxisTest_Test_SetDataRange_0300, Function | MediumTest | Level0) -{ - UIYAxis *axis = new UIYAxis(); - uint16_t min = 100; - uint16_t max = 10; - EXPECT_EQ(axis->SetDataRange(min, max), false); - delete axis; -} - -/** - * @tc.number SUB_GRAPHIC_AXIS_SETDATARANGE_0400 - * @tc.name test axis set-data-rangY api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIAxisTest, Graphic_UIAxisTest_Test_SetDataRange_0400, Function | MediumTest | Level0) -{ - UIYAxis *axis = new UIYAxis(); - uint16_t min = 10; - uint16_t max = 100; - EXPECT_EQ(axis->SetDataRange(min, max), true); - delete axis; -} - -/** - * @tc.number SUB_GRAPHIC_AXIS_SETDATARANGE_0500 - * @tc.name test axis set-data-rangY2 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIAxisTest, Graphic_UIAxisTest_Test_SetDataRange_0500, Function | MediumTest | Level0) -{ - UIYAxis *axis = new UIYAxis(); - uint16_t min = 100; - uint16_t max = 10; - EXPECT_EQ(axis->SetDataRange(min, max), false); - delete axis; -} -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_box_porgress_posix/BUILD.gn b/graphic_lite/ui/ui_box_porgress_posix/BUILD.gn deleted file mode 100755 index f0e9f103d..000000000 --- a/graphic_lite/ui/ui_box_porgress_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUIBoxProgressTest") { - suite_name = "acts" - sources = [ "src/ui_box_progress_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/ui_box_porgress_posix/Test.json b/graphic_lite/ui/ui_box_porgress_posix/Test.json deleted file mode 100644 index 1fb2a0876..000000000 --- a/graphic_lite/ui/ui_box_porgress_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUIBoxProgressTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_box_porgress_posix/src/ui_box_progress_test.cpp b/graphic_lite/ui/ui_box_porgress_posix/src/ui_box_progress_test.cpp deleted file mode 100755 index b3dc3f562..000000000 --- a/graphic_lite/ui/ui_box_porgress_posix/src/ui_box_progress_test.cpp +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "components/root_view.h" -#include "components/ui_view_group.h" -#include "components/ui_box_progress.h" - -#include -#include - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class UIBoxProgressTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; -class TestUIBoxProgress : public UIBoxProgress { -public: - TestUIBoxProgress() {} - virtual ~TestUIBoxProgress() {} -}; - -/** - * @tc.number SUB_GRAPHIC_BOXPROGRESS_GETVIEWTYPE_0100 - * @tc.name test box-progress get-viewtype api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIBoxProgressTest, Graphic_UIBoxProgressTest_Test_GetViewType_0100, Function | MediumTest | Level0) -{ - TestUIBoxProgress* boxProgress = new TestUIBoxProgress(); - EXPECT_EQ(boxProgress->GetViewType(), UI_BOX_PROGRESS); - delete boxProgress; -} - -/** - * @tc.number SUB_GRAPHIC_BOXPROGRESS_SETSTEP_0200 - * @tc.name test box-progress set-step api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIBoxProgressTest, Graphic_UIBoxProgressTest_Test_SetStep_0200, Function | MediumTest | Level0) -{ - TestUIBoxProgress* boxProgress = new TestUIBoxProgress(); - uint16_t step = 0; - int16_t value = 1; - boxProgress->SetRange(100, 0); - boxProgress->SetValue(0); - boxProgress->SetStep(step); - boxProgress->SetValue(value); - EXPECT_EQ(boxProgress->GetStep(), step); - EXPECT_EQ(boxProgress->GetValue(), value); - delete boxProgress; -} - -/** - * @tc.number SUB_GRAPHIC_BOXPROGRESS_SETDIRECTION_0300 - * @tc.name test box-progress set-direction api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIBoxProgressTest, Graphic_UIBoxProgressTest_Test_SetDirection_0300, Function | MediumTest | Level0) -{ - UIBoxProgress *boxProgress = new UIBoxProgress(); - UIBoxProgress::Direction direction = UIBoxProgress::Direction::DIR_BOTTOM_TO_TOP; - boxProgress->SetDirection(direction); - - EXPECT_EQ(boxProgress->GetDirection(), direction); - delete boxProgress; -} - -/** - * @tc.number SUB_GRAPHIC_BOXPROGRESS_SETVALIDWIDTH_0400 - * @tc.name test box-progress set-validwidth api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIBoxProgressTest, Graphic_UIBoxProgressTest_Test_SetValidWidth_0400, Function | MediumTest | Level0) -{ - UIBoxProgress *boxProgress = new UIBoxProgress(); - boxProgress->Resize(100, 100); - int16_t validWidth = 10; - boxProgress->SetValidWidth(validWidth); - EXPECT_EQ(boxProgress->GetValidWidth(), validWidth); - delete boxProgress; -} - -/** - * @tc.number SUB_GRAPHIC_BOXPROGRESS_SETVALIDHEIGHT_0500 - * @tc.name test box-progress set-validheight api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIBoxProgressTest, Graphic_UIBoxProgressTest_Test_SetValidHeight_0500, Function | MediumTest | Level0) -{ - UIBoxProgress *boxProgress = new UIBoxProgress(); - boxProgress->Resize(100, 100); - int16_t validHeight = 10; - boxProgress->SetValidHeight(validHeight); - EXPECT_EQ(boxProgress->GetValidHeight(), validHeight); - delete boxProgress; -} - -/** - * @tc.number SUB_GRAPHIC_BOXPROGRESS_SETVALUE_0600 - * @tc.name test box-progress set-value api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIBoxProgressTest, Graphic_UIBoxProgressTest_Test_SetValue_0600, Function | MediumTest | Level0) -{ - UIBoxProgress *boxProgress = new UIBoxProgress(); - int16_t value = 10; - boxProgress->SetValue(value); - EXPECT_EQ(boxProgress->GetValue(), value); - delete boxProgress; -} - -/** - * @tc.number SUB_GRAPHIC_BOXPROGRESS_SETRANGE_0700 - * @tc.name test box-progress set-range api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIBoxProgressTest, Graphic_UIBoxProgressTest_Test_SetRange_0700, Function | MediumTest | Level0) -{ - UIBoxProgress *boxProgress = new UIBoxProgress(); - int16_t rangeMax = 500; - int16_t rangeMin = 100; - boxProgress->SetRange(rangeMax, rangeMin); - EXPECT_EQ(boxProgress->GetRangeMax(), rangeMax); - EXPECT_EQ(boxProgress->GetRangeMin(), rangeMin); - delete boxProgress; -} - -/** - * @tc.number SUB_GRAPHIC_BOXPROGRESS_SETRANGE_0800 - * @tc.name test box-progress set-range2 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIBoxProgressTest, Graphic_UIBoxProgressTest_Test_SetRange_0800, Function | MediumTest | Level0) -{ - UIBoxProgress *boxProgress = new UIBoxProgress(); - int16_t rangeMax = 500; - int16_t rangeMin = 100; - boxProgress->SetRange(rangeMax, rangeMin); - - int16_t value = rangeMin - 1; - boxProgress->SetValue(value); - EXPECT_EQ(boxProgress->GetValue(), rangeMin); - - delete boxProgress; -} - -/** - * @tc.number SUB_GRAPHIC_BOXPROGRESS_SETRANGE_0900 - * @tc.name test box-progress set-Range3 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIBoxProgressTest, Graphic_UIBoxProgressTest_Test_SetRange_0900, Function | MediumTest | Level0) -{ - UIBoxProgress *boxProgress = new UIBoxProgress(); - int16_t rangeMax = 500; - int16_t rangeMin = 100; - boxProgress->SetRange(rangeMax, rangeMin); - - int16_t value = rangeMax + 1; - boxProgress->SetValue(value); - EXPECT_EQ(boxProgress->GetValue(), rangeMax); - - delete boxProgress; -} - -/** - * @tc.number SUB_GRAPHIC_BOXPROGRESS_SETWIDTH_1000 - * @tc.name test box-progress set-width api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIBoxProgressTest, Graphic_UIBoxProgressTest_Test_SetWidth_1000, Function | MediumTest | Level0) -{ - UIBoxProgress *boxProgress = new UIBoxProgress(); - int16_t width = 100; - boxProgress->SetWidth(width); - - EXPECT_EQ(boxProgress->GetWidth(), width); - EXPECT_EQ(boxProgress->GetValidWidth(), width); - - delete boxProgress; -} - -/** - * @tc.number SUB_GRAPHIC_BOXPROGRESS_SETHEIGHT_1100 - * @tc.name test box-progress set-height api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIBoxProgressTest, Graphic_UIBoxProgressTest_Test_SetHeight_1100, Function | MediumTest | Level0) -{ - UIBoxProgress *boxProgress = new UIBoxProgress(); - int16_t height = 100; - boxProgress->SetHeight(height); - - EXPECT_EQ(boxProgress->GetHeight(), height); - EXPECT_EQ(boxProgress->GetValidHeight(), height); - - delete boxProgress; -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/ui_button_posix/BUILD.gn b/graphic_lite/ui/ui_button_posix/BUILD.gn deleted file mode 100755 index 9b70e099b..000000000 --- a/graphic_lite/ui/ui_button_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUIButtonTest") { - suite_name = "acts" - sources = [ "src/ui_button_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/ui_button_posix/Test.json b/graphic_lite/ui/ui_button_posix/Test.json deleted file mode 100644 index dae3fd5bc..000000000 --- a/graphic_lite/ui/ui_button_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUIButtonTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_button_posix/src/ui_button_test.cpp b/graphic_lite/ui/ui_button_posix/src/ui_button_test.cpp deleted file mode 100755 index b1925ae56..000000000 --- a/graphic_lite/ui/ui_button_posix/src/ui_button_test.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "components/root_view.h" -#include "components/ui_button.h" -#include "components/ui_checkbox.h" -#include "components/ui_radio_button.h" -#include "components/ui_toggle_button.h" -#include "components/ui_view_group.h" - -#include -#include - -using namespace std; -using namespace testing::ext; - -namespace OHOS { -enum ButtonState : uint8_t { - RELEASED = 0, - PRESSED, - INACTIVE, - BTN_STATE_NUM, -}; - -class UIButtonTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_BUTTON_GETVIEWTYPE_0100 - * @tc.name test button get-view-type api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIButtonTest, Graphic_UIButtonTest_Test_GetViewType_0100, Function | MediumTest | Level0) -{ - UIButton* button = new UIButton(); - EXPECT_EQ(button->GetViewType(), UI_BUTTON); - delete button; -} - -/** - * @tc.number SUB_GRAPHIC_BUTTON_SETIMAGEPOSITION_0200 - * @tc.name test button set-image-position api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIButtonTest, Graphic_UIButtonTest_Test_SetImagePosition_0200, Function | MediumTest | Level0) -{ - UIButton* button = new UIButton(); - int16_t x = 10; - int16_t y = 12; - button->SetImagePosition(x, y); - EXPECT_EQ(button->GetImageX(), x); - EXPECT_EQ(button->GetImageY(), y); - delete button; -} - -/** - * @tc.number SUB_GRAPHIC_BUTTON_SETSTYLE_0300 - * @tc.name test button set-style api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIButtonTest, Graphic_UIButtonTest_Test_SetStyle_0300, Function | MediumTest | Level0) -{ - UIButton* button = new UIButton(); - button->SetStyle(STYLE_BACKGROUND_OPA, 10); - EXPECT_EQ(button->GetStyle(STYLE_BACKGROUND_OPA), 10); - delete button; -} - -/** - * @tc.number SUB_GRAPHIC_BUTTON_ISTOUCHABLE_0400 - * @tc.name test button is-touchable api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIButtonTest, Graphic_UIButtonTest_Test_IsTouchable_0400, Function | MediumTest | Level0) -{ - UIButton* button = new UIButton(); - - button->Enable(); - EXPECT_EQ(button->IsTouchable(), true); - - button->Disable(); - EXPECT_EQ(button->IsTouchable(), false); - delete button; -} - -/** - * @tc.number SUB_GRAPHIC_BUTTON_SETIMAGESRC_0500 - * @tc.name test button set-imagesrc api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIButtonTest, Graphic_UIButtonTest_SetImageSrc_0500, Function | MediumTest | Level0) -{ - UIButton* button = new UIButton(); - button->SetImageSrc("", ""); - EXPECT_EQ(0, 0); - delete button; -} - -/** - * @tc.number SUB_GRAPHIC_BUTTON_SETSTYLEFORSTATE_0600 - * @tc.name test button set-imagesrc api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIButtonTest, Graphic_UIButtonTest_SetStyleForState_0600, Function | MediumTest | Level0) -{ - UIButton* button = new UIButton(); - button->SetStyleForState(STYLE_BACKGROUND_OPA, 255, UIButton::PRESSED); - - EXPECT_EQ(button->GetStyleForState(STYLE_BACKGROUND_OPA, UIButton::PRESSED), 255); - delete button; -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/ui_canvas_posix/BUILD.gn b/graphic_lite/ui/ui_canvas_posix/BUILD.gn deleted file mode 100755 index 53a4e2387..000000000 --- a/graphic_lite/ui/ui_canvas_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUICanvasTest") { - suite_name = "acts" - sources = [ "src/ui_canvas_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/ui_canvas_posix/Test.json b/graphic_lite/ui/ui_canvas_posix/Test.json deleted file mode 100644 index 9cad66303..000000000 --- a/graphic_lite/ui/ui_canvas_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUICanvasTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_canvas_posix/src/ui_canvas_test.cpp b/graphic_lite/ui/ui_canvas_posix/src/ui_canvas_test.cpp deleted file mode 100755 index c97817a82..000000000 --- a/graphic_lite/ui/ui_canvas_posix/src/ui_canvas_test.cpp +++ /dev/null @@ -1,336 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "components/root_view.h" -#include "components/ui_view_group.h" -#include "components/ui_canvas.h" - -#include -#include - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class CanvasTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_CANVAS_SETPAINTSTYLE_0100 - * @tc.name test canvas set-paintstyle api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(CanvasTest, Graphic_UICanvas_Test_SetPaintStyle_0100, Function | MediumTest | Level0) -{ - Paint* paint = new Paint(); - Paint::PaintStyle paintStyle = Paint::PaintStyle::FILL_STYLE; - paint->SetStyle(Paint::PaintStyle::FILL_STYLE); - - EXPECT_EQ(paint->GetStyle(), paintStyle); - delete paint; -} - -/** - * @tc.number SUB_GRAPHIC_CANVAS_SETSTROKEWIDTH_0200 - * @tc.name test canvas set-strokewidth api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(CanvasTest, Graphic_UICanvas_Test_SetStrokeWidth_0200, Function | MediumTest | Level0) -{ - Paint* paint = new Paint(); - uint16_t width = 10; - paint->SetStrokeWidth(width); - - EXPECT_EQ(paint->GetStrokeWidth(), width); - delete paint; -} - -/** - * @tc.number SUB_GRAPHIC_CANVAS_SETSTROKECOLOR_0300 - * @tc.name test canvas set-stroker-color api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(CanvasTest, Graphic_UICanvas_Test_SetStrokeColor_0300, Function | MediumTest | Level0) -{ - Paint* paint = new Paint(); - ColorType color = Color::Red(); - paint->SetStrokeColor(color); - - EXPECT_EQ(paint->GetStrokeColor().full, color.full); - delete paint; -} - -/** - * @tc.number SUB_GRAPHIC_CANVAS_SETFILLCOLOR_0400 - * @tc.name test canvas set-fillcolor api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(CanvasTest, Graphic_UICanvas_Test_SetFillColor_0400, Function | MediumTest | Level0) -{ - Paint* paint = new Paint(); - ColorType color = Color::Red(); - paint->SetFillColor(color); - - EXPECT_EQ(paint->GetFillColor().full, color.full); - delete paint; -} - -/** - * @tc.number SUB_GRAPHIC_CANVAS_SETOPACITY_0500 - * @tc.name test canvas set-opacity api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(CanvasTest, Graphic_UICanvas_Test_SetOpacity_0500, Function | MediumTest | Level0) -{ - Paint* paint = new Paint(); - uint8_t opacity = 200; - paint->SetOpacity(opacity); - - EXPECT_EQ(paint->GetOpacity(), opacity); - delete paint; -} - -/** - * @tc.number SUB_GRAPHIC_CANVAS_STARTPOSITION_0600 - * @tc.name test canvas set-start-position api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(CanvasTest, Graphic_UICanvas_Test_SetStartPosition_0600, Function | MediumTest | Level0) -{ - UICanvas* canvas = new UICanvas(); - canvas->SetStartPosition({ 50, 100 }); - - EXPECT_EQ(canvas->GetStartPosition().x, 50); - EXPECT_EQ(canvas->GetStartPosition().y, 100); - delete canvas; -} - -/** - * @tc.number SUB_GRAPHIC_CANVAS_DRAWLINE_0700 - * @tc.name test canvas draw-line api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(CanvasTest, Graphic_UICanvas_Test_DrawLine_0700, Function | MediumTest | Level0) -{ - RootView* rootView = RootView::GetInstance(); - UIViewGroup* viewGroup = static_cast(rootView); - viewGroup->SetPosition(0, 0); - viewGroup->SetWidth(100); - viewGroup->SetHeight(100); - - UICanvas* canvas = new UICanvas(); - Paint paint; - canvas->DrawLine({ 0, 50 }, { 50, 100 }, paint); - - viewGroup->Add(canvas); - - EXPECT_EQ(canvas->GetStartPosition().x, 50); - EXPECT_EQ(canvas->GetStartPosition().y, 100); - viewGroup->Remove(canvas); - delete canvas; -} - -/** - * @tc.number SUB_GRAPHIC_CANVAS_DRAWCURVE_0800 - * @tc.name test canvas draw-curve api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(CanvasTest, Graphic_UICanvas_Test_DrawCurve_0800, Function | MediumTest | Level0) -{ - RootView* rootView = RootView::GetInstance(); - UIViewGroup* viewGroup = static_cast(rootView); - viewGroup->SetPosition(0, 0); - viewGroup->SetWidth(100); - viewGroup->SetHeight(100); - - UICanvas* canvas = new UICanvas(); - Paint paint; - canvas->DrawCurve({ 100, 100 }, { 150, 100 }, { 150, 100 }, { 150, 200 }, paint); - - viewGroup->Add(canvas); - EXPECT_EQ(canvas->GetStartPosition().x, 150); - EXPECT_EQ(canvas->GetStartPosition().y, 200); - - viewGroup->Remove(canvas); - delete canvas; -} - -/** - * @tc.number SUB_GRAPHIC_CANVAS_DRAWRECT_0900 - * @tc.name test canvas draw-rect api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(CanvasTest, Graphic_UICanvas_Test_DrawRect_0900, Function | MediumTest | Level0) -{ - RootView* rootView = RootView::GetInstance(); - UIViewGroup* viewGroup = static_cast(rootView); - viewGroup->SetPosition(0, 0); - viewGroup->SetWidth(100); - viewGroup->SetHeight(100); - - UICanvas* canvas = new UICanvas(); - Paint paint; - canvas->DrawRect({ 10, 10 }, 50, 50, paint); - - viewGroup->Add(canvas); - EXPECT_EQ(10, 10); - - viewGroup->Remove(canvas); - delete canvas; -} - -/** - * @tc.number SUB_GRAPHIC_CANVAS_DRAWCIRCLE_1000 - * @tc.name test canvas draw-circle api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(CanvasTest, Graphic_UICanvas_Test_DrawCircle_1000, Function | MediumTest | Level0) -{ - RootView* rootView = RootView::GetInstance(); - UIViewGroup* viewGroup = static_cast(rootView); - viewGroup->SetPosition(0, 0); - viewGroup->SetWidth(100); - viewGroup->SetHeight(100); - - UICanvas* canvas = new UICanvas(); - Paint paint; - canvas->DrawCircle({ 50, 50 }, 20, paint); - - viewGroup->Add(canvas); - EXPECT_EQ(0, 0); - - viewGroup->Remove(canvas); - delete canvas; -} - -/** - * @tc.number SUB_GRAPHIC_CANVAS_DRAWARC_1100 - * @tc.name test canvas draw-arc api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(CanvasTest, Graphic_UICanvas_Test_DrawArc_1100, Function | MediumTest | Level0) -{ - RootView* rootView = RootView::GetInstance(); - UIViewGroup* viewGroup = static_cast(rootView); - viewGroup->SetPosition(0, 0); - viewGroup->SetWidth(200); - viewGroup->SetHeight(200); - - UICanvas* canvas = new UICanvas(); - Paint paint; - canvas->DrawArc({ 100, 150 }, 50, 135, 270, paint); - - viewGroup->Add(canvas); - EXPECT_EQ(0, 0); - - viewGroup->Remove(canvas); - delete canvas; -} - -/** - * @tc.number SUB_GRAPHIC_CANVAS_DRAWSECTOR_1200 - * @tc.name test canvas draw-sector api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(CanvasTest, Graphic_UICanvas_Test_DrawSector_1200, Function | MediumTest | Level0) -{ - RootView* rootView = RootView::GetInstance(); - UIViewGroup* viewGroup = static_cast(rootView); - viewGroup->SetPosition(0, 0); - viewGroup->SetWidth(200); - viewGroup->SetHeight(200); - - UICanvas* canvas = new UICanvas(); - Paint paint; - canvas->DrawSector({ 100, 50 }, 100, 0, 30, paint); - - viewGroup->Add(canvas); - EXPECT_EQ(0, 0); - - viewGroup->Remove(canvas); - delete canvas; -} - -/** - * @tc.number SUB_GRAPHIC_CANVAS_DRAWIMAGE_1300 - * @tc.name test canvas draw-image api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(CanvasTest, Graphic_UICanvas_Test_DrawImage_1300, Function | MediumTest | Level0) -{ - RootView* rootView = RootView::GetInstance(); - UIViewGroup* viewGroup = static_cast(rootView); - viewGroup->SetPosition(0, 0); - viewGroup->SetWidth(200); - viewGroup->SetHeight(200); - - UICanvas* canvas = new UICanvas(); - Paint paint; - canvas->DrawImage({ 50, 50 }, "..\\config\\images\\A021_007.bin", paint); - - viewGroup->Add(canvas); - EXPECT_EQ(0, 0); - - viewGroup->Remove(canvas); - delete canvas; -} - -/** - * @tc.number SUB_GRAPHIC_CANVAS_DRAWLABEL_1400 - * @tc.name test canvas draw-label api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(CanvasTest, Graphic_UICanvas_Test_DrawLabel_1400, Function | MediumTest | Level0) -{ - RootView* rootView = RootView::GetInstance(); - - UIViewGroup* viewGroup = static_cast(rootView); - viewGroup->SetPosition(0, 0); - viewGroup->SetWidth(200); - viewGroup->SetHeight(200); - - UICanvas* canvas = new UICanvas(); - UICanvas::FontStyle fontStyle; - fontStyle.align = TEXT_ALIGNMENT_RIGHT; - fontStyle.direct = TEXT_DIRECT_RTL; - fontStyle.fontName = "HYQiHei-65S"; - fontStyle.fontSize = 30; - fontStyle.letterSpace = 10; - Paint paint; - canvas->DrawLabel({ 50, 50 }, "²âÊÔcanvas»æÖÆ×ÖÌå", 100, fontStyle, paint); - - viewGroup->Add(canvas); - EXPECT_EQ(0, 0); - - viewGroup->Remove(canvas); - canvas->Clear(); - delete canvas; -} - -/** - * @tc.number SUB_GRAPHIC_CANVAS_PAINT_1500 - * @tc.name test canvas paint api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(CanvasTest, Graphic_UICanvas_Test_Paint_1500, Function | MediumTest | Level0) -{ - Paint* paint = new Paint(); - EXPECT_NE(paint, nullptr); - - delete paint; -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/ui_chart_posix/BUILD.gn b/graphic_lite/ui/ui_chart_posix/BUILD.gn deleted file mode 100755 index 668f883ca..000000000 --- a/graphic_lite/ui/ui_chart_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUIChartTest") { - suite_name = "acts" - sources = [ "src/ui_chart_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/ui_chart_posix/Test.json b/graphic_lite/ui/ui_chart_posix/Test.json deleted file mode 100644 index 7fd55a570..000000000 --- a/graphic_lite/ui/ui_chart_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUIChartTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_chart_posix/src/ui_chart_test.cpp b/graphic_lite/ui/ui_chart_posix/src/ui_chart_test.cpp deleted file mode 100755 index ed999c0ad..000000000 --- a/graphic_lite/ui/ui_chart_posix/src/ui_chart_test.cpp +++ /dev/null @@ -1,617 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "components/ui_view_group.h" -#include "components/root_view.h" -#include "components/ui_chart.h" - -#include -#include - -using namespace std; -using namespace testing::ext; - -namespace OHOS { -class UIChartDataSerialTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_CHART_SETMAXDATACOUNT_0100 - * @tc.name test chart set-max-data-count api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIChartDataSerialTest, Graphic_UIChartDataSerialTest_Test_SetMaxDataCount_0100, Function | MediumTest | Level0) -{ - UIChartDataSerial* data = new UIChartDataSerial(); - - EXPECT_EQ(data->SetMaxDataCount(1), true); - - delete data; -} - -/** - * @tc.number SUB_GRAPHIC_CHART_ADDPOINTS_0200 - * @tc.name test chart add-points api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIChartDataSerialTest, Graphic_UIChartDataSerialTest_Test_AddPoints_0200, Function | MediumTest | Level0) -{ - UIChartDataSerial* data = new UIChartDataSerial(); - bool ret = data->AddPoints(nullptr, 0); - EXPECT_EQ(ret, false); - data->SetMaxDataCount(5); - Point pointArray[5] = { {0, 2478}, {1, 2600}, {2, 3000}, {3, 3200}, {4, 3500} }; - ret = data->AddPoints(pointArray, 5); - EXPECT_EQ(ret, true); - - ret = data->AddPoints(pointArray, 0); - EXPECT_EQ(ret, false); - - delete data; -} - -/** - * @tc.number SUB_GRAPHIC_CHART_GETPOINT_0300 - * @tc.name test chart get-point api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIChartDataSerialTest, Graphic_UIChartDataSerialTest_Test_GetPoint_0300, Function | MediumTest | Level0) -{ - UIChartDataSerial* data = new UIChartDataSerial(); - data->SetMaxDataCount(5); - Point pointArray[5] = { {0, 2478}, {1, 2600}, {2, 3000}, {3, 3200}, {4, 3500} }; - bool ret = data->AddPoints(pointArray, 5); - EXPECT_EQ(ret, true); - - Point point; - ret = data->GetPoint(1, point); - EXPECT_EQ(ret, true); - EXPECT_EQ(point.x, 1); - EXPECT_EQ(point.y, 2600); - - delete data; -} - -/** - * @tc.number SUB_GRAPHIC_CHART_MODIFYPOINT_0400 - * @tc.name test chart modify-point api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIChartDataSerialTest, Graphic_UIChartDataSerialTest_Test_ModifyPoint_0400, Function | MediumTest | Level0) -{ - UIChartDataSerial* data = new UIChartDataSerial(); - data->SetMaxDataCount(5); - Point pointArray[5] = { {0, 2478}, {1, 2600}, {2, 3000}, {3, 3200}, {4, 3500} }; - bool ret = data->AddPoints(pointArray, 5); - EXPECT_EQ(ret, true); - - Point point = { 1, 200 }; - ret = data->ModifyPoint(6, point); - EXPECT_EQ(ret, false); - - ret = data->ModifyPoint(1, point); - EXPECT_EQ(ret, true); - - Point point1; - ret = data->GetPoint(1, point1); - EXPECT_EQ(ret, true); - EXPECT_EQ(point1.x, 1); - EXPECT_EQ(point1.y, 200); - - delete data; -} - -/** - * @tc.number SUB_GRAPHIC_CHART_CLEARDATA_0500 - * @tc.name test chart clear-data api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIChartDataSerialTest, Graphic_UIChartDataSerialTest_Test_ClearData_0500, Function | MediumTest | Level0) -{ - UIChartDataSerial* data = new UIChartDataSerial(); - data->SetMaxDataCount(5); - Point pointArray[5] = { {0, 2478}, {1, 2600}, {2, 3000}, {3, 3200}, {4, 3500} }; - bool ret = data->AddPoints(pointArray, 5); - EXPECT_EQ(ret, true); - - data->ClearData(); - - Point point; - ret = data->GetPoint(1, point); - EXPECT_EQ(ret, false); - - delete data; -} - -/** - * @tc.number SUB_GRAPHIC_CHART_GETDATACOUNT_0600 - * @tc.name test chart get-data-count api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIChartDataSerialTest, Graphic_UIChartDataSerialTest_Test_GetDataCount_0600, Function | MediumTest | Level0) -{ - UIChartDataSerial* data = new UIChartDataSerial(); - data->SetMaxDataCount(5); - Point pointArray[5] = { {0, 2478}, {1, 2600}, {2, 3000}, {3, 3200}, {4, 3500} }; - bool ret = data->AddPoints(pointArray, 5); - EXPECT_EQ(ret, true); - - uint16_t count = data->GetDataCount(); - EXPECT_EQ(count, 5); - - data->ClearData(); - count = data->GetDataCount(); - EXPECT_EQ(count, 0); - - delete data; -} - -/** - * @tc.number SUB_GRAPHIC_CHART_ENABLEGRADIENT_0700 - * @tc.name test chart enable-grandient api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIChartDataSerialTest, Graphic_UIChartDataSerialTest_Test_EnableGradient_0700, Function | MediumTest | Level0) -{ - UIChartDataSerial* data = new UIChartDataSerial(); - data->EnableGradient(true); - EXPECT_EQ(data->IsGradient(), true); - - delete data; -} - -/** - * @tc.number SUB_GRAPHIC_CHART_ENABLESMOOTH_0800 - * @tc.name test chart enable-smooth api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIChartDataSerialTest, Graphic_UIChartDataSerialTest_Test_EnableSmooth_0800, Function | MediumTest | Level0) -{ - UIChartDataSerial* data = new UIChartDataSerial(); - data->EnableSmooth(true); - bool ret = data->IsSmooth(); - EXPECT_EQ(ret, true); - - delete data; -} - -/** - * @tc.number SUB_GRAPHIC_CHART_GETPEAKINDEX_0900 - * @tc.name test chart get-peak-index api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIChartDataSerialTest, Graphic_UIChartDataSerialTest_Test_GetPeakIndex_0900, Function | MediumTest | Level0) -{ - UIChartDataSerial* data = new UIChartDataSerial(); - data->SetMaxDataCount(5); - Point pointArray[5] = { {0, 2478}, {1, 2600}, {2, 3000}, {3, 200}, {4, 1654} }; - bool ret = data->AddPoints(pointArray, 5); - EXPECT_EQ(ret, true); - - uint16_t index = data->GetPeakIndex(); - EXPECT_EQ(index, 2); - - int16_t value = data->GetPeakData(); - EXPECT_EQ(value, 3000); - - delete data; -} - -/** - * @tc.number SUB_GRAPHIC_CHART_GETVALLEYINDEX_1000 - * @tc.name test chart get-valleyindex api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIChartDataSerialTest, Graphic_UIChartDataSerialTest_Test_GetValleyIndex_1000, Function | MediumTest | Level0) -{ - UIChartDataSerial* data = new UIChartDataSerial(); - data->SetMaxDataCount(5); - Point pointArray[5] = { {0, 2478}, {1, 2600}, {2, 3000}, {3, 200}, {4, 1654} }; - bool ret = data->AddPoints(pointArray, 5); - EXPECT_EQ(ret, true); - - uint16_t index = data->GetValleyIndex(); - EXPECT_EQ(index, 3); - - int16_t value = data->GetValleyData(); - EXPECT_EQ(value, 200); - - delete data; -} - -/** - * @tc.number SUB_GRAPHIC_CHART_GETLATESTINDEX_1100 - * @tc.name test chart get-latest-count api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIChartDataSerialTest, Graphic_UIChartDataSerialTest_Test_GetLatestIndex_1100, Function | MediumTest | Level0) -{ - UIChartDataSerial* data = new UIChartDataSerial(); - data->SetMaxDataCount(5); - Point pointArray[5] = { {0, 2478}, {1, 2600}, {2, 3000}, {3, 200}, {4, 1654} }; - bool ret = data->AddPoints(pointArray, 5); - EXPECT_EQ(ret, true); - - uint16_t index = data->GetLatestIndex(); - EXPECT_EQ(index, 4); - - delete data; -} - -/** - * @tc.number SUB_GRAPHIC_CHART_SETLASTPOINTINDEX_1200 - * @tc.name test chart set-LAST-POINT-INDEX api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIChartDataSerialTest, - Graphic_UIChartDataSerialTest_Test_SetBottomPointStyle_1200, - Function | MediumTest | Level0) -{ - UIChartDataSerial* data = new UIChartDataSerial(); - data->SetMaxDataCount(5); - Point pointArray[5] = { {0, 2478}, {1, 2600}, {2, 3000}, {3, 200}, {4, 1654} }; - bool ret = data->AddPoints(pointArray, 5); - EXPECT_EQ(ret, true); - - uint16_t index = data->GetLastPointIndex(); - EXPECT_EQ(index, 0); - - data->SetLastPointIndex(4); - EXPECT_EQ(data->GetLastPointIndex(), 4); - - delete data; -} - -/** - * @tc.number SUB_GRAPHIC_CHART_SETLINECOLOR_1300 - * @tc.name test chart set-linecolor api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIChartDataSerialTest, Graphic_UIChartDataSerialTest_Test_SetLineColor_1300, Function | MediumTest | Level0) -{ - UIChartDataSerial* data = new UIChartDataSerial(); - - ColorType color = Color::Red(); - data->SetLineColor(color); - EXPECT_EQ(data->GetLineColor().full, color.full); - - delete data; -} - -/** - * @tc.number SUB_GRAPHIC_CHART_SETFILLCOLOR_1400 - * @tc.name test chart set-fillcolor api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIChartDataSerialTest, Graphic_UIChartDataSerialTest_Test_SetFillColor_1400, Function | MediumTest | Level0) -{ - UIChartDataSerial* data = new UIChartDataSerial(); - - ColorType color = Color::Red(); - data->SetFillColor(color); - EXPECT_EQ(data->GetFillColor().full, color.full); - - delete data; -} - -/** - * @tc.number SUB_GRAPHIC_CHART_HIDEPOINT_1500 - * @tc.name test chart hide-point api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIChartDataSerialTest, Graphic_UIChartDataSerialTest_Test_HidePoint_1500, Function | MediumTest | Level0) -{ - UIChartDataSerial* data = new UIChartDataSerial(); - - uint16_t index = 3; - uint16_t count = 5; - data->HidePoint(index, count); - EXPECT_EQ(data->GetHideIndex(), index); - EXPECT_EQ(data->GetHideCount(), count); - - delete data; -} - -/** - * @tc.number SUB_GRAPHIC_CHART_SETHEADPOINTSTYLE_1600 - * @tc.name test chart set-head-point-style api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIChartDataSerialTest, - Graphic_UIChartDataSerialTest_Test_SetBottomPointStyle_1600, - Function | MediumTest | Level0) -{ - UIChartDataSerial* data = new UIChartDataSerial(); - - UIChartDataSerial::PointStyle pointStyle; - pointStyle.fillColor = Color::Red(); - pointStyle.radius = 5; - pointStyle.strokeColor = Color::White(); - pointStyle.strokeWidth = 10; - - data->SetHeadPointStyle(pointStyle); - - UIChartDataSerial::PointStyle pointStyle1 = data->GetHeadPointStyle(); - - EXPECT_EQ(pointStyle1.fillColor.full, pointStyle.fillColor.full); - EXPECT_EQ(pointStyle1.strokeColor.full, pointStyle.strokeColor.full); - EXPECT_EQ(pointStyle1.strokeWidth, pointStyle.strokeWidth); - EXPECT_EQ(pointStyle1.radius, pointStyle.radius); - - delete data; -} - -/** - * @tc.number SUB_GRAPHIC_CHART_SETTOPPOINTSTYLE_1700 - * @tc.name test chart set-top-point-style api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIChartDataSerialTest, - Graphic_UIChartDataSerialTest_Test_SetBottomPointStyle_1700, - Function | MediumTest | Level0) -{ - UIChartDataSerial* data = new UIChartDataSerial(); - - UIChartDataSerial::PointStyle pointStyle; - pointStyle.fillColor = Color::Red(); - pointStyle.radius = 5; - pointStyle.strokeColor = Color::White(); - pointStyle.strokeWidth = 10; - - data->SetTopPointStyle(pointStyle); - - UIChartDataSerial::PointStyle pointStyle1 = data->GetTopPointStyle(); - - EXPECT_EQ(pointStyle1.fillColor.full, pointStyle.fillColor.full); - EXPECT_EQ(pointStyle1.strokeColor.full, pointStyle.strokeColor.full); - EXPECT_EQ(pointStyle1.strokeWidth, pointStyle.strokeWidth); - EXPECT_EQ(pointStyle1.radius, pointStyle.radius); - - delete data; -} - -/** - * @tc.number SUB_GRAPHIC_CHART_SETBOTTOMPOINTSTYLE_1800 - * @tc.name test chart set-bottom-point-style api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIChartDataSerialTest, - Graphic_UIChartDataSerialTest_Test_SetBottomPointStyle_1800, - Function | MediumTest | Level0) -{ - UIChartDataSerial* data = new UIChartDataSerial(); - - UIChartDataSerial::PointStyle pointStyle; - pointStyle.fillColor = Color::Red(); - pointStyle.radius = 5; - pointStyle.strokeColor = Color::White(); - pointStyle.strokeWidth = 10; - - data->SetBottomPointStyle(pointStyle); - - UIChartDataSerial::PointStyle pointStyle1 = data->GetBottomPointStyle(); - - EXPECT_EQ(pointStyle1.fillColor.full, pointStyle.fillColor.full); - EXPECT_EQ(pointStyle1.strokeColor.full, pointStyle.strokeColor.full); - EXPECT_EQ(pointStyle1.strokeWidth, pointStyle.strokeWidth); - EXPECT_EQ(pointStyle1.radius, pointStyle.radius); - - delete data; -} - -/** - * @tc.number SUB_GRAPHIC_CHART_ADDDATASERIAL_1900 - * @tc.name test chart add-dataserial api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIChartDataSerialTest, Graphic_UIChartTest_Test_AddDataSerial_1900, Function | MediumTest | Level0) -{ - UIChartDataSerial* data = new UIChartDataSerial(); - - UIChartPillar* chart = new UIChartPillar(); - bool ret = chart->AddDataSerial(nullptr); - EXPECT_EQ(ret, false); - - ret = chart->AddDataSerial(data); - EXPECT_EQ(ret, true); - - ret = chart->AddDataSerial(data); - EXPECT_EQ(ret, false); - - delete chart; - delete data; -} - -/** - * @tc.number SUB_GRAPHIC_CHART_DELETEDATASERIAL_2000 - * @tc.name test chart delete-data-serial api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIChartDataSerialTest, Graphic_UIChartTest_Test_DeleteDataSerial_2000, Function | MediumTest | Level0) -{ - UIChartDataSerial* data = new UIChartDataSerial(); - - UIChartPillar* chart = new UIChartPillar(); - - bool ret = chart->DeleteDataSerial(nullptr); - EXPECT_EQ(ret, false); - - ret = chart->DeleteDataSerial(data); - EXPECT_EQ(ret, false); - - ret = chart->AddDataSerial(data); - EXPECT_EQ(ret, true); - - ret = chart->DeleteDataSerial(data); - EXPECT_EQ(ret, true); - - delete chart; - delete data; -} - -/** - * @tc.number SUB_GRAPHIC_CHART_CLEARDATASERIAL_2100 - * @tc.name test chart clear-data-serial api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIChartDataSerialTest, Graphic_UIChartTest_Test_ClearDataSerial_2100, Function | MediumTest | Level0) -{ - UIChartDataSerial* data = new UIChartDataSerial(); - - UIChartPillar* chart = new UIChartPillar(); - - bool ret = chart->AddDataSerial(data); - EXPECT_EQ(ret, true); - - chart->ClearDataSerial(); - - ret = chart->DeleteDataSerial(data); - EXPECT_EQ(ret, false); - - delete chart; - delete data; -} - -/** - * @tc.number SUB_GRAPHIC_CHART_ENABLEHEADPOINT_2200 - * @tc.name test chart EnableHeadPoint api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIChartDataSerialTest, Graphic_UIChartTest_Test_EnableHeadPoint_2200, Function | MediumTest | Level0) -{ - UIChartDataSerial* data = new UIChartDataSerial(); - - UIChartPillar* chart = new UIChartPillar(); - bool ret = chart->AddDataSerial(data); - EXPECT_EQ(ret, true); - - data->EnableHeadPoint(true); - EXPECT_EQ(0, 0); - - delete chart; - delete data; -} - -/** - * @tc.number SUB_GRAPHIC_CHART_ENABLETOPPOINT_2300 - * @tc.name test chart EnableTopPoint api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIChartDataSerialTest, Graphic_UIChartTest_Test_EnableTopPoint_2300, Function | MediumTest | Level0) -{ - UIChartDataSerial* data = new UIChartDataSerial(); - - UIChartPillar* chart = new UIChartPillar(); - - bool ret = chart->AddDataSerial(data); - EXPECT_EQ(ret, true); - - data->EnableTopPoint(true); - EXPECT_EQ(0, 0); - - delete chart; - delete data; -} - -/** - * @tc.number SUB_GRAPHIC_CHART_ENABLEBOTTOMPOINT_2400 - * @tc.name test chart enable-bottom-point api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIChartDataSerialTest, Graphic_UIChartTest_Test_EnableBottomPoint_2400, Function | MediumTest | Level0) -{ - UIChartDataSerial* data = new UIChartDataSerial(); - - UIChartPillar* chart = new UIChartPillar(); - - bool ret = chart->AddDataSerial(data); - EXPECT_EQ(ret, true); - - data->EnableBottomPoint(true); - EXPECT_EQ(0, 0); - - delete chart; - delete data; -} - -/** - * @tc.number SUB_GRAPHIC_CHART_ENABLEREVERSE_2500 - * @tc.name test chart EnableReverse api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIChartDataSerialTest, Graphic_UIChartTest_Test_EnableReverse_2500, Function | MediumTest | Level0) -{ - UIChartDataSerial* data = new UIChartDataSerial(); - - UIChartPillar* chart = new UIChartPillar(); - - bool ret = chart->AddDataSerial(data); - EXPECT_EQ(ret, true); - - chart->EnableReverse(true); - EXPECT_EQ(0, 0); - - delete chart; - delete data; -} - - -/** - * @tc.number SUB_GRAPHIC_CHART_GETXAXIS_2600 - * @tc.name test chart GetXAxis api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIChartDataSerialTest, Graphic_UIChartTest_Test_GetXAxis_2600, Function | MediumTest | Level0) -{ - UIChartDataSerial* data = new UIChartDataSerial(); - - UIChartPillar* chart = new UIChartPillar(); - - ColorType color = Color::Red(); - UIXAxis &xAxis = chart->GetXAxis(); - - xAxis.SetLineColor(color); - - EXPECT_EQ(xAxis.GetStyle(STYLE_LINE_COLOR), color.full); - - delete chart; - delete data; -} - -/** - * @tc.number SUB_GRAPHIC_CHART_GETYAXIS_2700 - * @tc.name test chart GetYAxis api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIChartDataSerialTest, Graphic_UIChartTest_Test_GetYAxis_2700, Function | MediumTest | Level0) -{ - UIChartDataSerial* data = new UIChartDataSerial(); - - UIChartPillar* chart = new UIChartPillar(); - - ColorType color = Color::Red(); - - UIYAxis &yAxis = chart->GetYAxis(); - - yAxis.SetLineColor(color); - EXPECT_EQ(yAxis.GetStyle(STYLE_LINE_COLOR), color.full); - - delete chart; - delete data; -} -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_checbox_posix/BUILD.gn b/graphic_lite/ui/ui_checbox_posix/BUILD.gn deleted file mode 100755 index 7e2280b9c..000000000 --- a/graphic_lite/ui/ui_checbox_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUICheckboxTest") { - suite_name = "acts" - sources = [ "src/ui_checkbox_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/ui_checbox_posix/Test.json b/graphic_lite/ui/ui_checbox_posix/Test.json deleted file mode 100644 index 7546292c0..000000000 --- a/graphic_lite/ui/ui_checbox_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUICheckboxTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_checbox_posix/src/ui_checkbox_test.cpp b/graphic_lite/ui/ui_checbox_posix/src/ui_checkbox_test.cpp deleted file mode 100755 index 0cdaabaf5..000000000 --- a/graphic_lite/ui/ui_checbox_posix/src/ui_checkbox_test.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "components/ui_checkbox.h" - -using namespace std; -using namespace testing::ext; - -namespace OHOS { -class UICheckboxTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_CHECKBOX_SETSTATE_0100 - * @tc.name test check-box set-state api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UICheckboxTest, Graphic_UICheckboxTest_Test_SetState_0100, Function | MediumTest | Level0) -{ - UICheckBox *box = new UICheckBox(); - EXPECT_EQ(box->GetViewType(), UI_CHECK_BOX); - delete(box); -} - -/** - * @tc.number SUB_GRAPHIC_CHECKBOX_ONCLICKEVENT_0200 - * @tc.name test check-box on-click-event api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UICheckboxTest, Graphic_UICheckboxTest_Test_OnClickEvent_0200, Function | MediumTest | Level0) -{ - UICheckBox *box = new UICheckBox(); - ClickEvent event({0, 0}); - box->OnClickEvent(event); - EXPECT_EQ(box->GetState(), UICheckBox::SELECTED); - delete box; -} - -/** - * @tc.number SUB_GRAPHIC_CHECKBOX_SETSTATE_0300 - * @tc.name test check-box set-state2 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UICheckboxTest, Graphic_UICheckboxTest_Test_SetState_0300, Function | MediumTest | Level0) -{ - UICheckBox *box = new UICheckBox(); - box->SetState(UICheckBox::UICheckBoxState::SELECTED); - EXPECT_EQ(box->GetState(), UICheckBox::UICheckBoxState::SELECTED); - box->SetState(UICheckBox::UICheckBoxState::UNSELECTED); - EXPECT_EQ(box->GetState(), UICheckBox::UICheckBoxState::UNSELECTED); - delete box; -} - -/** - * @tc.number SUB_GRAPHIC_CHECKBOX_SetImages_0400 - * @tc.name test check-box set-images api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UICheckboxTest, Graphic_UICheckboxTest_Test_SetImages_0400, Function | MediumTest | Level0) -{ - UICheckBox *box = new UICheckBox(); - box->SetImages("..\\config\\images\\A021_006.bin", "..\\config\\images\\A021_005.bin"); - EXPECT_EQ(0, 0); - delete box; -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/ui_circle_progress_posix/BUILD.gn b/graphic_lite/ui/ui_circle_progress_posix/BUILD.gn deleted file mode 100755 index 8a970523a..000000000 --- a/graphic_lite/ui/ui_circle_progress_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUICircleProgressTest") { - suite_name = "acts" - sources = [ "src/ui_circle_progress_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/ui_circle_progress_posix/Test.json b/graphic_lite/ui/ui_circle_progress_posix/Test.json deleted file mode 100644 index ef3555984..000000000 --- a/graphic_lite/ui/ui_circle_progress_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUICircleProgressTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_circle_progress_posix/src/ui_circle_progress_test.cpp b/graphic_lite/ui/ui_circle_progress_posix/src/ui_circle_progress_test.cpp deleted file mode 100755 index 5f3261372..000000000 --- a/graphic_lite/ui/ui_circle_progress_posix/src/ui_circle_progress_test.cpp +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "components/root_view.h" -#include "components/ui_view_group.h" -#include "components/ui_circle_progress.h" - -#include -#include - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class UICircleProgressTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_CIRCLEPROGRESS_GETVIEWTYPE_0100 - * @tc.name test circle-progress get-view-type api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UICircleProgressTest, Graphic_UICircleProgressTest_Test_GetViewType_0100, Function | MediumTest | Level0) -{ - UICircleProgress* circleProgress = new UICircleProgress(); - EXPECT_EQ(circleProgress->GetViewType(), UI_CIRCLE_PROGRESS); - delete circleProgress; -} - -/** - * @tc.number SUB_GRAPHIC_CIRCLEPROGRESS_SETSTEP_0200 - * @tc.name test circle-progress set-step api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UICircleProgressTest, Graphic_UICircleProgressTest_Test_SetStep_0200, Function | MediumTest | Level0) -{ - UICircleProgress* circleProgress = new UICircleProgress(); - uint16_t step = 10; - circleProgress->SetStep(step); - - EXPECT_EQ(circleProgress->GetStep(), step); - delete circleProgress; -} - -/** - * @tc.number SUB_GRAPHIC_CIRCLEPROGRESS_GETRADIUS_0300 - * @tc.name test circle-progress get-radius api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UICircleProgressTest, Graphic_UICircleProgressTest_Test_SetRadius_0300, Function | MediumTest | Level0) -{ - UICircleProgress *circleProgress = new UICircleProgress(); - uint16_t radius = 10; - circleProgress->SetRadius(radius); - - EXPECT_EQ(circleProgress->GetRadius(), radius); - delete circleProgress; -} - -/** - * @tc.number SUB_GRAPHIC_CIRCLEPROGRESS_SETCENTERPOSITION_0400 - * @tc.name test circle-progress set-center-position api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UICircleProgressTest, Graphic_UICircleProgressTest_Test_SetCenterPosition_0400, Function | MediumTest | Level0) -{ - UICircleProgress *circleProgress = new UICircleProgress(); - circleProgress->Resize(100, 100); - int16_t centerX = 50; - int16_t centerY = 50; - circleProgress->SetCenterPosition(centerX, centerY); - - EXPECT_EQ(circleProgress->GetCenterPosition().x, centerX); - EXPECT_EQ(circleProgress->GetCenterPosition().y, centerY); - delete circleProgress; -} - -/** - * @tc.number SUB_GRAPHIC_CIRCLEPROGRESS_SETVALUE_0500 - * @tc.name test circle-progress set-value api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UICircleProgressTest, Graphic_UICircleProgressTest_Test_SetValue_0500, Function | MediumTest | Level0) -{ - UICircleProgress *circleProgress = new UICircleProgress(); - int16_t value = 10; - circleProgress->SetValue(value); - - EXPECT_EQ(circleProgress->GetValue(), value); - delete circleProgress; -} - -/** - * @tc.number SUB_GRAPHIC_CIRCLEPROGRESS_SETRANGEMAX_0600 - * @tc.name test circle-progress set-range-max api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UICircleProgressTest, Graphic_UICircleProgressTest_Test_SetRangeMax_0600, Function | MediumTest | Level0) -{ - UICircleProgress *circleProgress = new UICircleProgress(); - int16_t rangeMax = 500; - int16_t rangeMin = 100; - circleProgress->SetRange(rangeMax, rangeMin); - - EXPECT_EQ(circleProgress->GetRangeMax(), rangeMax); - delete circleProgress; -} - -/** - * @tc.number SUB_GRAPHIC_CIRCLEPROGRESS_SETRANGEMIN_0700 - * @tc.name test circle-progress set-range-min api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UICircleProgressTest, Graphic_UICircleProgressTest_Test_SetRangeMin_0700, Function | MediumTest | Level0) -{ - UICircleProgress *circleProgress = new UICircleProgress(); - int16_t rangeMax = 500; - int16_t rangeMin = 100; - circleProgress->SetRange(rangeMax, rangeMin); - - EXPECT_EQ(circleProgress->GetRangeMin(), rangeMin); - delete circleProgress; -} - -/** - * @tc.number SUB_GRAPHIC_CIRCLEPROGRESS_SETSTARTANGLE_0800 - * @tc.name test circle-progress set-start-angle api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UICircleProgressTest, Graphic_UICircleProgressTest_Test_SetStartAngle_0800, Function | MediumTest | Level0) -{ - UICircleProgress *circleProgress = new UICircleProgress(); - int16_t startAngle = 50; - circleProgress->SetStartAngle(startAngle); - - EXPECT_EQ(circleProgress->GetStartAngle(), startAngle); - delete circleProgress; -} - -/** - * @tc.number SUB_GRAPHIC_CIRCLEPROGRESS_SETENDANGLE_0900 - * @tc.name test circle-progress set-end-angle api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UICircleProgressTest, Graphic_UICircleProgressTest_Test_SetEndAngle_0900, Function | MediumTest | Level0) -{ - UICircleProgress *circleProgress = new UICircleProgress(); - int16_t endAngle = 50; - circleProgress->SetEndAngle(endAngle); - - EXPECT_EQ(circleProgress->GetEndAngle(), endAngle); - delete circleProgress; -} - -/** - * @tc.number SUB_GRAPHIC_CIRCLEPROGRESS_SETPROGRESSIMAGEPOSITION_1000 - * @tc.name test circle-progress SetProgressImagePosition api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UICircleProgressTest, Graphic_UICircleProgressTest_Test_SetProgressImagePosition_1000, Function | MediumTest | Level0) -{ - UICircleProgress *circleProgress = new UICircleProgress(); - static Point imgPos = { 1, 0 }; - circleProgress->SetBackgroundImagePosition(imgPos.x, imgPos.y); - circleProgress->SetProgressImagePosition(imgPos.x, imgPos.y); - - EXPECT_EQ(0, 0); - delete circleProgress; -} - -/** - * @tc.number SUB_GRAPHIC_CIRCLEPROGRESS_SETLINECOLOR_1100 - * @tc.name test circle-progress SetLineColor api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UICircleProgressTest, Graphic_UICircleProgressTest_Test_SetLineColor_1100, Function | MediumTest | Level0) -{ - UICircleProgress* circleProgress = new UICircleProgress(); - ColorType color = Color::Red(); - circleProgress->SetLineColor(color); - circleProgress->GetForegroundStyle(STYLE_LINE_COLOR); - EXPECT_EQ(0, 0); - delete circleProgress; -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/ui_digital_clock_posix/BUILD.gn b/graphic_lite/ui/ui_digital_clock_posix/BUILD.gn deleted file mode 100755 index 57fb0140e..000000000 --- a/graphic_lite/ui/ui_digital_clock_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUIDigitalClockTest") { - suite_name = "acts" - sources = [ "src/ui_digital_clock_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/ui_digital_clock_posix/Test.json b/graphic_lite/ui/ui_digital_clock_posix/Test.json deleted file mode 100644 index 188b1b903..000000000 --- a/graphic_lite/ui/ui_digital_clock_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUIDigitalClockTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_digital_clock_posix/src/ui_digital_clock_test.cpp b/graphic_lite/ui/ui_digital_clock_posix/src/ui_digital_clock_test.cpp deleted file mode 100755 index aa3b16e5b..000000000 --- a/graphic_lite/ui/ui_digital_clock_posix/src/ui_digital_clock_test.cpp +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "components/ui_digital_clock.h" - -using namespace std; -using namespace testing::ext; - -namespace OHOS { -class UIDigitalClockTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_DIGITALCLOCK_GETVIEWTYPE_0100 - * @tc.name test digital-clock get-view-type api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIDigitalClockTest, Graphic_UIDigitalClockTest_Test_GetViewType_0100, Function | MediumTest | Level0) -{ - UIDigitalClock *clock = new UIDigitalClock(); - EXPECT_EQ(clock->GetViewType(), UI_DIGITAL_CLOCK); - delete clock; -} - -/** - * @tc.number SUB_GRAPHIC_DIGITALCLOCK_SETFONTID_0200 - * @tc.name test digital-clock set-fontID api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIDigitalClockTest, Graphic_UIDigitalClockTest_Test_SetFontId_0200, Function | MediumTest | Level0) -{ - UIDigitalClock *clock = new UIDigitalClock(); - uint8_t fontId = 10; - clock->SetFontId(fontId); - EXPECT_EQ(clock->GetStyle(STYLE_TEXT_FONT), fontId); - delete clock; -} - -/** - * @tc.number SUB_GRAPHIC_DIGITALCLOCK_SETDISPLAYMODE_0300 - * @tc.name test digital-clock set-display-mode api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIDigitalClockTest, Graphic_UIDigitalClockTest_Test_SetDisplayMode_0300, Function | MediumTest | Level0) -{ - UIDigitalClock *clock = new UIDigitalClock(); - clock->SetDisplayMode(UIDigitalClock::DisplayMode::DISPLAY_12_HOUR_NO_SECONDS); - EXPECT_EQ(clock->GetDisplayMode(), UIDigitalClock::DisplayMode::DISPLAY_12_HOUR_NO_SECONDS); - clock->SetDisplayMode(UIDigitalClock::DisplayMode::DISPLAY_24_HOUR_NO_SECONDS); - EXPECT_EQ(clock->GetDisplayMode(), UIDigitalClock::DisplayMode::DISPLAY_24_HOUR_NO_SECONDS); - clock->SetDisplayMode(UIDigitalClock::DisplayMode::DISPLAY_12_HOUR); - EXPECT_EQ(clock->GetDisplayMode(), UIDigitalClock::DisplayMode::DISPLAY_12_HOUR); - clock->SetDisplayMode(UIDigitalClock::DisplayMode::DISPLAY_24_HOUR); - EXPECT_EQ(clock->GetDisplayMode(), UIDigitalClock::DisplayMode::DISPLAY_24_HOUR); - delete clock; -} - -/** - * @tc.number SUB_GRAPHIC_DIGITALCLOCK_SETOPACITY_0400 - * @tc.name test digital-clock set-opacity api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIDigitalClockTest, Graphic_UIDigitalClockTest_Test_SetOpacity_0400, Function | MediumTest | Level0) -{ - uint8_t opicity = 255; - UIDigitalClock *clock = new UIDigitalClock(); - clock->SetOpacity(opicity); - EXPECT_EQ(clock->GetOpacity(), opicity); - delete clock; -} - -/** - * @tc.number SUB_GRAPHIC_DIGITALCLOCK_SETTIME24HOUR_0500 - * @tc.name test digital-clock set-time-24hour api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIDigitalClockTest, Graphic_UIDigitalClockTest_Test_SetTime24Hour_0500, Function | MediumTest | Level0) -{ - UIDigitalClock *clock = new UIDigitalClock(); - uint8_t currentHour = 14; - uint8_t currentMinute = 40; - uint8_t currentSecond = 30; - clock->SetTime24Hour(currentHour, currentMinute, currentSecond); - EXPECT_EQ(clock->GetCurrentHour(), currentHour); - EXPECT_EQ(clock->GetCurrentMinute(), currentMinute); - EXPECT_EQ(clock->GetCurrentSecond(), currentSecond); - delete clock; -} - -/** - * @tc.number SUB_GRAPHIC_DIGITALCLOCK_SETTIME12HOUR_0600 - * @tc.name test digital-clock set-time-12hour api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIDigitalClockTest, Graphic_UIDigitalClockTest_Test_SetTime12Hour_0600, Function | MediumTest | Level0) -{ - UIDigitalClock *clock = new UIDigitalClock(); - const uint8_t currentHour = 10; - const uint8_t currentMinute = 40; - const uint8_t currentSecond = 30; - clock->SetTime12Hour(currentHour, currentMinute, currentSecond, true); - EXPECT_EQ(clock->GetCurrentHour(), currentHour); - EXPECT_EQ(clock->GetCurrentMinute(), currentMinute); - EXPECT_EQ(clock->GetCurrentSecond(), currentSecond); - - clock->SetTime12Hour(currentHour, currentMinute, currentSecond, false); - EXPECT_EQ(clock->GetCurrentHour(), currentHour + 12); - EXPECT_EQ(clock->GetCurrentMinute(), currentMinute); - EXPECT_EQ(clock->GetCurrentSecond(), currentSecond); - - delete clock; -} - -/** - * @tc.number SUB_GRAPHIC_DIGITALCLOCK_SETCOLOR_0700 - * @tc.name test digital-clock set-color api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIDigitalClockTest, Graphic_UIDigitalClockTest_Test_SetColor_0700, Function | MediumTest | Level0) -{ - UIDigitalClock *clock = new UIDigitalClock(); - clock->SetTime24Hour(7, 5, 9); - clock->SetColor(Color::Red()); - EXPECT_EQ(0, 0); - delete clock; -} - -/** - * @tc.number SUB_GRAPHIC_DIGITALCLOCK_DISPLAYLEADINGZERO_0800 - * @tc.name test digital-clock set-displayleadingzero api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIDigitalClockTest, Graphic_UIDigitalClockTest_Test_DisplayLeadingZero_0800, Function | MediumTest | Level0) -{ - UIDigitalClock *clock = new UIDigitalClock(); - clock->SetTime24Hour(7, 5, 9); - clock->DisplayLeadingZero(false); - EXPECT_EQ(0, 0); - delete clock; -} -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_image_animator_posix/BUILD.gn b/graphic_lite/ui/ui_image_animator_posix/BUILD.gn deleted file mode 100755 index 719e859a2..000000000 --- a/graphic_lite/ui/ui_image_animator_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUIImageAnimatorTest") { - suite_name = "acts" - sources = [ "src/ui_image_animator_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/ui_image_animator_posix/Test.json b/graphic_lite/ui/ui_image_animator_posix/Test.json deleted file mode 100644 index 148b87dcc..000000000 --- a/graphic_lite/ui/ui_image_animator_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUIImageAnimatorTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_image_animator_posix/src/ui_image_animator_test.cpp b/graphic_lite/ui/ui_image_animator_posix/src/ui_image_animator_test.cpp deleted file mode 100755 index fe0b3f9e9..000000000 --- a/graphic_lite/ui/ui_image_animator_posix/src/ui_image_animator_test.cpp +++ /dev/null @@ -1,289 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "components/root_view.h" -#include "components/ui_view_group.h" -#include "components/ui_image_animator.h" - -#include -#include - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class UIImageAnimatorViewTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; -static ImageAnimatorInfo g_imageAnimatorInfo[4] = { - { "..\\config\\images\\A021_001.bin", {50, 50}, 116, 116, IMG_SRC_FILE_PATH}, - { "..\\config\\images\\A021_002.bin", {50, 50}, 116, 116, IMG_SRC_FILE_PATH }, - { "..\\config\\images\\A021_003.bin", {50, 50}, 116, 116, IMG_SRC_FILE_PATH }, - { "..\\config\\images\\A021_004.bin", {50, 50}, 116, 116, IMG_SRC_FILE_PATH }, -}; - -/** - * @tc.number SUB_GRAPHIC_IMAGEANIMATOR_GETVIEWTYPE_0100 - * @tc.name test image-animator get-view-type api - * @tc.desc [C- SOFTWARE -0200] - */ - -HWTEST_F(UIImageAnimatorViewTest, - Graphic_UIImageAnimatorViewTest_Test_SetAnimatorStopListener_0100, - Function | MediumTest | Level0) -{ - UIImageAnimatorView* imageAnimator = new UIImageAnimatorView(); - EXPECT_EQ(imageAnimator->GetViewType(), UI_IMAGE_ANIMATOR_VIEW); - delete imageAnimator; -} - -/** - * @tc.number SUB_GRAPHIC_IMAGEANIMATOR_SETTIMEOFPAUSE_0200 - * @tc.name test image-animator set-time-of-pause api - * @tc.desc [C- SOFTWARE -0200] - */ - -HWTEST_F(UIImageAnimatorViewTest, - Graphic_UIImageAnimatorViewTest_Test_SetAnimatorStopListener_0200, - Function | MediumTest | Level0) -{ - UIImageAnimatorView* imageAnimator = new UIImageAnimatorView(); - uint16_t timeOfPause = 1; - imageAnimator->SetTimeOfPause(timeOfPause); - EXPECT_EQ(imageAnimator->GetTimeOfPause(), timeOfPause); - delete imageAnimator; -} - -/** - * @tc.number SUB_GRAPHIC_IMAGEANIMATOR_SETTIMEOFUPDATE_0300 - * @tc.name test image-animator set-time-of-update api - * @tc.desc [C- SOFTWARE -0200] - */ - -HWTEST_F(UIImageAnimatorViewTest, - Graphic_UIImageAnimatorViewTest_Test_SetAnimatorStopListener_0300, - Function | MediumTest | Level0) -{ - UIImageAnimatorView* imageAnimator = new UIImageAnimatorView(); - uint16_t time = 300; - imageAnimator->SetTimeOfUpdate(time); - - EXPECT_EQ(imageAnimator->GetTimeOfUpdate(), time); - delete imageAnimator; -} - -/** - * @tc.number SUB_GRAPHIC_IMAGEANIMATOR_SETIMAGEANIMATORSRC_0400 - * @tc.name test image-animator set-image-animator-src api - * @tc.desc [C- SOFTWARE -0200] - */ - -HWTEST_F(UIImageAnimatorViewTest, - Graphic_UIImageAnimatorViewTest_Test_SetAnimatorStopListener_0400, - Function | MediumTest | Level0) -{ - UIImageAnimatorView* imageAnimator = new UIImageAnimatorView(); - uint8_t imageNum = 4; - imageAnimator->SetImageAnimatorSrc(g_imageAnimatorInfo, imageNum); - - EXPECT_EQ(imageAnimator->GetImageAnimatorImageNum(), imageNum); - delete imageAnimator; -} - -/** - * @tc.number SUB_GRAPHIC_IMAGEANIMATOR_SETIMAGEANIMATORSRC_0500 - * @tc.name test image-animator set-image-animator-src2 api - * @tc.desc [C- SOFTWARE -0200] - */ - -HWTEST_F(UIImageAnimatorViewTest, - Graphic_UIImageAnimatorViewTest_Test_SetAnimatorStopListener_0500, - Function | MediumTest | Level0) -{ - UIImageAnimatorView* imageAnimator = new UIImageAnimatorView(); - ImageAnimatorInfo* info = &g_imageAnimatorInfo[0]; - imageAnimator->SetImageAnimatorSrc(g_imageAnimatorInfo, 4); - - EXPECT_EQ(imageAnimator->GetImageAnimatorSrc(), info); - delete imageAnimator; -} - -/** - * @tc.number SUB_GRAPHIC_IMAGEANIMATOR_SETSIZEFIXED_0600 - * @tc.name test image-animator set-size-fixed api - * @tc.desc [C- SOFTWARE -0200] - */ - -HWTEST_F(UIImageAnimatorViewTest, - Graphic_UIImageAnimatorViewTest_Test_SetAnimatorStopListener_0600, - Function | MediumTest | Level0) -{ - UIImageAnimatorView* imageAnimator = new UIImageAnimatorView(); - bool fixed = true; - imageAnimator->SetSizeFixed(fixed); - - EXPECT_EQ(imageAnimator->IsSizeFixed(), fixed); - delete imageAnimator; -} - -/** - * @tc.number SUB_GRAPHIC_IMAGEANIMATOR_SETREPEAT_0700 - * @tc.name test image-animator set-repeat api - * @tc.desc [C- SOFTWARE -0200] - */ - -HWTEST_F(UIImageAnimatorViewTest, - Graphic_UIImageAnimatorViewTest_Test_SetAnimatorStopListener_0700, - Function | MediumTest | Level0) -{ - UIImageAnimatorView* imageAnimator = new UIImageAnimatorView(); - bool repeat = true; - imageAnimator->SetRepeat(repeat); - - EXPECT_EQ(imageAnimator->IsRepeat(), repeat); - delete imageAnimator; -} - -/** - * @tc.number SUB_GRAPHIC_IMAGEANIMATOR_SETREVERSE_0800 - * @tc.name test image-animator set-reverse api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIImageAnimatorViewTest, - Graphic_UIImageAnimatorViewTest_Test_SetAnimatorStopListener_0800, - Function | MediumTest | Level0) -{ - UIImageAnimatorView* imageAnimator = new UIImageAnimatorView(); - bool reverse = true; - imageAnimator->SetReverse(reverse); - - EXPECT_EQ(imageAnimator->IsReverse(), reverse); - delete imageAnimator; -} - -/** - * @tc.number SUB_GRAPHIC_IMAGEANIMATOR_SETSTARTPOSITION_0900 - * @tc.name test image-animator set-start-position api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIImageAnimatorViewTest, - Graphic_UIImageAnimatorViewTest_Test_SetAnimatorStopListener_0900, - Function | MediumTest | Level0) -{ - UIImageAnimatorView* imageAnimator = new UIImageAnimatorView(); - uint8_t state = Animator::STOP; - EXPECT_EQ(imageAnimator->GetState(), state); - - delete imageAnimator; -} - -/** - * @tc.number SUB_GRAPHIC_IMAGEANIMATOR_START_1000 - * @tc.name test image-animator start api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIImageAnimatorViewTest, - Graphic_UIImageAnimatorViewTest_Test_SetAnimatorStopListener_1000, - Function | MediumTest | Level0) -{ - UIImageAnimatorView* imageAnimator = new UIImageAnimatorView(); - imageAnimator->Start(); - EXPECT_EQ(imageAnimator->GetState(), Animator::START); - - delete imageAnimator; -} - -/** - * @tc.number SUB_GRAPHIC_IMAGEANIMATOR_STOP_1100 - * @tc.name test image-animator stop api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIImageAnimatorViewTest, - Graphic_UIImageAnimatorViewTest_Test_SetAnimatorStopListener_1100, - Function | MediumTest | Level0) -{ - UIImageAnimatorView* imageAnimator = new UIImageAnimatorView(); - imageAnimator->Stop(); - EXPECT_EQ(imageAnimator->GetState(), Animator::STOP); - - delete imageAnimator; -} - -/** - * @tc.number SUB_GRAPHIC_IMAGEANIMATOR_PAUSE_1200 - * @tc.name test image-animator pause api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIImageAnimatorViewTest, - Graphic_UIImageAnimatorViewTest_Test_SetAnimatorStopListener_1200, - Function | MediumTest | Level0) -{ - UIImageAnimatorView* imageAnimator = new UIImageAnimatorView(); - imageAnimator->Pause(); - EXPECT_EQ(imageAnimator->GetState(), Animator::PAUSE); - - delete imageAnimator; -} - -/** - * @tc.number SUB_GRAPHIC_IMAGEANIMATOR_RESUME_1300 - * @tc.name test image-animator resume api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIImageAnimatorViewTest, - Graphic_UIImageAnimatorViewTest_Test_SetAnimatorStopListener_1300, - Function | MediumTest | Level0) -{ - UIImageAnimatorView* imageAnimator = new UIImageAnimatorView(); - imageAnimator->Resume(); - EXPECT_EQ(imageAnimator->GetState(), Animator::START); - - delete imageAnimator; -} - -/** - * @tc.number SUB_GRAPHIC_IMAGEANIMATOR_SETREPEATTIMES_1400 - * @tc.name test image-animator setrepeattimes api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIImageAnimatorViewTest, - Graphic_UIImageAnimatorViewTest_Test_SetAnimatorStopListener_1400, - Function | MediumTest | Level0) -{ - UIImageAnimatorView* imageAnimator = new UIImageAnimatorView(); - uint32_t times = 5; - imageAnimator->SetRepeatTimes(times); - EXPECT_EQ(imageAnimator->GetRepeatTimes(), times); - - delete imageAnimator; -} - -/** - * @tc.number SUB_GRAPHIC_IMAGEANIMATOR_SetAnimatorStopListener_1500 - * @tc.name test image-animator SetAnimatorStopListener api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIImageAnimatorViewTest, - Graphic_UIImageAnimatorViewTest_Test_SetAnimatorStopListener_1500, - Function | MediumTest | Level0) -{ - UIImageAnimatorView* imageAnimator = new UIImageAnimatorView(); - imageAnimator->SetAnimatorStopListener(nullptr); - EXPECT_EQ(0, 0); - - delete imageAnimator; -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/ui_image_posix/BUILD.gn b/graphic_lite/ui/ui_image_posix/BUILD.gn deleted file mode 100755 index c93f817ea..000000000 --- a/graphic_lite/ui/ui_image_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUIImageTest") { - suite_name = "acts" - sources = [ "src/ui_image_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/ui_image_posix/Test.json b/graphic_lite/ui/ui_image_posix/Test.json deleted file mode 100644 index bb6bfb2a5..000000000 --- a/graphic_lite/ui/ui_image_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUIImageTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_image_posix/src/ui_image_test.cpp b/graphic_lite/ui/ui_image_posix/src/ui_image_test.cpp deleted file mode 100755 index 4562d8d7b..000000000 --- a/graphic_lite/ui/ui_image_posix/src/ui_image_test.cpp +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "components/root_view.h" -#include "components/ui_view_group.h" -#include "components/ui_image_view.h" - -#include -#include - -using namespace std; -using namespace testing::ext; - -namespace OHOS { -class UIImageTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; -/** - * @tc.setup: define a setup for test suit, format:"UILabelTest + SetUp" - * @return: true——setup success - */ -bool UIImageTestSetUp() -{ - RootView* rootView = RootView::GetInstance(); - UIViewGroup* viewGroup = static_cast(rootView); - viewGroup->SetPosition(0, 0); - viewGroup->SetWidth(HORIZONTAL_RESOLUTION); - viewGroup->SetHeight(VERTICAL_RESOLUTION); - return true; -} - -/** - * @tc.teardown: define a setup for test suit, format:"UILabelTest + TearDown" - * @return: true——teardown success - */ -bool UIImageTestTearDown() -{ - RootView* rootView = RootView::GetInstance(); - rootView->RemoveAll(); - return true; -} - -/** - * @tc.number SUB_GRAPHIC_UIIMAGE_GETVIEWTYPE_0100 - * @tc.name test UIimage get-view-type api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIImageTest, Graphic_UIImage_Test_GetViewType_010, Function | MediumTest | Level0) -{ - UIImageView* imageView = new UIImageView(); - EXPECT_EQ(imageView->GetViewType(), UI_IMAGE_VIEW); - delete imageView; -} - -/** - * @tc.number SUB_GRAPHIC_UIIMAGE_SETIMAGE_0200 - * @tc.name test UIimage set-image api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIImageTest, Graphic_UIImage_Test_SetImage_0200, Function | MediumTest | Level0) -{ - UIImageTestSetUp(); - RootView* rootView = RootView::GetInstance(); - UIViewGroup* viewGroup = static_cast(rootView); - UIImageView* imageView = new UIImageView(); - imageView->SetPosition(10, 10); - imageView->SetHeight(100); - imageView->SetWidth(200); - - EXPECT_EQ(imageView->GetX(), 10); - EXPECT_EQ(imageView->GetY(), 10); - EXPECT_EQ(imageView->GetHeight(), 100); - EXPECT_EQ(imageView->GetWidth(), 200); - - char* srcPath = nullptr; - imageView->SetSrc(srcPath); - EXPECT_EQ(imageView->GetPath(), srcPath); - const char* strPath2 = static_cast("..\\config\\images\\A021_001.bin"); - imageView->SetSrc(strPath2); - EXPECT_NE(imageView->GetPath(), strPath2); - ImageInfo* srcPath2 = nullptr; - imageView->SetSrc(srcPath2); - EXPECT_EQ(imageView->GetImageInfo(), srcPath2); - - imageView->SetAutoEnable(true); - EXPECT_EQ(imageView->GetAutoEnable(), true); - - imageView->SetParent(nullptr); - EXPECT_EQ(imageView->GetParent(), nullptr); - UIView uiView; - imageView->SetParent(&uiView); - EXPECT_NE(imageView->GetParent(), nullptr); - - imageView->SetNextSibling(nullptr); - EXPECT_EQ(imageView->GetNextSibling(), nullptr); - imageView->SetNextSibling(&uiView); - EXPECT_NE(imageView->GetNextSibling(), nullptr); - - imageView->SetVisible(true); - EXPECT_EQ(imageView->IsVisible(), true); - imageView->SetVisible(false); - EXPECT_EQ(imageView->IsVisible(), false); - - viewGroup->Invalidate(); - UIImageTestTearDown(); -} - -/** - * @tc.number SUB_GRAPHIC_UIIMAGE_SETDRAGGABLE_0300 - * @tc.name test UIimage set-draggable api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIImageTest, Graphic_UIImage_Test_SetDraggable_0300, Function | MediumTest | Level0) -{ - UIImageTestSetUp(); - RootView* rootView = RootView::GetInstance(); - UIViewGroup* viewGroup = static_cast(rootView); - UIImageView* imageView = new UIImageView(); - imageView->SetTouchable(true); - EXPECT_EQ(imageView->IsTouchable(), true); - imageView->SetTouchable(false); - EXPECT_EQ(imageView->IsTouchable(), false); - - imageView->SetPosition(30, 50, 70, 90); - - EXPECT_EQ(imageView->GetX(), 30); - EXPECT_EQ(imageView->GetY(), 50); - EXPECT_EQ(imageView->GetWidth(), 70); - EXPECT_EQ(imageView->GetHeight(), 90); - - imageView->SetDraggable(true); - EXPECT_EQ(imageView->IsDraggable(), true); - imageView->SetDraggable(false); - EXPECT_EQ(imageView->IsDraggable(), false); - - imageView->SetDragParentInstead(true); - EXPECT_EQ(imageView->IsDragParentInstead(), true); - imageView->SetDragParentInstead(false); - EXPECT_EQ(imageView->IsDragParentInstead(), false); - - imageView->Resize(100, 300); - EXPECT_EQ(imageView->GetWidth(), 100); - EXPECT_EQ(imageView->GetHeight(), 300); - - imageView->SetOnDragListener(nullptr); - EXPECT_EQ(imageView->GetOnDragListener(), nullptr); - - imageView->SetOnClickListener(nullptr); - EXPECT_EQ(imageView->GetOnClickListener(), nullptr); - - imageView->SetOnLongPressListener(nullptr); - EXPECT_EQ(imageView->GetOnLongPressListener(), nullptr); - - imageView->SetViewId(nullptr); - EXPECT_EQ(imageView->GetViewId(), nullptr); - - imageView->SetViewIndex(101); - EXPECT_EQ(imageView->GetViewIndex(), 101); - - viewGroup->Invalidate(); - UIImageTestTearDown(); -} - -/** - * @tc.number SUB_GRAPHIC_UIIMAGE_SETBLULEVEL_0400 - * @tc.name test UIimage set-blur-level api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIImageTest, Graphic_UIImage_Test_SetBlurLevel_0400, Function | MediumTest | Level0) -{ - UIImageTestSetUp(); - UIImageView* imageView = new UIImageView(); - BlurLevel level = LEVEL0; - imageView->SetBlurLevel(level); - EXPECT_EQ(imageView->GetBlurLevel(), level); - delete imageView; - UIImageTestTearDown(); -} - -/** - * @tc.number SUB_GRAPHIC_UIIMAGE_SETTRANSFORMALGORITHM_0500 - * @tc.name test UIimage set-trans-from-algorithm api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIImageTest, Graphic_UIImage_Test_SetTransformAlgorithm_0500, Function | MediumTest | Level0) -{ - UIImageTestSetUp(); - UIImageView* imageView = new UIImageView(); - TransformAlgorithm algorithm = NEAREST_NEIGHBOR; - imageView->SetTransformAlgorithm(algorithm); - EXPECT_EQ(imageView->GetTransformAlgorithm(), algorithm); - delete imageView; - UIImageTestTearDown(); -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/ui_label_button_posix/BUILD.gn b/graphic_lite/ui/ui_label_button_posix/BUILD.gn deleted file mode 100755 index ddf49f09b..000000000 --- a/graphic_lite/ui/ui_label_button_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUILabelButtonTest") { - suite_name = "acts" - sources = [ "src/ui_label_button_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/ui_label_button_posix/Test.json b/graphic_lite/ui/ui_label_button_posix/Test.json deleted file mode 100644 index 784f2c720..000000000 --- a/graphic_lite/ui/ui_label_button_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUILabelButtonTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_label_button_posix/src/ui_label_button_test.cpp b/graphic_lite/ui/ui_label_button_posix/src/ui_label_button_test.cpp deleted file mode 100755 index 70d344395..000000000 --- a/graphic_lite/ui/ui_label_button_posix/src/ui_label_button_test.cpp +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "components/root_view.h" -#include "components/ui_label_button.h" -#include "font/ui_font.h" - -#include -#include - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class UILabelButtonTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_LABEL_BUTTON_GETVIEWTYPE_0100 - * @tc.name test label-button get-view-type api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UILabelButtonTest, Graphic_UILabelButtonTest_Test_GetViewType_0100, Function | MediumTest | Level0) -{ - UILabelButton* labelBtn = new UILabelButton(); - EXPECT_EQ(labelBtn->GetViewType(), UI_LABEL_BUTTON); - delete labelBtn; -} - -/** - * @tc.number SUB_GRAPHIC_LABEL_BUTTON_SETTEXT_0200 - * @tc.name test label-button set-text api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UILabelButtonTest, Graphic_UILabelButtonTest_Test_SetText_0200, Function | MediumTest | Level0) -{ - const char* text = "abc"; - UILabelButton* labelBtn = new UILabelButton(); - labelBtn->SetText(text); - labelBtn->GetText(); - EXPECT_EQ(0, 0); - delete labelBtn; -} - -/** - * @tc.number SUB_GRAPHIC_LABEL_BUTTON_SETLABLEPOSITION_0300 - * @tc.name test label-button set-lable-position api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UILabelButtonTest, Graphic_UILabelButtonTest_Test_SetLablePosition_0300, Function | MediumTest | Level0) -{ - UILabelButton* labelBtn = new UILabelButton(); - labelBtn->SetLablePosition(10, 20); - EXPECT_EQ(labelBtn->GetLabelPosition().x, 10); - EXPECT_EQ(labelBtn->GetLabelPosition().y, 20); - delete labelBtn; -} - -/** - * @tc.number SUB_GRAPHIC_LABEL_BUTTON_SETALIGN_0400 - * @tc.name test label-button set-align api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UILabelButtonTest, Graphic_UILabelButtonTest_Test_SetAlign_0400, Function | MediumTest | Level0) -{ - UILabelButton* labelBtn = new UILabelButton(); - labelBtn->SetAlign(UITextLanguageAlignment::TEXT_ALIGNMENT_RIGHT); - EXPECT_EQ(labelBtn->GetAlign(), UITextLanguageAlignment::TEXT_ALIGNMENT_RIGHT); - delete labelBtn; -} - -/** - * @tc.number SUB_GRAPHIC_LABEL_BUTTON_SETDIRECT_0500 - * @tc.name test label-button set-direct api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UILabelButtonTest, Graphic_UILabelButtonTest_Test_SetDirect_0500, Function | MediumTest | Level0) -{ - UILabelButton* labelBtn = new UILabelButton(); - labelBtn->SetDirect(UITextLanguageDirect::TEXT_DIRECT_RTL); - EXPECT_EQ(labelBtn->GetDirect(), UITextLanguageDirect::TEXT_DIRECT_RTL); - delete labelBtn; -} - -/** - * @tc.number SUB_GRAPHIC_LABEL_BUTTON_SETLABELSTYLE_0600 - * @tc.name test label-button set-label-style api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UILabelButtonTest, Graphic_UILabelButtonTest_Test_SetLabelStyle_0600, Function | MediumTest | Level0) -{ - UILabelButton* labelBtn = new UILabelButton(); - Style style; - style.borderWidth_ = 10; - labelBtn->SetLabelStyle(style); - EXPECT_EQ(labelBtn->GetLabelStyle().borderWidth_, style.borderWidth_); - delete labelBtn; -} - -/** - * @tc.number SUB_GRAPHIC_LABEL_BUTTON_SETLABELSTYLE_0700 - * @tc.name test label-button set-label-style2 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UILabelButtonTest, Graphic_UILabelButtonTest_Test_SetLabelStyle_0700, Function | MediumTest | Level0) -{ - UILabelButton* labelBtn = new UILabelButton(); - uint8_t key = 1; - int64_t value = 10; - labelBtn->SetLabelStyle(key, value); - EXPECT_EQ(labelBtn->GetLabelStyle(key), value); - delete labelBtn; -} - -/** - * @tc.number SUB_GRAPHIC_LABEL_BUTTON_SETTEXTCOLOR_0800 - * @tc.name test label-button set-text-color api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UILabelButtonTest, Graphic_UILabelButtonTest_Test_SetTextColor_0800, Function | MediumTest | Level0) -{ - UILabelButton* labelBtn = new UILabelButton(); - ColorType colorType; - colorType.blue = 10; - labelBtn->SetTextColor(colorType); - EXPECT_EQ(labelBtn->GetLabelStyle().textColor_.blue, colorType.blue); - delete labelBtn; -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/ui_label_posix/BUILD.gn b/graphic_lite/ui/ui_label_posix/BUILD.gn deleted file mode 100755 index a6a74807a..000000000 --- a/graphic_lite/ui/ui_label_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUILabelTest") { - suite_name = "acts" - sources = [ "src/ui_label_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/ui_label_posix/Test.json b/graphic_lite/ui/ui_label_posix/Test.json deleted file mode 100644 index b680d66c4..000000000 --- a/graphic_lite/ui/ui_label_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUILabelTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_label_posix/src/ui_label_test.cpp b/graphic_lite/ui/ui_label_posix/src/ui_label_test.cpp deleted file mode 100755 index 85f37d72b..000000000 --- a/graphic_lite/ui/ui_label_posix/src/ui_label_test.cpp +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "components/root_view.h" -#include "components/ui_view_group.h" -#include "components/ui_label.h" -#include "font/ui_font.h" - -#include -#include - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class UILabelTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_LABEL_GETVIEWTYPE_0100 - * @tc.name test label get-view-type api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UILabelTest, Graphic_UILabelTest_Test_GetViewType_0100, Function | MediumTest | Level0) -{ - UILabel* label = new UILabel(); - EXPECT_EQ(label->GetViewType(), UI_LABEL); - delete label; -} - -/** - * @tc.number SUB_GRAPHIC_LABEL_SETLABELSIZE_0200 - * @tc.name test label set-label-size api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UILabelTest, Graphic_UILabelTest_Test_SetLabelSize_0200, Function | MediumTest | Level0) -{ - UILabel* label = new UILabel(); - label->Resize(100, 100); - EXPECT_EQ(label->GetWidth(), 100); - EXPECT_EQ(label->GetHeight(), 100); - delete label; -} - -/** - * @tc.number SUB_GRAPHIC_LABEL_SETTEXT_0300 - * @tc.name test label set-text api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UILabelTest, Graphic_UILabelTest_Test_SetText_0300, Function | MediumTest | Level0) -{ - const char* text = "abc"; - UILabel* label = new UILabel(); - label->Resize(100, 100); - label->SetText(text); - label->GetText(); - EXPECT_EQ(0, 0); - delete label; -} - -/** - * @tc.number SUB_GRAPHIC_LABEL_SETLINEBREAKMODE_0400 - * @tc.name test label set-line-breakmode api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UILabelTest, Graphic_UILabelTest_Test_SetLineBreakMode_0400, Function | MediumTest | Level0) -{ - UILabel* label = new UILabel(); - const uint8_t lineBreakMode = UILabel::LINE_BREAK_ELLIPSIS; - label->SetLineBreakMode(lineBreakMode); - EXPECT_EQ(label->GetLineBreakMode(), lineBreakMode); - delete label; -} - -/** - * @tc.number SUB_GRAPHIC_LABEL_SETTEXTCOLOR_0500 - * @tc.name test label set-text-color api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UILabelTest, Graphic_UILabelTest_Test_SetTextColor_0500, Function | MediumTest | Level0) -{ - UILabel* label = new UILabel(); - ColorType color = Color::White(); - label->SetTextColor(color); - EXPECT_EQ(label->GetTextColor().full, color.full); - delete label; -} - -/** - * @tc.number SUB_GRAPHIC_LABEL_SETLONGMODE_0600 - * @tc.name test label set-long-mode api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UILabelTest, Graphic_UILabelTest_Test_SetLongMode_0600, Function | MediumTest | Level0) -{ - UILabel* label = new UILabel(); - label->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); - EXPECT_EQ(label->GetLineBreakMode(), UILabel::LINE_BREAK_ADAPT); - delete label; -} - -/** - * @tc.number SUB_GRAPHIC_LABEL_SETALIGN_0700 - * @tc.name test label set-align api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UILabelTest, Graphic_UILabelTest_Test_SetAlign_0700, Function | MediumTest | Level0) -{ - UILabel* label = new UILabel(); - label->SetAlign(UITextLanguageAlignment::TEXT_ALIGNMENT_RIGHT, UITextLanguageAlignment::TEXT_ALIGNMENT_BOTTOM); - EXPECT_EQ(label->GetHorAlign(), UITextLanguageAlignment::TEXT_ALIGNMENT_RIGHT); - EXPECT_EQ(label->GetVerAlign(), UITextLanguageAlignment::TEXT_ALIGNMENT_BOTTOM); - delete label; -} - -/** - * @tc.number SUB_GRAPHIC_LABEL_SETDIRECT_0800 - * @tc.name test label set-direct api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UILabelTest, Graphic_UILabelTest_Test_SetDirect_0800, Function | MediumTest | Level0) -{ - UILabel* label = new UILabel(); - label->SetDirect(UITextLanguageDirect::TEXT_DIRECT_RTL); - EXPECT_EQ(label->GetDirect(), UITextLanguageDirect::TEXT_DIRECT_RTL); - delete label; -} - -/** - * @tc.number SUB_GRAPHIC_LABEL_SETROLLSTARTPOS_0900 - * @tc.name test label set-roll-start-pos api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UILabelTest, Graphic_UILabelTest_Test_SetRollStartPos_0900, Function | MediumTest | Level0) -{ - UILabel* label = new UILabel(); - label->SetRollStartPos(50); - EXPECT_EQ(label->GetRollStartPos(), 50); // 219: text width - delete label; -} - -/** - * @tc.number SUB_GRAPHIC_LABEL_SETFONT_1100 - * @tc.name test label setfont api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UILabelTest, Graphic_UILabelTest_Test_SetFont_1100, Function | MediumTest | Level0) -{ - UILabel* label = new UILabel(); - char const *name = "1"; - uint8_t size = 1; - label->SetFont(name, size); - EXPECT_EQ(0, 0); - delete label; -} - -/** - * @tc.number SUB_GRAPHIC_LABEL_GETTEXTWIDTH_1200 - * @tc.name test label gettextwidth api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UILabelTest, Graphic_UILabelTest_Test_GetTextWidth_1200, Function | MediumTest | Level0) -{ - UILabel* label = new UILabel(); - label->GetTextWidth(); - EXPECT_EQ(0, 0); - delete label; -} - -/** - * @tc.number SUB_GRAPHIC_LABEL_GETTEXTHEIGHT_1300 - * @tc.name test label gettextheight api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UILabelTest, Graphic_UILabelTest_Test_GetTextHeight_1300, Function | MediumTest | Level0) -{ - UILabel* label = new UILabel(); - label->GetTextHeight(); - EXPECT_EQ(0, 0); - delete label; -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/ui_list_posix/BUILD.gn b/graphic_lite/ui/ui_list_posix/BUILD.gn deleted file mode 100755 index 81a2a0f4f..000000000 --- a/graphic_lite/ui/ui_list_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUIListTest") { - suite_name = "acts" - sources = [ "src/ui_list_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/ui_list_posix/Test.json b/graphic_lite/ui/ui_list_posix/Test.json deleted file mode 100644 index e21e92b3f..000000000 --- a/graphic_lite/ui/ui_list_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUIListTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_list_posix/src/ui_list_test.cpp b/graphic_lite/ui/ui_list_posix/src/ui_list_test.cpp deleted file mode 100755 index de999b5f4..000000000 --- a/graphic_lite/ui/ui_list_posix/src/ui_list_test.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "components/ui_list.h" - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class UIListTest : public testing::Test { -public: - static void SetUpTestCase(void); - static void TearDownTestCase(void); -}; - -void UIListTest::SetUpTestCase() -{ - return; -} - -void UIListTest::TearDownTestCase() -{ - return; -} - -/** - * @tc.number SUB_GRAPHIC_LIST_SETSTARTINDEX_0100 - * @tc.name test list set-start-index api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIListTest, Graphic_List_Test_SetStartIndex_0100, Function | MediumTest | Level0) -{ - UIList* list = new UIList(); - list->SetStartIndex(1); - EXPECT_EQ(list->GetStartIndex(), 1); - - int16_t index = 0; - list->SetStartIndex(index); - EXPECT_EQ(list->GetStartIndex(), 0); - delete list; -} - -/** - * @tc.number SUB_GRAPHIC_LIST_SETLOOPSTATE_0300 - * @tc.name test list set-loop-state api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIListTest, Graphic_List_Test_SetLoopState_0300, Function | MediumTest | Level0) -{ - UIList* list = new UIList(); - bool state = false; - list->SetLoopState(state); - EXPECT_EQ(list->GetLoopState(), false); - delete list; -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/ui_picker_posix/BUILD.gn b/graphic_lite/ui/ui_picker_posix/BUILD.gn deleted file mode 100755 index 266202db6..000000000 --- a/graphic_lite/ui/ui_picker_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUIPickerTest") { - suite_name = "acts" - sources = [ "src/ui_picker_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/ui_picker_posix/Test.json b/graphic_lite/ui/ui_picker_posix/Test.json deleted file mode 100644 index 8a1e5bb9f..000000000 --- a/graphic_lite/ui/ui_picker_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUIPickerTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_picker_posix/src/ui_picker_test.cpp b/graphic_lite/ui/ui_picker_posix/src/ui_picker_test.cpp deleted file mode 100755 index 0dfd05568..000000000 --- a/graphic_lite/ui/ui_picker_posix/src/ui_picker_test.cpp +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "components/ui_picker.h" - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class UIPickerTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_PICKER_GETVIEWTYPE_0100 - * @tc.name test picker get-view-type api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIPickerTest, Graphic_UIPickerTest_Test_GetViewType_0100, Function | MediumTest | Level0) -{ - UIPicker *picker = new UIPicker(); - EXPECT_EQ(picker->GetViewType(), UI_PICKER); - delete picker; -} - -/** - * @tc.number SUB_GRAPHIC_PICKER_GETHIGHLIGHTFONTID_0200 - * @tc.name test picker get-high-light-fontID api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIPickerTest, Graphic_UIPickerTest_Test_GetHighlightFontId_0200, Function | MediumTest | Level0) -{ - UIPicker *picker = new UIPicker(); - uint8_t highlightFontId = 16; - EXPECT_EQ(picker->GetHighlightFontId(), highlightFontId); - delete picker; -} - -/** - * @tc.number SUB_GRAPHIC_PICKER_SETFONTID_0300 - * @tc.name test picker set-fondID api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIPickerTest, Graphic_UIPickerTest_Test_SetFontId_0300, Function | MediumTest | Level0) -{ - UIPicker *picker = new UIPicker(); - uint8_t backgroundFontId = 16; - uint8_t highlightFontId = 18; - picker->SetFontId(backgroundFontId, highlightFontId); - EXPECT_EQ(picker->GetBackgroundFontId(), backgroundFontId); - EXPECT_EQ(picker->GetHighlightFontId(), highlightFontId); - delete picker; -} - -/** - * @tc.number SUB_GRAPHIC_PICKER_SETTEXTCOLOR_0400 - * @tc.name test picker set-text-color api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIPickerTest, Graphic_UIPickerTest_Test_SetTextColor_0400, Function | MediumTest | Level0) -{ - UIPicker *picker = new UIPicker(); - ColorType backgroundColor; - backgroundColor.alpha = 10; - ColorType highlightColor; - highlightColor.alpha = 20; - picker->SetTextColor(backgroundColor, highlightColor); - EXPECT_EQ(picker->GetBackgroundTextColor().alpha, backgroundColor.alpha); - EXPECT_EQ(picker->GetHighlightTextColor().alpha, highlightColor.alpha); - delete picker; -} - -/** - * @tc.number SUB_GRAPHIC_PICKER_SETWIDTH_0500 - * @tc.name test picker set-width api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIPickerTest, Graphic_UIPickerTest_Test_SetWidth_0500, Function | MediumTest | Level0) -{ - UIPicker *picker = new UIPicker(); - int16_t width = 10; - int16_t height = 20; - picker->SetWidth(width); - picker->SetHeight(height); - EXPECT_EQ(picker->GetWidth(), width); - EXPECT_EQ(picker->GetHeight(), height); - delete picker; -} - - -/** - * @tc.number SUB_GRAPHIC_PICKER_SETSELECTED_0600 - * @tc.name test picker set-selectred api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIPickerTest, Graphic_UIPickerTest_Test_SetSelected_0600, Function | MediumTest | Level0) -{ - UIPicker *picker = new UIPicker(); - uint16_t index = 30; - int16_t itemHeight = 10; - int16_t width = 100; - int16_t height = 100; - int16_t start = 0; - int16_t end = 100; - picker->SetPosition(0, 0, width, height); - picker->SetItemHeight(itemHeight); - picker->SetValues(start, end); - const char* value[1]; - value[0] = "abc"; - picker->SetValues(value, 1); - picker->SetValues(start, end); - picker->SetSelected(index); - EXPECT_EQ(picker->GetSelected(), index); - delete picker; -} - -/** - * @tc.number SUB_GRAPHIC_PICKER_CLEARVALUES_0700 - * @tc.name test picker set-selectred api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIPickerTest, Graphic_UIPickerTest_Test_ClearValues_0700, Function | MediumTest | Level0) -{ - UIPicker *picker = new UIPicker(); - picker->ClearValues(); - EXPECT_EQ(0, 0); - delete picker; -} - -/** - * @tc.number SUB_GRAPHIC_PICKER_SETLOOPSTATE_0800 - * @tc.name test picker set-selectred api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIPickerTest, Graphic_UIPickerTest_Test_SetLoopState_0800, Function | MediumTest | Level0) -{ - UIPicker *picker = new UIPicker(); - bool state = false; - picker->SetLoopState(state); - EXPECT_EQ(0, 0); - delete picker; -} -} diff --git a/graphic_lite/ui/ui_radio_button_posix/BUILD.gn b/graphic_lite/ui/ui_radio_button_posix/BUILD.gn deleted file mode 100755 index e543c237e..000000000 --- a/graphic_lite/ui/ui_radio_button_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUIRadioButtonTest") { - suite_name = "acts" - sources = [ "src/ui_radio_button_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/ui_radio_button_posix/Test.json b/graphic_lite/ui/ui_radio_button_posix/Test.json deleted file mode 100644 index bbf400a3e..000000000 --- a/graphic_lite/ui/ui_radio_button_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUIRadioButtonTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_radio_button_posix/src/ui_radio_button_test.cpp b/graphic_lite/ui/ui_radio_button_posix/src/ui_radio_button_test.cpp deleted file mode 100755 index fd0887fe6..000000000 --- a/graphic_lite/ui/ui_radio_button_posix/src/ui_radio_button_test.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "components/ui_radio_button.h" - -#include -#include - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class UIRadioButtonTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_RADIO_BUTTON_GETVIEWTYPE_0100 - * @tc.name test radio-button get-view-type api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIRadioButtonTest, Graphic_UIRadioButtonTest_Test_GetViewType_0100, Function | MediumTest | Level0) -{ - UIRadioButton *radiobutton = new UIRadioButton(); - EXPECT_EQ(radiobutton->GetViewType(), UI_RADIO_BUTTON); - delete radiobutton; -} - -/** - * @tc.number SUB_GRAPHIC_RADIO_BUTTON_SETNAME_0200 - * @tc.name test radio-button set-name api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIRadioButtonTest, Graphic_UIRadioButtonTest_Test_SetName_0200, Function | MediumTest | Level0) -{ - UIRadioButton *radiobutton = new UIRadioButton(); - const char *name = "radio button test"; - radiobutton->SetName(name); - radiobutton->GetName(); - EXPECT_EQ(0, 0); - delete radiobutton; -} -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_repeat_button_posix/BUILD.gn b/graphic_lite/ui/ui_repeat_button_posix/BUILD.gn deleted file mode 100755 index 95b0435a8..000000000 --- a/graphic_lite/ui/ui_repeat_button_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUIRepeatButtonTest") { - suite_name = "acts" - sources = [ "src/ui_repeat_button_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/ui_repeat_button_posix/Test.json b/graphic_lite/ui/ui_repeat_button_posix/Test.json deleted file mode 100644 index 1cfbdbcb5..000000000 --- a/graphic_lite/ui/ui_repeat_button_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUIRepeatButtonTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_repeat_button_posix/src/ui_repeat_button_test.cpp b/graphic_lite/ui/ui_repeat_button_posix/src/ui_repeat_button_test.cpp deleted file mode 100755 index 81b27a14f..000000000 --- a/graphic_lite/ui/ui_repeat_button_posix/src/ui_repeat_button_test.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "components/ui_repeat_button.h" - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class UIRepeatButtonTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_REPEAT_BUTTON_GETVIEWTYPE_0100 - * @tc.name test repeat-button get-view-type api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIRepeatButtonTest, Graphic_UIRepeatButtonTest_Test_GetViewType_0100, Function | MediumTest | Level0) -{ - UIRepeatButton *repeatButton = new UIRepeatButton(); - EXPECT_EQ(repeatButton->GetViewType(), UI_REPEAT_BUTTON); - delete repeatButton; -} - -/** - * @tc.number SUB_GRAPHIC_REPEAT_BUTTON_SETINTERVAL_0200 - * @tc.name test repeat-button set-interval api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIRepeatButtonTest, Graphic_UIRepeatButtonTest_Test_SetInterval_0200, Function | MediumTest | Level0) -{ - UIRepeatButton *repeatButton = new UIRepeatButton(); - uint16_t interval = 10; - repeatButton->SetInterval(interval); - EXPECT_EQ(repeatButton->GetInterval(), interval); - delete repeatButton; -} - -/** - * @tc.number SUB_GRAPHIC_REPEAT_BUTTON_HANDLETICKEVENT_0300 - * @tc.name test repeat-button handle-tick-event api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIRepeatButtonTest, Graphic_UIRepeatButtonTest_Test_HandleTickEvent_0300, Function | MediumTest | Level0) -{ - UIRepeatButton *repeatButton = new UIRepeatButton(); - repeatButton->HandleTickEvent(); - EXPECT_EQ(0, 0); - delete repeatButton; -} -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_screenshot_posix/BUILD.gn b/graphic_lite/ui/ui_screenshot_posix/BUILD.gn deleted file mode 100755 index c2427d4a5..000000000 --- a/graphic_lite/ui/ui_screenshot_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUIScreenshotTest") { - suite_name = "acts" - sources = [ "src/ui_screenshot_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/ui_screenshot_posix/Test.json b/graphic_lite/ui/ui_screenshot_posix/Test.json deleted file mode 100644 index cba8405bf..000000000 --- a/graphic_lite/ui/ui_screenshot_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUIScreenshotTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_screenshot_posix/src/ui_screenshot_test.cpp b/graphic_lite/ui/ui_screenshot_posix/src/ui_screenshot_test.cpp deleted file mode 100755 index 4cc5413c0..000000000 --- a/graphic_lite/ui/ui_screenshot_posix/src/ui_screenshot_test.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "dfx/ui_screenshot.h" - -#include -#include - -using namespace std; -using namespace testing::ext; - -namespace OHOS { -enum ButtonState : uint8_t { - RELEASED = 0, - PRESSED, - INACTIVE, - BTN_STATE_NUM, -}; - -class UIScreenshotTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_SCREENSHOT_GETINSTANCE_0100 - * @tc.name test screenshot get-instance api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIScreenshotTest, Graphic_UIScreenshot_Test_GetInstance_0100, Function | MediumTest | Level0) -{ - UIScreenshot::GetInstance(); - EXPECT_EQ(0, 0); -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/ui_scroll_view_posix/BUILD.gn b/graphic_lite/ui/ui_scroll_view_posix/BUILD.gn deleted file mode 100755 index f7f449d51..000000000 --- a/graphic_lite/ui/ui_scroll_view_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUIScrollViewTest") { - suite_name = "acts" - sources = [ "src/ui_scroll_view_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/ui_scroll_view_posix/Test.json b/graphic_lite/ui/ui_scroll_view_posix/Test.json deleted file mode 100644 index 6cbc8aab0..000000000 --- a/graphic_lite/ui/ui_scroll_view_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUIScrollViewTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_scroll_view_posix/src/ui_scroll_view_test.cpp b/graphic_lite/ui/ui_scroll_view_posix/src/ui_scroll_view_test.cpp deleted file mode 100755 index d88713c50..000000000 --- a/graphic_lite/ui/ui_scroll_view_posix/src/ui_scroll_view_test.cpp +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "components/ui_scroll_view.h" - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class ScrollViewTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -class ScrollListenerTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_SCROLL_VIEW_SETSCROLLSTATE_0100 - * @tc.name test scroll-view set-scroll-state api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ScrollListenerTest, Graphic_UIScrollViewTest_Test_SetScrollState_0100, Function | MediumTest | Level0) -{ - UIScrollView::OnScrollListener *scrolllis = new UIScrollView::OnScrollListener(); - uint8_t state = 1; - scrolllis->SetScrollState(state); - EXPECT_EQ(scrolllis->GetScrollState(), state); - delete scrolllis; -} - -/** - * @tc.number SUB_GRAPHIC_SCROLL_VIEW_GETVIEWTYPE_0200 - * @tc.name test scroll-view get-view-type api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ScrollViewTest, Graphic_UIScrollViewTest_Test_GetViewType_0200, Function | MediumTest | Level0) -{ - UIScrollView *scrolllis = new UIScrollView(); - EXPECT_EQ(scrolllis->GetViewType(), UI_SCROLL_VIEW); - delete scrolllis; -} - -/** - * @tc.number SUB_GRAPHIC_SCROLL_VIEW_SETHORIZONTALSCROLLSTATE_0300 - * @tc.name test scroll-view set-horizontal-scroll-state api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ScrollViewTest, Graphic_UIScrollViewTest_Test_SetHorizontalScrollState_0300, Function | MediumTest | Level0) -{ - UIScrollView *scrollView = new UIScrollView(); - bool state = false; - scrollView->SetHorizontalScrollState(state); - EXPECT_EQ(scrollView->GetHorizontalScrollState(), state); - delete scrollView; -} - -/** - * @tc.number SUB_GRAPHIC_SCROLL_VIEW_SETVERTICALSCROLLSTATE_0400 - * @tc.name test scroll-view set-vertical-scroll-state api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ScrollViewTest, Graphic_UIScrollViewTest_Test_SetVerticalScrollState_0400, Function | MediumTest | Level0) -{ - UIScrollView *scrollView = new UIScrollView(); - bool state = false; - scrollView->SetVerticalScrollState(state); - EXPECT_EQ(scrollView->GetVerticalScrollState(), state); - delete scrollView; -} - -/** - * @tc.number SUB_GRAPHIC_SCROLL_VIEW_SCROLLBY_0500 - * @tc.name test scroll-view scroll-by api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ScrollViewTest, Graphic_UIScrollViewTest_Test_ScrollBy_0500, Function | MediumTest | Level0) -{ - UIScrollView *scrollView = new UIScrollView(); - int16_t xDistance = 0; - int16_t yDistance = 0; - scrollView->ScrollBy(xDistance, yDistance); - EXPECT_EQ(0, 0); - delete scrollView; -} - -/** - * @tc.number SUB_GRAPHIC_SCROLL_VIEW_SETSCROLLBARWIDTH_0600 - * @tc.name test scroll-view set-vertical-scroll-state api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ScrollViewTest, Graphic_UIScrollViewTest_Test_SetScrollbarWidth_0600, Function | MediumTest | Level0) -{ - UIScrollView *scrollView = new UIScrollView(); - uint8_t width = 0; - scrollView->SetScrollbarWidth(width); - EXPECT_EQ(0, 0); - delete scrollView; -} - -/** - * @tc.number SUB_GRAPHIC_SCROLL_VIEW_SETXSCROLLBARVISIBLE_0700 - * @tc.name test scroll-view set-vertical-scroll-state api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ScrollViewTest, Graphic_UIScrollViewTest_Test_SetXScrollBarVisible_0700, Function | MediumTest | Level0) -{ - UIScrollView *scrollView = new UIScrollView(); - bool state = false; - scrollView->SetXScrollBarVisible(state); - EXPECT_EQ(0, 0); - delete scrollView; -} - -/** - * @tc.number SUB_GRAPHIC_SCROLL_VIEW_SETYSCROLLBARVISIBLE_0800 - * @tc.name test scroll-view set-vertical-scroll-state api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ScrollViewTest, Graphic_UIScrollViewTest_Test_SetYScrollBarVisible_0800, Function | MediumTest | Level0) -{ - UIScrollView *scrollView = new UIScrollView(); - bool state = false; - scrollView->SetYScrollBarVisible(state); - EXPECT_EQ(0, 0); - delete scrollView; -} - -/** - * @tc.number SUB_GRAPHIC_SCROLL_VIEW_REFRESHSCROLLBAR_0900 - * @tc.name test scroll-view set-vertical-scroll-state api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(ScrollViewTest, Graphic_UIScrollViewTest_Test_RefreshScrollBar_0900, Function | MediumTest | Level0) -{ - UIScrollView *scrollView = new UIScrollView(); - scrollView->RefreshScrollBar(); - EXPECT_EQ(0, 0); - delete scrollView; -} -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_slider_posix/BUILD.gn b/graphic_lite/ui/ui_slider_posix/BUILD.gn deleted file mode 100755 index bbee1efb3..000000000 --- a/graphic_lite/ui/ui_slider_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUISliderTest") { - suite_name = "acts" - sources = [ "src/ui_slider_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/ui_slider_posix/Test.json b/graphic_lite/ui/ui_slider_posix/Test.json deleted file mode 100644 index 7d5b3a66d..000000000 --- a/graphic_lite/ui/ui_slider_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUISliderTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_slider_posix/src/ui_slider_test.cpp b/graphic_lite/ui/ui_slider_posix/src/ui_slider_test.cpp deleted file mode 100755 index 194818f64..000000000 --- a/graphic_lite/ui/ui_slider_posix/src/ui_slider_test.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "components/ui_slider.h" - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class UISliderTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_SLIDER_GETVIEWTYPE_0100 - * @tc.name test slider get-view-type api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UISliderTest, Graphic_UISliderTest_Test_GetViewType_0100, Function | MediumTest | Level0) -{ - UISlider* slider = new UISlider(); - EXPECT_EQ(slider->GetViewType(), UI_SLIDER); - delete slider; -} - -/** - * @tc.number SUB_GRAPHIC_SLIDER_SETKNOBWIDTH_0200 - * @tc.name test slider set-knob-width api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UISliderTest, Graphic_UISliderTest_Test_SetKnobWidth_0200, Function | MediumTest | Level0) -{ - UISlider* slider = new UISlider(); - int16_t width = 10; - slider->SetKnobWidth(10); - EXPECT_EQ(slider->GetKnobWidth(), width); - delete slider; -} - -/** - * @tc.number SUB_GRAPHIC_SLIDER_SETIMAGE_0400 - * @tc.name test slider set-image api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UISliderTest, Graphic_UISliderTest_Test_SetImage_0400, Function | MediumTest | Level0) -{ - UISlider* slider = new UISlider(); - ImageInfo* backgroundImage = nullptr; - ImageInfo* foregroundImage = nullptr; - slider->SetImage(backgroundImage, foregroundImage); - EXPECT_EQ(0, 0); -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/ui_surface_view_posix/BUILD.gn b/graphic_lite/ui/ui_surface_view_posix/BUILD.gn deleted file mode 100755 index 6076a71cc..000000000 --- a/graphic_lite/ui/ui_surface_view_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUISurfaceViewTest") { - suite_name = "acts" - sources = [ "src/ui_surface_view_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/ui_surface_view_posix/Test.json b/graphic_lite/ui/ui_surface_view_posix/Test.json deleted file mode 100644 index d21abd2e7..000000000 --- a/graphic_lite/ui/ui_surface_view_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUISurfaceViewTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_surface_view_posix/src/ui_surface_view_test.cpp b/graphic_lite/ui/ui_surface_view_posix/src/ui_surface_view_test.cpp deleted file mode 100755 index bc4ee010d..000000000 --- a/graphic_lite/ui/ui_surface_view_posix/src/ui_surface_view_test.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "components/ui_surface_view.h" - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class UISurfaceViewTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_SURFACE_SETPOSITION_0100 - * @tc.name test surface set-position api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UISurfaceViewTest, Graphic_UISurfaceViewTest_Test_SetPosition_0100, Function | MediumTest | Level0) -{ - UISurfaceView* surface = new UISurfaceView(); - int16_t x = 10; - int16_t y = 20; - surface->SetPosition(x, y); - EXPECT_EQ(surface->GetX(), x); - EXPECT_EQ(surface->GetY(), y); - delete surface; -} - -/** - * @tc.number SUB_GRAPHIC_SURFACE_SETPOSITION_0200 - * @tc.name test surface set-position2 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UISurfaceViewTest, Graphic_UISurfaceViewTest_Test_SetPosition_0200, Function | MediumTest | Level0) -{ - UISurfaceView* surface = new UISurfaceView(); - int16_t x = 10; - int16_t y = 20; - int16_t width = 50; - int16_t height = 30; - surface->SetPosition(x, y, width, height); - EXPECT_EQ(surface->GetX(), x); - EXPECT_EQ(surface->GetY(), y); - EXPECT_EQ(surface->GetWidth(), width); - EXPECT_EQ(surface->GetHeight(), height); - delete surface; -} - -/** - * @tc.number SUB_GRAPHIC_SURFACE_RESIZE_0300 - * @tc.name test surface resize api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UISurfaceViewTest, Graphic_UISurfaceViewTest_Test_Resize_0300, Function | MediumTest | Level0) -{ - UISurfaceView* surface = new UISurfaceView(); - int16_t width = 50; - int16_t height = 30; - surface->Resize(width, height); - EXPECT_EQ(surface->GetWidth(), width); - EXPECT_EQ(surface->GetHeight(), height); - delete surface; -} - -/** - * @tc.number SUB_GRAPHIC_SURFACE_SETX_0400 - * @tc.name test surface setX api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UISurfaceViewTest, Graphic_UISurfaceViewTest_Test_SetX_0400, Function | MediumTest | Level0) -{ - UISurfaceView* surface = new UISurfaceView(); - int16_t x = 10; - surface->SetX(x); - EXPECT_EQ(surface->GetX(), x); - delete surface; -} - -/** - * @tc.number SUB_GRAPHIC_SURFACE_SETY_0500 - * @tc.name test surface setY api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UISurfaceViewTest, Graphic_UISurfaceViewTest_Test_SetY_0500, Function | MediumTest | Level0) -{ - UISurfaceView* surface = new UISurfaceView(); - int16_t y = 10; - surface->SetY(y); - EXPECT_EQ(surface->GetY(), y); - delete surface; -} - -/** - * @tc.number SUB_GRAPHIC_SURFACE_SETWIDTH_0600 - * @tc.name test surface set-width api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UISurfaceViewTest, Graphic_UISurfaceViewTest_Test_SetWidth_0600, Function | MediumTest | Level0) -{ - UISurfaceView* surface = new UISurfaceView(); - int16_t width = 50; - surface->SetWidth(width); - EXPECT_EQ(surface->GetWidth(), width); - delete surface; -} - -/** - * @tc.number SUB_GRAPHIC_SURFACE_SETHEIGHT_0700 - * @tc.name test surface set-height api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UISurfaceViewTest, Graphic_UISurfaceViewTest_Test_SetHeight_0700, Function | MediumTest | Level0) -{ - UISurfaceView* surface = new UISurfaceView(); - surface->SetVisible(true); - EXPECT_EQ(surface->IsVisible(), true); - delete surface; -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/ui_swipe_view_posix/BUILD.gn b/graphic_lite/ui/ui_swipe_view_posix/BUILD.gn deleted file mode 100755 index 20a2cf1ba..000000000 --- a/graphic_lite/ui/ui_swipe_view_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUISwipeViewTest") { - suite_name = "acts" - sources = [ "src/ui_swipe_view_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/ui_swipe_view_posix/Test.json b/graphic_lite/ui/ui_swipe_view_posix/Test.json deleted file mode 100644 index a69de66e1..000000000 --- a/graphic_lite/ui/ui_swipe_view_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUISwipeViewTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_swipe_view_posix/src/ui_swipe_view_test.cpp b/graphic_lite/ui/ui_swipe_view_posix/src/ui_swipe_view_test.cpp deleted file mode 100755 index ca4ffe87f..000000000 --- a/graphic_lite/ui/ui_swipe_view_posix/src/ui_swipe_view_test.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "components/ui_swipe_view.h" - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class UISwipeViewTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_SWIPE_VIEW_GETVIEWTYPE_0100 - * @tc.name test swipe-view get-view-type api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UISwipeViewTest, Graphic_UISwipeView_Test_GetViewType_010, Function | MediumTest | Level0) -{ - UISwipeView *swipeView = new UISwipeView(); - EXPECT_EQ(swipeView->GetViewType(), UI_SWIPE_VIEW); - delete swipeView; -} - -/** - * @tc.number SUB_GRAPHIC_SWIPE_VIEW_SETDIRECTION_0200 - * @tc.name test swipe-view set-direction api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UISwipeViewTest, Graphic_UISwipeView_Test_SetDirection_0200, Function | MediumTest | Level0) -{ - UISwipeView *swipeView = new UISwipeView(); - uint8_t direction = 20; - swipeView->SetDirection(direction); - EXPECT_EQ(swipeView->GetDirection(), 0); - delete swipeView; -} - -/** - * @tc.number SUB_GRAPHIC_SWIPE_VIEW_ADD_0300 - * @tc.name test swipe-view add api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UISwipeViewTest, Graphic_UISwipeView_Test_Add_0300, Function | MediumTest | Level0) -{ - UISwipeView *swipeView = new UISwipeView(); - UIView* view = new UIView(); - swipeView->Add(view); - EXPECT_EQ(view, swipeView->GetChildrenHead()); - EXPECT_EQ(view->GetParent(), swipeView); - delete swipeView; -} - -/** - * @tc.number SUB_GRAPHIC_SWIPE_VIEW_INSERT_0400 - * @tc.name test swipe-view insert api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UISwipeViewTest, Graphic_UISwipeView_Test_Insert_0400, Function | MediumTest | Level0) -{ - UISwipeView *swipeView = new UISwipeView(); - UIView* preView = new UIView(); - UIView* view = new UIView(); - swipeView->Add(preView); - swipeView->Insert(preView, view); - EXPECT_EQ(view, preView->GetNextSibling()); - - delete view; - delete preView; - delete swipeView; -} - -/** - * @tc.number SUB_GRAPHIC_SWIPE_VIEW_REMOVE_0500 - * @tc.name test swipe-view remove api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UISwipeViewTest, Graphic_UISwipeView_Test_Remove_0500, Function | MediumTest | Level0) -{ - UISwipeView *swipeView = new UISwipeView(); - UIView* view = new UIView(); - swipeView->Add(view); - swipeView->Remove(view); - - EXPECT_EQ(nullptr, swipeView->GetChildrenHead()); - EXPECT_EQ(nullptr, view->GetParent()); - delete view; - delete swipeView; -} - -/** - * @tc.number SUB_GRAPHIC_SWIPE_VIEW_SETCURRENTPAGE_0600 - * @tc.name test swipe-view set-current-page api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UISwipeViewTest, Graphic_UISwipeView_Test_SetCurrentPage_0600, Function | MediumTest | Level0) -{ - UISwipeView *swipeView = new UISwipeView(UISwipeView::VERTICAL); - swipeView->SetPosition(0, 0, 200, 200); - UIViewGroup *view = new UIViewGroup(); - view->SetPosition(0, 0, 200, 200); - swipeView->Add(view); - UIViewGroup *view2 = new UIViewGroup(); - view2->SetPosition(0, 0, 200, 200); - swipeView->Add(view2); - uint16_t index = 0; - swipeView->SetCurrentPage(index); - EXPECT_EQ(swipeView->GetCurrentPage(), index); - delete view; - delete view2; - delete swipeView; -} - -/** - * @tc.number SUB_GRAPHIC_SWIPE_VIEW_SETANIMATORTIME_0800 - * @tc.name test swipe-view set-current-page api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UISwipeViewTest, Graphic_UISwipeView_Test_SetAnimatorTime_0800, Function | MediumTest | Level0) -{ - UISwipeView *swipeView = new UISwipeView(UISwipeView::VERTICAL); - uint16_t time = 0; - swipeView->SetAnimatorTime(time); - EXPECT_EQ(0, 0); - delete swipeView; -} - -/** - * @tc.number SUB_GRAPHIC_SWIPE_VIEW_SETLOOPSTATE_0900 - * @tc.name test swipe-view set-current-page api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UISwipeViewTest, Graphic_UISwipeView_Test_SetLoopState_0900, Function | MediumTest | Level0) -{ - UISwipeView *swipeView = new UISwipeView(UISwipeView::VERTICAL); - bool loop = false; - swipeView->SetLoopState(loop); - EXPECT_EQ(0, 0); - delete swipeView; -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/ui_text_posix/BUILD.gn b/graphic_lite/ui/ui_text_posix/BUILD.gn deleted file mode 100755 index e5ee22d2a..000000000 --- a/graphic_lite/ui/ui_text_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUITextTest") { - suite_name = "acts" - sources = [ "src/ui_text_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/ui_text_posix/Test.json b/graphic_lite/ui/ui_text_posix/Test.json deleted file mode 100644 index 6de04fba9..000000000 --- a/graphic_lite/ui/ui_text_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUITextTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_text_posix/src/ui_text_test.cpp b/graphic_lite/ui/ui_text_posix/src/ui_text_test.cpp deleted file mode 100755 index 721bf1c65..000000000 --- a/graphic_lite/ui/ui_text_posix/src/ui_text_test.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "common/text.h" - -#include -#include - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class UITextTest : public testing::Test { -public: - static void SetUpTestCase(void) - { - if (textVar == nullptr) { - textVar = new Text(); - } - } - static void TearDownTestCase(void) - { - if (textVar != nullptr) { - delete textVar; - textVar = nullptr; - } - } - static Text* textVar; -}; -Text* UITextTest::textVar = nullptr; - -/** - * @tc.number SUB_GRAPHIC_UITEXT_SETTEXT_0100 - * @tc.name test text set-text api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UITextTest, Graphic_UITextTest_Test_SetText_0100, Function | MediumTest | Level0) -{ - const char* text = "abc"; - textVar->SetText(text); - EXPECT_EQ(strcmp(textVar->GetText(), text), 0); - EXPECT_EQ(textVar->IsNeedRefresh(), true); -} - -/** - * @tc.number SUB_GRAPHIC_UITEXT_SETDIRECT_0200 - * @tc.name test text set-direct api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UITextTest, Graphic_UITextTest_Test_SetDirect_0200, Function | MediumTest | Level0) -{ - UITextLanguageDirect direct = TEXT_DIRECT_RTL; - textVar->SetDirect(direct); - EXPECT_EQ(textVar->GetDirect(), direct); -} - -/** - * @tc.number SUB_GRAPHIC_UITEXT_SETALIGN_0300 - * @tc.name test text set-align api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UITextTest, Graphic_UITextTest_Test_SetAlign_0300, Function | MediumTest | Level0) -{ - textVar->SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_TOP); - EXPECT_EQ(textVar->GetHorAlign(), TEXT_ALIGNMENT_LEFT); - EXPECT_EQ(textVar->GetVerAlign(), TEXT_ALIGNMENT_TOP); -} - -/** - * @tc.number SUB_GRAPHIC_UITEXT_SETEXPANDWIDTH_0500 - * @tc.name test text set-expand-width api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UITextTest, Graphic_UITextTest_Test_SetExpandWidth_0500, Function | MediumTest | Level0) -{ - bool expand = true; - textVar->SetExpandWidth(expand); - EXPECT_EQ(textVar->IsExpandWidth(), expand); -} - -/** - * @tc.number SUB_GRAPHIC_UITEXT_SETEXPANDHEIGHT_0600 - * @tc.name test text set-expand-height api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UITextTest, Graphic_UITextTest_Test_SetExpandHeight_0600, Function | MediumTest | Level0) -{ - bool expand = true; - textVar->SetExpandHeight(expand); - EXPECT_EQ(textVar->IsExpandHeight(), expand); -} - -/** - * @tc.number SUB_GRAPHIC_UITEXT_SETELLIPSISINDEX_0700 - * @tc.name test text set-ellipsis-index api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UITextTest, Graphic_UITextTest_Test_GetEllipsisIndex_0700, Function | MediumTest | Level0) -{ - Rect rect; - rect.SetX(1); - rect.SetY(1); - rect.SetWidth(2); - rect.SetHeight(2); - - Style style; - style.letterSpace_ = 3; - style.lineSpace_ = 4; - - EXPECT_NE(textVar->GetEllipsisIndex(rect, style), 0); -} -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_texture_mapper_posix/BUILD.gn b/graphic_lite/ui/ui_texture_mapper_posix/BUILD.gn deleted file mode 100755 index e9b37a853..000000000 --- a/graphic_lite/ui/ui_texture_mapper_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUITextureMapperTest") { - suite_name = "acts" - sources = [ "src/ui_texture_mapper_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/ui_texture_mapper_posix/Test.json b/graphic_lite/ui/ui_texture_mapper_posix/Test.json deleted file mode 100644 index 405ee1acf..000000000 --- a/graphic_lite/ui/ui_texture_mapper_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUITextureMapperTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_texture_mapper_posix/src/ui_texture_mapper_test.cpp b/graphic_lite/ui/ui_texture_mapper_posix/src/ui_texture_mapper_test.cpp deleted file mode 100755 index 8c1845ef2..000000000 --- a/graphic_lite/ui/ui_texture_mapper_posix/src/ui_texture_mapper_test.cpp +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "components/ui_texture_mapper.h" - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class UITextureMapperTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_UITEXTUREMAPPER_START_0100 - * @tc.name test UItexture-mapper start api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UITextureMapperTest, Graphic_UITextureMapper_Test_Start_0100, Function | MediumTest | Level0) -{ - UITextureMapper* testObj = new UITextureMapper(); - testObj->Start(); - EXPECT_EQ(0, 0); - delete testObj; -} - -/** - * @tc.number SUB_GRAPHIC_UITEXTUREMAPPER_SETROTATESTART_0200 - * @tc.name test UItexture-mapper set-rotate-start api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UITextureMapperTest, Graphic_UITextureMapper_Test_SetRotateStart_0200, Function | MediumTest | Level0) -{ - UITextureMapper* testObj = new UITextureMapper(); - int16_t start = 100; - testObj->SetRotateStart(start); - EXPECT_EQ(0, 0); - delete testObj; -} - -/** - * @tc.number SUB_GRAPHIC_UITEXTUREMAPPER_SETROTATEEND_0300 - * @tc.name test UItexture-mapper set-rotate-end api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UITextureMapperTest, Graphic_UITextureMapper_Test_SetRotateEnd_0300, Function | MediumTest | Level0) -{ - UITextureMapper* testObj = new UITextureMapper(); - int16_t end = 100; - testObj->SetRotateEnd(end); - EXPECT_EQ(0, 0); - delete testObj; -} - -/** - * @tc.number SUB_GRAPHIC_UITEXTUREMAPPER_SETSCALESTART_0400 - * @tc.name test UItexture-mapper set-scale-start api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UITextureMapperTest, Graphic_UITextureMapper_Test_SetScaleStart_0400, Function | MediumTest | Level0) -{ - UITextureMapper* testObj = new UITextureMapper(); - float start = 100.0; - testObj->SetScaleStart(start); - EXPECT_EQ(0, 0); - delete testObj; -} - -/** - * @tc.number SUB_GRAPHIC_UITEXTUREMAPPER_SETSCALEEND_0500 - * @tc.name test UItexture-mapper set-scale-end api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UITextureMapperTest, Graphic_UITextureMapper_Test_SetScaleEnd_0500, Function | MediumTest | Level0) -{ - UITextureMapper* testObj = new UITextureMapper(); - float end = 100.0; - testObj->SetScaleEnd(end); - EXPECT_EQ(0, 0); - delete testObj; -} - -/** - * @tc.number SUB_GRAPHIC_UITEXTUREMAPPER_SETDURATIONTIME_0600 - * @tc.name test UItexture-mapper set-duration-time api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UITextureMapperTest, Graphic_UITextureMapper_Test_SetDurationTime_0600, Function | MediumTest | Level0) -{ - UITextureMapper* testObj = new UITextureMapper(); - uint16_t durationTime = 100; - testObj->SetDurationTime(durationTime); - EXPECT_EQ(0, 0); - delete testObj; -} - -/** - * @tc.number SUB_GRAPHIC_UITEXTUREMAPPER_SETDELAYTIME_0700 - * @tc.name test UItexture-mapper set-delay-time api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UITextureMapperTest, Graphic_UITextureMapper_Test_SetDelayTime_0700, Function | MediumTest | Level0) -{ - UITextureMapper* testObj = new UITextureMapper(); - uint16_t delayTime = 100; - testObj->SetDelayTime(delayTime); - EXPECT_EQ(0, 0); - delete testObj; -} - -/** - * @tc.number SUB_GRAPHIC_UITEXTUREMAPPER_SETEASINGFUNC_0800 - * @tc.name test UItexture-mapper set-easing-func api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UITextureMapperTest, Graphic_UITextureMapper_Test_SetEasingFunc_0800, Function | MediumTest | Level0) -{ - UITextureMapper* testObj = new UITextureMapper(); - EasingFunc* easingFunc = new EasingFunc(); - testObj->SetEasingFunc(*easingFunc); - EXPECT_EQ(0, 0); - delete easingFunc; - delete testObj; -} - -/** - * @tc.number SUB_GRAPHIC_UITEXTUREMAPPER_CANCEL_0900 - * @tc.name test UItexture-mapper cancel api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UITextureMapperTest, Graphic_UITextureMapper_Test_Cancel_0900, Function | MediumTest | Level0) -{ - UITextureMapper* testObj = new UITextureMapper(); - testObj->Cancel(); - EXPECT_EQ(0, 0); - delete testObj; -} - -/** - * @tc.number SUB_GRAPHIC_UITEXTUREMAPPER_RESET_1000 - * @tc.name test UItexture-mapper reset api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UITextureMapperTest, Graphic_UITextureMapper_Test_Reset_1000, Function | MediumTest | Level0) -{ - UITextureMapper* testObj = new UITextureMapper(); - testObj->Reset(); - EXPECT_EQ(0, 0); - delete testObj; -} - -/** - * @tc.number SUB_GRAPHIC_UITEXTUREMAPPER_SETPIVOT_1100 - * @tc.name test UItexture-mapper set-pivot api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UITextureMapperTest, Graphic_UITextureMapper_Test_SetPivot_1100, Function | MediumTest | Level0) -{ - UITextureMapper* testObj = new UITextureMapper(); - int16_t xInt = 10; - int16_t yInt = 20; - testObj->SetPivot(xInt, yInt); - EXPECT_EQ(0, 0); - delete testObj; -} - -class MyTest : public UITextureMapper::AnimatorStopListener { -public: - MyTest(){}; - ~MyTest(){}; - void OnAnimatorStop(UIView& view) {} -}; - -/** - * @tc.number SUB_GRAPHIC_UITEXTUREMAPPER_SETANIMATORSTOPLISTENER_1200 - * @tc.name test UItexture-mapper set-animator-stop-listener api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UITextureMapperTest, Graphic_UITextureMapper_Test_SetAnimatorStopListener_1200, Function | MediumTest | Level0) -{ - UITextureMapper* testObj = new UITextureMapper(); - auto* listener = new MyTest(); - testObj->SetAnimatorStopListener(listener); - EXPECT_EQ(0, 0); - delete listener; - delete testObj; -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/ui_time_picker_posix/BUILD.gn b/graphic_lite/ui/ui_time_picker_posix/BUILD.gn deleted file mode 100755 index c4aec9baf..000000000 --- a/graphic_lite/ui/ui_time_picker_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUITimePickerTest") { - suite_name = "acts" - sources = [ "src/ui_time_picker_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/ui_time_picker_posix/Test.json b/graphic_lite/ui/ui_time_picker_posix/Test.json deleted file mode 100644 index 164e5ec78..000000000 --- a/graphic_lite/ui/ui_time_picker_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUITimePickerTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_time_picker_posix/src/ui_time_picker_test.cpp b/graphic_lite/ui/ui_time_picker_posix/src/ui_time_picker_test.cpp deleted file mode 100755 index c85575b62..000000000 --- a/graphic_lite/ui/ui_time_picker_posix/src/ui_time_picker_test.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "components/ui_time_picker.h" - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class UITimePickerTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_TIMEPICKER_GETVIEWTYPE_0100 - * @tc.name test time-picker get-view-type api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UITimePickerTest, Graphic_UITimePicker_Test_GetViewType_0100, Function | MediumTest | Level0) -{ - UITimePicker *timePicker = new UITimePicker(); - EXPECT_EQ(timePicker->GetViewType(), UI_TIME_PICKER); - delete timePicker; -} - -/** - * @tc.number SUB_GRAPHIC_TIMEPICKER_SETWIDTH_0200 - * @tc.name test time-picker set-width api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UITimePickerTest, Graphic_UITimePicker_Test_SetWidth_0200, Function | MediumTest | Level0) -{ - UITimePicker *timePicker = new UITimePicker(); - int16_t width = 50; - timePicker->SetWidth(width); - EXPECT_EQ(timePicker->GetWidth(), width); - delete timePicker; -} - -/** - * @tc.number SUB_GRAPHIC_TIMEPICKER_SETHEIGHT_0300 - * @tc.name test time-picker set-height api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UITimePickerTest, Graphic_UITimePicker_Test_SetHeight_0300, Function | MediumTest | Level0) -{ - UITimePicker *timePicker = new UITimePicker(); - int16_t height = 100; - timePicker->SetHeight(height); - EXPECT_EQ(timePicker->GetHeight(), height); - delete timePicker; -} - -/** - * @tc.number SUB_GRAPHIC_TIMEPICKER_SETSELECTED_0400 - * @tc.name test time-picker set-selected api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UITimePickerTest, Graphic_UITimePicker_Test_SetSelected_0400, Function | MediumTest | Level0) -{ - UITimePicker *timePicker = new UITimePicker(); - const char* value = "12:34:56"; - timePicker->EnableSecond(true); - bool ret = timePicker->SetSelected(value); - EXPECT_EQ(ret, true); - - timePicker->GetSelectValue(); - timePicker->GetSelectHour(); - timePicker->GetSelectMinute(); - timePicker->GetSelectSecond(); - - EXPECT_EQ(0, 0); - - delete timePicker; -} - -/** - * @tc.number SUB_GRAPHIC_TIMEPICKER_REGISTERSELECTEDLISTENER_0500 - * @tc.name test time-picker register-selected-listener api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UITimePickerTest, Graphic_UITimePicker_Test_RegisterSelectedListener_0500, Function | MediumTest | Level0) -{ - UITimePicker *timePicker = new UITimePicker(); - UITimePicker::SelectedListener *timePickerListener = new UITimePicker::SelectedListener(); - timePicker->RegisterSelectedListener(timePickerListener); - EXPECT_EQ(0, 0); - delete timePickerListener; - delete timePicker; -} - -/** - * @tc.number SUB_GRAPHIC_TIMEPICKER_ENABLESECOND_0600 - * @tc.name test time-picker enable-second api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UITimePickerTest, Graphic_UITimePicker_Test_EnableSecond_0600, Function | MediumTest | Level0) -{ - UITimePicker *timePicker = new UITimePicker(); - bool isEnable = false; - timePicker->EnableSecond(isEnable); - EXPECT_EQ(0, 0); - delete timePicker; -} - -/** - * @tc.number SUB_GRAPHIC_TIMEPICKER_SETTEXTSTYLE_0700 - * @tc.name test time-picker set-text-style api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UITimePickerTest, Graphic_UITimePicker_Test_SetTextStyle_0700, Function | MediumTest | Level0) -{ - UITimePicker *timePicker = new UITimePicker(); - uint8_t backgroundFontId = 128; - uint8_t highlightFontId = 64; - ColorType backgroundColor = Color::Green(); - ColorType highlightColor = Color::Red(); - timePicker->SetTextStyle(backgroundFontId, highlightFontId, backgroundColor, highlightColor); - EXPECT_EQ(0, 0); - delete timePicker; -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/ui_toggle_button_posix/BUILD.gn b/graphic_lite/ui/ui_toggle_button_posix/BUILD.gn deleted file mode 100755 index de43827b6..000000000 --- a/graphic_lite/ui/ui_toggle_button_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUIToggleButtonTest") { - suite_name = "acts" - sources = [ "src/ui_toggle_button_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/ui_toggle_button_posix/Test.json b/graphic_lite/ui/ui_toggle_button_posix/Test.json deleted file mode 100644 index a445017be..000000000 --- a/graphic_lite/ui/ui_toggle_button_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUIToggleButtonTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_toggle_button_posix/src/ui_toggle_button_test.cpp b/graphic_lite/ui/ui_toggle_button_posix/src/ui_toggle_button_test.cpp deleted file mode 100755 index 6db23cd3d..000000000 --- a/graphic_lite/ui/ui_toggle_button_posix/src/ui_toggle_button_test.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "components/ui_toggle_button.h" - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class UIToggleButtonTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_TOGGLEBUTTON_GETVIEWTYPE_0100 - * @tc.name test toggle-button get-view-type api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIToggleButtonTest, Graphic_UIToggleButtonTest_Test_GetViewType_0100, Function | MediumTest | Level0) -{ - UIToggleButton* toggleBtn = new UIToggleButton(); - if (toggleBtn != nullptr) { - EXPECT_EQ(toggleBtn->GetViewType(), UI_TOGGLE_BUTTON); - if (toggleBtn != nullptr) { - delete toggleBtn; - } - } -} - -/** - * @tc.number SUB_GRAPHIC_TOGGLEBUTTON_SETSTATE_0200 - * @tc.name test toggle-button set-state api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIToggleButtonTest, Graphic_UIToggleButtonTest_Test_SetState_0200, Function | MediumTest | Level0) -{ - UIToggleButton* toggleBtn = new UIToggleButton(); - if (toggleBtn != nullptr) { - toggleBtn->SetState(true); - EXPECT_EQ(toggleBtn->GetState(), true); - if (toggleBtn != nullptr) { - delete toggleBtn; - } - } -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/ui_view_group_posix/BUILD.gn b/graphic_lite/ui/ui_view_group_posix/BUILD.gn deleted file mode 100755 index 5f687b70c..000000000 --- a/graphic_lite/ui/ui_view_group_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUIViewGroupTest") { - suite_name = "acts" - sources = [ "src/ui_view_group_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/ui_view_group_posix/Test.json b/graphic_lite/ui/ui_view_group_posix/Test.json deleted file mode 100644 index 6b39dc030..000000000 --- a/graphic_lite/ui/ui_view_group_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUIViewGroupTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_view_group_posix/src/ui_view_group_test.cpp b/graphic_lite/ui/ui_view_group_posix/src/ui_view_group_test.cpp deleted file mode 100755 index 476e9de4f..000000000 --- a/graphic_lite/ui/ui_view_group_posix/src/ui_view_group_test.cpp +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "components/root_view.h" -#include "components/ui_view_group.h" - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class UIViewGroupTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_UIVIEWGROUP_ADD_0100 - * @tc.name test UIview-group add api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewGroupTest, Graphic_UIViewGroup_Test_Add_0100, Function | MediumTest | Level0) -{ - UIViewGroup* group = new UIViewGroup(); - UIView* view = new UIView(); - group->Add(view); - EXPECT_EQ(view, group->GetChildrenHead()); - EXPECT_EQ(view->GetParent(), group); - delete view; - delete group; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEWGROUP_INSERT_0200 - * @tc.name test UIview-group insert api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewGroupTest, Graphic_UIViewGroup_Test_Insert_0200, Function | MediumTest | Level0) -{ - UIViewGroup* group = new UIViewGroup(); - UIView* preView = new UIView(); - UIView* view = new UIView(); - group->Add(preView); - group->Insert(preView, view); - EXPECT_EQ(view, preView->GetNextSibling()); - - delete preView; - delete view; - delete group; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEWGROUP_REMOVE_0300 - * @tc.name test UIview-group remove api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewGroupTest, Graphic_UIViewGroup_Test_Remove_0300, Function | MediumTest | Level0) -{ - UIViewGroup* group = new UIViewGroup(); - UIView* view = new UIView(); - group->Add(view); - group->Remove(view); - EXPECT_EQ(nullptr, group->GetChildrenHead()); - EXPECT_EQ(nullptr, view->GetParent()); - delete view; - delete group; -} - - -/** - * @tc.number SUB_GRAPHIC_UIVIEWGROUP_REMOVEALL_0400 - * @tc.name test UIview-group removeall api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewGroupTest, Graphic_UIViewGroup_Test_RemoveAll_0400, Function | MediumTest | Level0) -{ - UIViewGroup* group = new UIViewGroup(); - UIView* view = new UIView(); - UIView* view2 = new UIView(); - group->Add(view); - group->RemoveAll(); - EXPECT_EQ(nullptr, group->GetChildrenHead()); - delete view; - delete view2; - delete group; -} - - -/** - * @tc.number SUB_GRAPHIC_UIVIEWGROUP_GETVIEWTYPE_0500 - * @tc.name test UIview-group get-view-type api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewGroupTest, Graphic_UIViewGroup_Test_GetViewType_0500, Function | MediumTest | Level0) -{ - UIViewGroup* group = new UIViewGroup(); - EXPECT_EQ(group->GetViewType(), UI_VIEW_GROUP); - delete group; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEWGROUP_GETCHILDRENTAIL_0600 - * @tc.name test UIview-group get-children-tail api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewGroupTest, Graphic_UIViewGroup_Test_GetChildrenTail_0600, Function | MediumTest | Level0) -{ - UIViewGroup* group = new UIViewGroup(); - UIView* childrenTail = group->GetChildrenTail(); - EXPECT_EQ(0, 0); - delete childrenTail; - delete group; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEWGROUP_SetDisallowIntercept_0700 - * @tc.name test UIview-group set-disallow-intercept api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewGroupTest, Graphic_UIViewGroup_Test_SetDisallowIntercept_0700, Function | MediumTest | Level0) -{ - UIViewGroup* group = new UIViewGroup(); - bool flag = false; - group->SetDisallowIntercept(flag); - EXPECT_EQ(0, 0); - delete group; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEWGROUP_SetAutoSize_0800 - * @tc.name test UIview-group set-auto-size api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewGroupTest, Graphic_UIViewGroup_Test_SetAutoSize_0800, Function | MediumTest | Level0) -{ - UIViewGroup* group = new UIViewGroup(); - bool state = false; - group->SetDisallowIntercept(state); - EXPECT_EQ(0, 0); - delete group; -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/ui_view_posix/BUILD.gn b/graphic_lite/ui/ui_view_posix/BUILD.gn deleted file mode 100755 index e0cd78b36..000000000 --- a/graphic_lite/ui/ui_view_posix/BUILD.gn +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUIViewTest") { - suite_name = "acts" - sources = [ - "src/test_ui_view.cpp", - "src/ui_view_test.cpp", - ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/ui_view_posix/Test.json b/graphic_lite/ui/ui_view_posix/Test.json deleted file mode 100644 index 069b2cc5c..000000000 --- a/graphic_lite/ui/ui_view_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUIViewTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/ui_view_posix/src/test_ui_view.cpp b/graphic_lite/ui/ui_view_posix/src/test_ui_view.cpp deleted file mode 100755 index b2124c56f..000000000 --- a/graphic_lite/ui/ui_view_posix/src/test_ui_view.cpp +++ /dev/null @@ -1,510 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "components/ui_view_group.h" - -#include -#include - -using namespace std; -using namespace testing::ext; - -namespace OHOS { -class UIViewTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} - virtual void SetUp() {} - virtual void TearDown() {} -}; - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_GETRECT_0100 - * @tc.name test ui_view GetRect api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test__GetRect_0100, Function | MediumTest | Level0) -{ - UIView* view = new UIView(); - view->GetRect(); - EXPECT_EQ(view->GetRect().GetX(), 0); - delete view; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_GetVisibleRect_0200 - * @tc.name test UIview GetVisibleRect api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_GetVisibleRect_0200, Function | MediumTest | Level0) -{ - UIView* view = new UIView(); - view->SetVisible(true); - view->Resize(100, 100); - EXPECT_EQ(view->GetVisibleRect().GetHeight(), 100); - delete view; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_GETMASKEDRECT_0300 - * @tc.name test UIview GetMaskedRect api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_GetMaskedRect_0300, Function | MediumTest | Level0) -{ - UIView* view = new UIView(); - view->Resize(50, 50); - EXPECT_EQ(view->GetMaskedRect().GetHeight(), 50); - delete view; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_GETORIGRECT_0400 - * @tc.name test UIview GetOrigRect api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_GetOrigRect_0400, Function | MediumTest | Level0) -{ - UIView* view = new UIView(); - view->Resize(50, 50); - EXPECT_EQ(view->GetOrigRect().GetHeight(), 50); - delete view; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_GETCONTENTRECT_0500 - * @tc.name test UIview GetContentRect api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_GetContentRect_0500, Function | MediumTest | Level0) -{ - UIView* view = new UIView(); - view->Resize(50, 50); - EXPECT_EQ(view->GetContentRect().GetHeight(), 50); - delete view; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_GETRELATIVERECT_0600 - * @tc.name test UIview GetRelativeRect api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_GetRelativeRect_0600, Function | MediumTest | Level0) -{ - UIView* view = new UIView(); - view->SetPosition(100, 50, 10, 10); - EXPECT_EQ(view->GetRelativeRect().GetX(), 100); - delete view; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_SETINTERCEPT_0700 - * @tc.name test UIview set-intercept api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_SetIntercept_0700, Function | MediumTest | Level0) -{ - UIView* view = new UIView(); - view->SetIntercept(true); - EXPECT_EQ(0, 0); - delete view; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_ISVIEWGROUP_0800 - * @tc.name test UIview IsViewGroup api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_IsViewGroup_0800, Function | MediumTest | Level0) -{ - UIView* view = new UIView(); - EXPECT_EQ(view->IsViewGroup(), false); - delete view; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_GetChildById_0900 - * @tc.name test UIview GetChildById api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_GetChildById_0900, Function | MediumTest | Level0) -{ - UIView* view = new UIView(); - UIViewGroup* group = new UIViewGroup(); - view->SetViewId("hello world!"); - view->Resize(100, 100); - group->Add(view); - UIView* viewChild = group->GetChildById("hello world!"); - int16_t height = 0; - if (viewChild != NULL) { - height = viewChild->GetHeight(); - } - EXPECT_EQ(height, 100); - delete group; - delete view; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_LAYOUTCENTEROFPARENT_1000 - * @tc.name test UIview LayoutCenterOfParent api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_LayoutCenterOfParent_1000, Function | MediumTest | Level0) -{ - UIView* view = new UIView(); - view->LayoutCenterOfParent(); - EXPECT_EQ(0, 0); - delete view; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_LAYOUTCHILDREN_1100 - * @tc.name test UIview LayoutChildren api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_LayoutChildren_1100, Function | MediumTest | Level0) -{ - UIView* view = new UIView(); - view->LayoutChildren(true); - EXPECT_EQ(0, 0); - delete view; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_LAYOUTLEFTOFPARENT_1200 - * @tc.name test UIview LayoutLeftOfParent api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_LayoutLeftOfParent_1200, Function | MediumTest | Level0) -{ - UIView* view = new UIView(); - view->LayoutLeftOfParent(); - EXPECT_EQ(0, 0); - delete view; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_LAYOUTRIGHTOFPARENT_1300 - * @tc.name test UIview LayoutRightOfParent api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_LayoutRightOfParent_1300, Function | MediumTest | Level0) -{ - UIView* view = new UIView(); - view->LayoutRightOfParent(); - EXPECT_EQ(0, 0); - delete view; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_LAYOUTTOPOFPARENT_1400 - * @tc.name test UIview LayoutTopOfParent api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_LayoutTopOfParent_1400, Function | MediumTest | Level0) -{ - UIView* view = new UIView(); - view->LayoutTopOfParent(); - EXPECT_EQ(0, 0); - delete view; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_LayoutBottomOfParent_1500 - * @tc.name test UIview LayoutBottomOfParent api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_LayoutBottomOfParent_1500, Function | MediumTest | Level0) -{ - UIView* view = new UIView(); - view->LayoutBottomOfParent(); - EXPECT_EQ(0, 0); - delete view; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_ALIGNLEFTTOSIBLING_1600 - * @tc.name test UIview AlignLeftToSibling api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_AlignLeftToSibling_1600, Function | MediumTest | Level0) -{ - UIViewGroup* display = new UIViewGroup(); - UIView* refTarget = new UIView(); - UIView* view = new UIView(); - UIViewGroup* testTarget = new UIViewGroup(); - - display->Add(refTarget); - refTarget->Resize(20, 20); - refTarget->SetViewId("refView"); - testTarget->AlignLeftToSibling("refView"); - - EXPECT_EQ(0, 0); - delete testTarget; - delete view; - delete refTarget; - delete display; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_ALIGNRIGHTTOSIBLING_1700 - * @tc.name test UIview AlignRightToSibling api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_AlignRightToSibling_1700, Function | MediumTest | Level0) -{ - UIViewGroup* display = new UIViewGroup(); - UIView* refTarget = new UIView(); - UIView* view = new UIView(); - UIViewGroup* testTarget = new UIViewGroup(); - - display->Add(refTarget); - refTarget->Resize(20, 20); - refTarget->SetViewId("refView"); - testTarget->AlignRightToSibling("refView"); - - EXPECT_EQ(0, 0); - delete testTarget; - delete view; - delete refTarget; - delete display; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_ALIGNTOPTOSIBLING_1800 - * @tc.name test UIview AlignTopToSibling api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_AlignTopToSibling_1800, Function | MediumTest | Level0) -{ - UIViewGroup* display = new UIViewGroup(); - UIView* refTarget = new UIView(); - UIView* view = new UIView(); - UIViewGroup* testTarget = new UIViewGroup(); - - display->Add(refTarget); - refTarget->Resize(20, 20); - refTarget->SetViewId("refView"); - testTarget->AlignTopToSibling("refView"); - - EXPECT_EQ(0, 0); - delete testTarget; - delete view; - delete refTarget; - delete display; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_ALIGNBOTTOMTOSIBLING_1900 - * @tc.name test UIview AlignBottomToSibling api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_AlignBottomToSibling_1900, Function | MediumTest | Level0) -{ - UIViewGroup* display = new UIViewGroup(); - UIView* refTarget = new UIView(); - UIView* view = new UIView(); - UIViewGroup* testTarget = new UIViewGroup(); - - display->Add(refTarget); - refTarget->Resize(20, 20); - refTarget->SetViewId("refView"); - testTarget->AlignBottomToSibling("refView"); - - EXPECT_EQ(0, 0); - delete testTarget; - delete view; - delete refTarget; - delete display; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_AlignHorCenterToSibling_2000 - * @tc.name test UIview AlignHorCenterToSibling api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_AlignHorCenterToSibling_2000, Function | MediumTest | Level0) -{ - UIViewGroup* display = new UIViewGroup(); - UIView* refTarget = new UIView(); - UIView* view = new UIView(); - UIViewGroup* testTarget = new UIViewGroup(); - - display->Add(refTarget); - refTarget->Resize(20, 20); - refTarget->SetViewId("refView"); - testTarget->AlignHorCenterToSibling("refView"); - - EXPECT_EQ(0, 0); - delete testTarget; - delete view; - delete refTarget; - delete display; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_LAYOUTLEFTTOSIBLING_2100 - * @tc.name test UIview LayoutLeftToSibling api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_LayoutLeftToSibling_2100, Function | MediumTest | Level0) -{ - UIViewGroup* display = new UIViewGroup(); - UIView* refTarget = new UIView(); - UIView* view = new UIView(); - UIViewGroup* testTarget = new UIViewGroup(); - - display->Add(refTarget); - refTarget->Resize(20, 20); - refTarget->SetViewId("refView"); - testTarget->LayoutLeftToSibling("refView"); - - EXPECT_EQ(0, 0); - delete testTarget; - delete view; - delete refTarget; - delete display; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_LAYOUTRIGHTTOSIBLING_2200 - * @tc.name test UIview LayoutRightToSibling api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_LayoutRightToSibling_2200, Function | MediumTest | Level0) -{ - UIViewGroup* display = new UIViewGroup(); - UIView* refTarget = new UIView(); - UIView* view = new UIView(); - UIViewGroup* testTarget = new UIViewGroup(); - - display->Add(refTarget); - refTarget->Resize(20, 20); - refTarget->SetViewId("refView"); - testTarget->LayoutRightToSibling("refView"); - - EXPECT_EQ(0, 0); - delete testTarget; - delete view; - delete refTarget; - delete display; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_LAYOUTTOPTOSIBLING_2300 - * @tc.name test UIview LayoutTopToSibling api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_LayoutTopToSibling_2300, Function | MediumTest | Level0) -{ - UIViewGroup* display = new UIViewGroup(); - UIView* refTarget = new UIView(); - UIView* view = new UIView(); - UIViewGroup* testTarget = new UIViewGroup(); - - display->Add(refTarget); - refTarget->Resize(20, 20); - refTarget->SetViewId("refView"); - testTarget->LayoutTopToSibling("refView"); - - EXPECT_EQ(0, 0); - delete testTarget; - delete view; - delete refTarget; - delete display; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_LAYOUTBOTTOMTOSIBLING_2400 - * @tc.name test UIview LayoutBottomToSibling api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_LayoutBottomToSibling_2400, Function | MediumTest | Level0) -{ - UIViewGroup* display = new UIViewGroup(); - UIView* refTarget = new UIView(); - UIView* view = new UIView(); - UIViewGroup* testTarget = new UIViewGroup(); - - display->Add(refTarget); - refTarget->Resize(20, 20); - refTarget->SetViewId("refView"); - testTarget->LayoutBottomToSibling("refView"); - - EXPECT_EQ(0, 0); - delete testTarget; - delete view; - delete refTarget; - delete display; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_GETSTYLECONST_2500 - * @tc.name test UIview get-style-const api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_GetStyleConst_2500, Function | MediumTest | Level0) -{ - UIView* view = new UIView(); - view->SetStyle(STYLE_BACKGROUND_OPA, 255); - EXPECT_EQ(view->GetStyleConst().GetStyle(STYLE_BACKGROUND_OPA), 255); - delete view; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_REMEASURE_2600 - * @tc.name test UIview ReMeasure api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_ReMeasure_2600, Function | MediumTest | Level0) -{ - UIView* view = new UIView(); - - view->ReMeasure(); - EXPECT_EQ(0, 0); - delete view; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_INVALIDATE_2700 - * @tc.name test UIview Invalidate api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_Invalidate_2700, Function | MediumTest | Level0) -{ - UIView* view = new UIView(); - - view->Invalidate(); - EXPECT_EQ(0, 0); - delete view; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_GETTARGETVIEW_2800 - * @tc.name test UIview GetTargetView api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_GetTargetView_2800, Function | MediumTest | Level0) -{ - Point pos = {10, 10}; - UIView* view = new UIView(); - view->SetPosition(0, 0, 454, 454); - UIView* view2 = new UIView(); - view->GetTargetView(pos, &view2); - EXPECT_EQ(0, 0); - delete view; - delete view2; -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/ui_view_posix/src/ui_view_test.cpp b/graphic_lite/ui/ui_view_posix/src/ui_view_test.cpp deleted file mode 100755 index e8f0a6977..000000000 --- a/graphic_lite/ui/ui_view_posix/src/ui_view_test.cpp +++ /dev/null @@ -1,325 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "components/ui_view.h" -#include "components/ui_view_group.h" - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class UIViewTest : public testing::Test { -public: - static void SetUpTestCase(void); - static void TearDownTestCase(void); - static UIView* view; -}; -UIView* UIViewTest::view = nullptr; - -void UIViewTest::SetUpTestCase(void) -{ - view = new UIView(); - if (view == nullptr) { - printf("Failed to apply for memory.\n"); - return; - } -} - -void UIViewTest::TearDownTestCase(void) -{ - if (view == nullptr) { - delete view; - view = nullptr; - } -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_SETONDRAGLISTENER_0100 - * @tc.name test UIview set-on-drag-listener api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_SetOnDragListener_0100, Function | MediumTest | Level0) -{ - UIView::OnDragListener* listener = new UIView::OnDragListener(); - view->SetOnDragListener(listener); - EXPECT_EQ(view->GetOnDragListener(), listener); - delete listener; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_SETONCLICKLISTENER_0200 - * @tc.name test UIview set-on-click-listener api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_SetOnClickListener_0200, Function | MediumTest | Level0) -{ - UIView::OnClickListener* listener = new UIView::OnClickListener(); - view->SetOnClickListener(listener); - EXPECT_EQ(view->GetOnClickListener(), listener); - delete listener; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_SETONLONGPRESSLISTENER_0300 - * @tc.name test UIview set-on-long-press-listener api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_SetOnLongPressListener_0300, Function | MediumTest | Level0) -{ - UIView::OnLongPressListener* listener = new UIView::OnLongPressListener(); - view->SetOnLongPressListener(listener); - EXPECT_EQ(view->GetOnLongPressListener(), listener); - delete listener; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_SETONTOUCHLISTENER_0400 - * @tc.name test UIview set-on-touch-listener api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_SetOnTouchListener_0400, Function | MediumTest | Level0) -{ - UIView::OnTouchListener* listener = new UIView::OnTouchListener(); - view->SetOnTouchListener(listener); - EXPECT_EQ(view->GetTouchListener(), listener); - delete listener; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_SETPARENT_0500 - * @tc.name test UIview set-parent api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_SetParent_0500, Function | MediumTest | Level0) -{ - UIViewGroup* viewGroup = new UIViewGroup(); - view->SetParent(viewGroup); - EXPECT_EQ(view->GetParent(), viewGroup); - delete viewGroup; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_SETNEXTSIBLING_0600 - * @tc.name test UIview set-next-sibling api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_SetNextSibling_0600, Function | MediumTest | Level0) -{ - UIView* tempView = new UIView(); - view->SetNextSibling(tempView); - EXPECT_EQ(view->GetNextSibling(), tempView); - delete tempView; -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_SETVISIBLE_0700 - * @tc.name test UIview set-visible api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_SetVisible_0700, Function | MediumTest | Level0) -{ - view->SetVisible(true); - EXPECT_EQ(view->IsVisible(), true); -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_SETTOUCHABLE_0800 - * @tc.name test UIview set-touchable api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_SetTouchable_0800, Function | MediumTest | Level0) -{ - view->SetTouchable(true); - EXPECT_EQ(view->IsTouchable(), true); -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_SETTOUCHABLE_0900 - * @tc.name test UIview set-touchable2 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_SetTouchable_0900, Function | MediumTest | Level0) -{ - view->SetDraggable(true); - EXPECT_EQ(view->IsDraggable(), true); -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_SETDRAGPARENTINSTEAD_1000 - * @tc.name test UIview set-drag-parent-instead api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_SetDragParentInstead_1000, Function | MediumTest | Level0) -{ - view->SetDragParentInstead(true); - EXPECT_EQ(view->IsDragParentInstead(), true); -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_RESIZEVISIBLEAREA_1100 - * @tc.name test UIview resize-visible-area api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_ResizeVisibleArea_1100, Function | MediumTest | Level0) -{ - int16_t x = 10; - int16_t y = 20; - int16_t width = 30; - int16_t height = 60; - view->ResizeVisibleArea(x, y, width, height); - EXPECT_EQ(0, 0); -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_SETWIDTH_1200 - * @tc.name test UIview set-width api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_SetWidth_1200, Function | MediumTest | Level0) -{ - int16_t width = 50; - view->SetWidth(width); - EXPECT_EQ(view->GetWidth(), width); -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_SETHEIGHT_1300 - * @tc.name test UIview set-height api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_SetHeight_1300, Function | MediumTest | Level0) -{ - int16_t height = 30; - view->SetHeight(height); - EXPECT_EQ(view->GetHeight(), height); -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_RESIZE_1400 - * @tc.name test UIview resize api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_Resize_1400, Function | MediumTest | Level0) -{ - int16_t height = 30; - int16_t width = 50; - view->Resize(width, height); - EXPECT_EQ(view->GetHeight(), height); - EXPECT_EQ(view->GetWidth(), width); -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_SETX_1500 - * @tc.name test UIview setX api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_SetX_1500, Function | MediumTest | Level0) -{ - int16_t x = 30; - view->SetX(x); - EXPECT_EQ(view->GetX(), x); -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_SETY_1600 - * @tc.name test UIview setY api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_SetX_1600, Function | MediumTest | Level0) -{ - int16_t y = 30; - view->SetY(y); - EXPECT_EQ(view->GetY(), y); -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_SETPOSITION_1700 - * @tc.name test UIview set-position api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_SetPosition_1700, Function | MediumTest | Level0) -{ - int16_t x = 30; - int16_t y = 60; - view->SetPosition(x, y); - EXPECT_EQ(view->GetX(), x); - EXPECT_EQ(view->GetY(), y); -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_SETPOSITION_1800 - * @tc.name test UIview set-position2 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_SetPosition_1800, Function | MediumTest | Level0) -{ - int16_t x = 30; - int16_t y = 60; - int16_t height = 50; - int16_t width = 100; - view->SetPosition(x, y, width, height); - EXPECT_EQ(view->GetHeight(), height); - EXPECT_EQ(view->GetWidth(), width); - EXPECT_EQ(view->GetX(), x); - EXPECT_EQ(view->GetY(), y); -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_SETVIEWID_1900 - * @tc.name test UIview set-viewID api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_SetViewId_1900, Function | MediumTest | Level0) -{ - const char* id = "graphic_unittest_view"; - view->SetViewId(id); - EXPECT_EQ(memcmp(view->GetViewId(), id, strlen(id)), 0); -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_SETVIEWINDEX_2000 - * @tc.name test UIview set-view-index api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_SetViewIndex_2000, Function | MediumTest | Level0) -{ - int16_t index = 1; - view->SetViewIndex(index); - EXPECT_EQ(view->GetViewIndex(), index); -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_GETVIEWTYPE_2100 - * @tc.name test UIview get-view-type api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_GetViewType_2100, Function | MediumTest | Level0) -{ - EXPECT_EQ(view->GetViewType(), UI_NUMBER_MAX); -} - -/** - * @tc.number SUB_GRAPHIC_UIVIEW_SETOPACALE_2200 - * @tc.name test UIview set-opa-scale api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIViewTest, Graphic_UIView_Test_SetOpaScale_2200, Function | MediumTest | Level0) -{ - uint8_t opaScale = 16; - view->SetOpaScale(opaScale); - EXPECT_EQ(view->GetOpaScale(), opaScale); -} -} // namespace OHOS \ No newline at end of file diff --git a/graphic_lite/ui/uianimator_posix/BUILD.gn b/graphic_lite/ui/uianimator_posix/BUILD.gn deleted file mode 100755 index 00b9839dc..000000000 --- a/graphic_lite/ui/uianimator_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUIAnimatorTest") { - suite_name = "acts" - sources = [ "src/easing_equation_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/uianimator_posix/Test.json b/graphic_lite/ui/uianimator_posix/Test.json deleted file mode 100644 index 1fe0b458c..000000000 --- a/graphic_lite/ui/uianimator_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUIAnimatorTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/uianimator_posix/src/easing_equation_test.cpp b/graphic_lite/ui/uianimator_posix/src/easing_equation_test.cpp deleted file mode 100755 index dd4315456..000000000 --- a/graphic_lite/ui/uianimator_posix/src/easing_equation_test.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "animator/easing_equation.h" - -#include -#include - -using namespace std; -using namespace testing::ext; -namespace OHOS { -class EasingEquationTest : public testing::Test { -public: - static void SetUpTestCase(void) - { - if (easingEquationVar == nullptr) { - easingEquationVar = new EasingEquation(); - } - } - static void TearDownTestCase(void) - { - if (easingEquationVar != nullptr) { - delete easingEquationVar; - easingEquationVar = nullptr; - } - } - static EasingEquation* easingEquationVar; -}; -EasingEquation* EasingEquationTest::easingEquationVar = nullptr; - -/** - * @tc.number SUB_GRAPHIC_EASING_EQUATION_SETBACKOVERSHOOT_0100 - * @tc.name test easing-equation set-backovershoot api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(EasingEquationTest, Graphic_UIEasingEquationTest_Test_SetBackOvershoot_0100, Function | MediumTest | Level0) -{ - double overshoot = 2.8; - easingEquationVar->SetBackOvershoot(overshoot); - EXPECT_EQ(EasingEquation::BackEaseIn(1, 1, 1, 2), 1); -} - -/** - * @tc.number SUB_GRAPHIC_EASING_EQUATION_BACKEASEIN_0200 - * @tc.name test easing-equation back-ease-in api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(EasingEquationTest, Graphic_UIEasingEquationTest_Test_BackEaseIn_0200, Function | MediumTest | Level0) -{ - EXPECT_EQ(EasingEquation::BackEaseIn(1, 1, 1, 2), 1); -} - -/** - * @tc.number SUB_GRAPHIC_EASING_EQUATION_BACKEASEOUT_0300 - * @tc.name test easing-equation back-ease-out api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(EasingEquationTest, Graphic_UIEasingEquationTest_Test_BackEaseOut_0300, Function | MediumTest | Level0) -{ - EXPECT_EQ(EasingEquation::BackEaseOut(1, 1, 1, 2), 1); -} -} \ No newline at end of file diff --git a/graphic_lite/ui/uidfx_posix/BUILD.gn b/graphic_lite/ui/uidfx_posix/BUILD.gn deleted file mode 100755 index 1a40d3f38..000000000 --- a/graphic_lite/ui/uidfx_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUIDfxTest") { - suite_name = "acts" - sources = [ "src/dump_dom_tree_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/uidfx_posix/Test.json b/graphic_lite/ui/uidfx_posix/Test.json deleted file mode 100644 index 950e62565..000000000 --- a/graphic_lite/ui/uidfx_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUIDfxTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/uidfx_posix/src/dump_dom_tree_test.cpp b/graphic_lite/ui/uidfx_posix/src/dump_dom_tree_test.cpp deleted file mode 100755 index dc48acad6..000000000 --- a/graphic_lite/ui/uidfx_posix/src/dump_dom_tree_test.cpp +++ /dev/null @@ -1,604 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include -#include - -#include "dfx/ui_dump_dom_tree.h" - -#include "components/root_view.h" -#include "components/ui_analog_clock.h" -#include "components/ui_arc_label.h" -#include "components/ui_box_progress.h" -#include "components/ui_checkbox.h" -#include "components/ui_circle_progress.h" -#include "components/ui_digital_clock.h" -#include "components/ui_image_view.h" -#include "components/ui_label.h" -#include "components/ui_label_button.h" -#include "components/ui_list.h" -#include "components/ui_picker.h" -#include "components/ui_radio_button.h" -#include "components/ui_scroll_view.h" -#include "components/ui_slider.h" -#include "components/ui_swipe_view.h" -#include "components/ui_time_picker.h" -#include "components/ui_toggle_button.h" -#include "components/ui_view_group.h" -#include "draw/draw_image.h" -#include "draw/draw_utils.h" -#include "gfx_utils/file.h" - -using namespace std; -using namespace testing::ext; - -namespace OHOS { -class UIDumpDomTreeTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; - -/** - * @tc.number SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_0100 - * @tc.name test dumpdomtree dumpdomnode api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIDumpDomTreeTest, SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_0100, Function | MediumTest | Level0) -{ - UILabel* label = new UILabel(); - label->SetViewId("label"); - // 5: y-coordinate, 100: width, 20: height - label->SetPosition(0, 5, 100, 20); - label->SetText("dump"); - RootView::GetInstance()->Add(label); - char* tmpStr = UIDumpDomTree::GetInstance()->DumpDomNode("label"); - const char standard[] = "{\n\t\"name\":\t\"UILabel\",\n\t\"x\":\t0,\n\t\"y\":\t5,\n\t\"width\":\t454,"\ - "\n\t\"height\":\t20,\n\t\"id\":\t\"label\",\n\t\"visiable\":\ttrue,\n\t\"touchable\":\tfalse,"\ - "\n\t\"draggable\":\tfalse,\n\t\"onClickListener\":\tfalse,\n\t\"onDragListener\":\tfalse,"\ - "\n\t\"onLongPressListener\":\tfalse,\n\t\"text\":\t\"dump\"\n}"; - EXPECT_EQ(strcmp(tmpStr, standard), 0); - if (tmpStr != nullptr) { - free(tmpStr); - } - RootView::GetInstance()->RemoveAll(); - delete label; -} - -/** - * @tc.number SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_0200 - * @tc.name test dumpdomtree dumpdomnode api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIDumpDomTreeTest, SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_0200, Function | MediumTest | Level0) -{ - UIArcLabel* arcLabel = new UIArcLabel(); - arcLabel->SetViewId("arc_label"); - // 5: y-coordinate, 100: width, 20: height - arcLabel->SetPosition(0, 5, 100, 20); - arcLabel->SetText("dump"); - RootView::GetInstance()->Add(arcLabel); - char* tmpStr = UIDumpDomTree::GetInstance()->DumpDomNode("arc_label"); - const char standard[] = "{\n\t\"name\":\t\"UIArcLabel\",\n\t\"x\":\t0,\n\t\"y\":\t5,\n\t\"width\":\t454,"\ - "\n\t\"height\":\t20,\n\t\"id\":\t\"arc_label\",\n\t\"visiable\":\ttrue,\n\t\"touchable\":\tfalse,"\ - "\n\t\"draggable\":\tfalse,\n\t\"onClickListener\":\tfalse,\n\t\"onDragListener\":\tfalse,"\ - "\n\t\"onLongPressListener\":\tfalse,\n\t\"text\":\t\"dump\"\n}"; - EXPECT_EQ(strcmp(tmpStr, standard), 0); - if (tmpStr != nullptr) { - free(tmpStr); - } - RootView::GetInstance()->RemoveAll(); - delete arcLabel; -} - -/** - * @tc.number SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_0300 - * @tc.name test dumpdomtree dumpdomnode api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIDumpDomTreeTest, SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_0300, Function | MediumTest | Level0) -{ - UILabelButton* labelButton = new UILabelButton(); - labelButton->SetViewId("label_button"); - // 5: y-coordinate, 100: width, 20: height - labelButton->SetPosition(0, 5, 100, 20); - labelButton->SetText("dump"); - RootView::GetInstance()->Add(labelButton); - char* tmpStr = UIDumpDomTree::GetInstance()->DumpDomNode("label_button"); - const char standard[] = "{\n\t\"name\":\t\"UILabelButton\",\n\t\"x\":\t0,\n\t\"y\":\t5,\n\t\"width\":\t454,"\ - "\n\t\"height\":\t20,\n\t\"id\":\t\"label_button\",\n\t\"visiable\":\ttrue,\n\t\"touchable\":\ttrue,"\ - "\n\t\"draggable\":\tfalse,\n\t\"onClickListener\":\tfalse,\n\t\"onDragListener\":\tfalse,"\ - "\n\t\"onLongPressListener\":\tfalse,\n\t\"text\":\t\"dump\"\n}"; - EXPECT_EQ(strcmp(tmpStr, standard), 0); - if (tmpStr != nullptr) { - free(tmpStr); - } - RootView::GetInstance()->RemoveAll(); - delete labelButton; -} - -/** - * @tc.number SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_0400 - * @tc.name test dumpdomtree dumpdomnode api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIDumpDomTreeTest, SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_0400, Function | MediumTest | Level0) -{ - UICheckBox* checkBox = new UICheckBox(); - checkBox->SetViewId("checkbox"); - // 5: y-coordinate, 100: width, 20: height - checkBox->SetPosition(0, 5, 100, 20); - checkBox->SetState(UICheckBox::SELECTED); - RootView::GetInstance()->Add(checkBox); - char* tmpStr = UIDumpDomTree::GetInstance()->DumpDomNode("checkbox"); - const char standard[] = "{\n\t\"name\":\t\"UICheckBox\",\n\t\"x\":\t0,\n\t\"y\":\t5,\n\t\"width\":\t454,"\ - "\n\t\"height\":\t20,\n\t\"id\":\t\"checkbox\",\n\t\"visiable\":\ttrue,\n\t\"touchable\":\ttrue,"\ - "\n\t\"draggable\":\tfalse,\n\t\"onClickListener\":\tfalse,\n\t\"onDragListener\":\tfalse,"\ - "\n\t\"onLongPressListener\":\tfalse,\n\t\"state\":\t\"SELECTED\"\n}"; - EXPECT_EQ(strcmp(tmpStr, standard), 0); - if (tmpStr != nullptr) { - free(tmpStr); - } - RootView::GetInstance()->RemoveAll(); - delete checkBox; -} - -/** - * @tc.number SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_0500 - * @tc.name test dumpdomtree dumpdomnode api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIDumpDomTreeTest, SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_0500, Function | MediumTest | Level0) -{ - UIRadioButton* radioButton = new UIRadioButton(); - radioButton->SetViewId("radio_button"); - // 5: y-coordinate, 100: width, 20: height - radioButton->SetPosition(0, 5, 100, 20); - radioButton->SetState(UICheckBox::SELECTED); - RootView::GetInstance()->Add(radioButton); - char* tmpStr = UIDumpDomTree::GetInstance()->DumpDomNode("radio_button"); - const char standard[] = "{\n\t\"name\":\t\"UIRadioButton\",\n\t\"x\":\t0,\n\t\"y\":\t5,\n\t\"width\":\t454,"\ - "\n\t\"height\":\t20,\n\t\"id\":\t\"radio_button\",\n\t\"visiable\":\ttrue,\n\t\"touchable\":\ttrue,"\ - "\n\t\"draggable\":\tfalse,\n\t\"onClickListener\":\tfalse,\n\t\"onDragListener\":\tfalse,"\ - "\n\t\"onLongPressListener\":\tfalse,\n\t\"state\":\t\"SELECTED\"\n}"; - EXPECT_EQ(strcmp(tmpStr, standard), 0); - if (tmpStr != nullptr) { - free(tmpStr); - } - RootView::GetInstance()->RemoveAll(); - delete radioButton; -} - -/** - * @tc.number SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_0600 - * @tc.name test dumpdomtree dumpdomnode api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIDumpDomTreeTest, SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_0600, Function | MediumTest | Level0) -{ - UIToggleButton* toggleButton = new UIToggleButton(); - toggleButton->SetViewId("toggle_button"); - // 5: y-coordinate, 100: width, 20: height - toggleButton->SetPosition(0, 5, 100, 20); - toggleButton->SetState(false); - RootView::GetInstance()->Add(toggleButton); - char* tmpStr = UIDumpDomTree::GetInstance()->DumpDomNode("toggle_button"); - const char standard[] = "{\n\t\"name\":\t\"UIToggleButton\",\n\t\"x\":\t0,\n\t\"y\":\t5,\n\t\"width\":\t454,"\ - "\n\t\"height\":\t20,\n\t\"id\":\t\"toggle_button\",\n\t\"visiable\":\ttrue,\n\t\"touchable\":\ttrue,"\ - "\n\t\"draggable\":\tfalse,\n\t\"onClickListener\":\tfalse,\n\t\"onDragListener\":\tfalse,"\ - "\n\t\"onLongPressListener\":\tfalse,\n\t\"state\":\tfalse\n}"; - EXPECT_EQ(strcmp(tmpStr, standard), 0); - if (tmpStr != nullptr) { - free(tmpStr); - } - RootView::GetInstance()->RemoveAll(); - delete toggleButton; -} - -/** - * @tc.number SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_0700 - * @tc.name test dumpdomtree dumpdomnode api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIDumpDomTreeTest, SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_0700, Function | MediumTest | Level0) -{ - UIImageView* imageView = new UIImageView(); - imageView->SetViewId("image"); - imageView->SetSrc("..\\config\\images\\A020_046_rgb888.bin"); - // 5: y-coordinate, 100: width, 100: height - imageView->SetPosition(0, 5, 100, 100); - RootView::GetInstance()->Add(imageView); - char* tmpStr = UIDumpDomTree::GetInstance()->DumpDomNode("image"); - const char standard[] = "{\n\t\"name\":\t\"UIImageView\",\n\t\"x\":\t0,\n\t\"y\":\t5,\n\t\"width\":\t100,"\ - "\n\t\"height\":\t100,\n\t\"id\":\t\"image\",\n\t\"visiable\":\ttrue,\n\t\"touchable\":\tfalse,"\ - "\n\t\"draggable\":\tfalse,\n\t\"onClickListener\":\tfalse,\n\t\"onDragListener\":\tfalse,"\ - "\n\t\"onLongPressListener\":\tfalse,\n\t\"src\":\t\"..\\\\config\\\\images\\\\A020_046_rgb888.bin\"\n}"; - EXPECT_EQ(strcmp(tmpStr, standard), 0); - if (tmpStr != nullptr) { - free(tmpStr); - } - RootView::GetInstance()->RemoveAll(); - delete imageView; -} - -/** - * @tc.number SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_0800 - * @tc.name test dumpdomtree dumpdomnode api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIDumpDomTreeTest, SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_0800, Function | MediumTest | Level0) -{ - UIImageView* imageView = new UIImageView(); - imageView->SetViewId("image"); - ImageInfo* imageInfo = new ImageInfo(); - uint32_t a = 32; - imageInfo->userData = reinterpret_cast(&a); - imageView->SetSrc(static_cast(imageInfo)); - // 5: y-coordinate, 100: width, 100: height - imageView->SetPosition(0, 5, 100, 100); - RootView::GetInstance()->Add(imageView); - char* tmpStr = UIDumpDomTree::GetInstance()->DumpDomNode("image"); - const char standard[] = "{\n\t\"name\":\t\"UIImageView\",\n\t\"x\":\t0,\n\t\"y\":\t5,\n\t\"width\":\t100,"\ - "\n\t\"height\":\t100,\n\t\"id\":\t\"image\",\n\t\"visiable\":\ttrue,\n\t\"touchable\":\tfalse,"\ - "\n\t\"draggable\":\tfalse,\n\t\"onClickListener\":\tfalse,\n\t\"onDragListener\":\tfalse,"\ - "\n\t\"onLongPressListener\":\tfalse,\n\t\"src\":\t32\n}"; - EXPECT_EQ(strcmp(tmpStr, standard), 0); - if (tmpStr != nullptr) { - free(tmpStr); - } - RootView::GetInstance()->RemoveAll(); - delete imageInfo; - delete imageView; -} - -/** - * @tc.number SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_0900 - * @tc.name test dumpdomtree dumpdomnode api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIDumpDomTreeTest, SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_0900, Function | MediumTest | Level0) -{ - UIBoxProgress* boxProgress = new UIBoxProgress(); - boxProgress->SetViewId("box_progress"); - // 5: y-coordinate, 100: width, 20: height - boxProgress->SetPosition(0, 5, 100, 20); - boxProgress->SetRange(100, 0); // 100: max range - boxProgress->SetValue(20); // 20: value - RootView::GetInstance()->Add(boxProgress); - char* tmpStr = UIDumpDomTree::GetInstance()->DumpDomNode("box_progress"); - const char standard[] = "{\n\t\"name\":\t\"UIBoxProgress\",\n\t\"x\":\t0,\n\t\"y\":\t5,\n\t\"width\":\t454,"\ - "\n\t\"height\":\t20,\n\t\"id\":\t\"box_progress\",\n\t\"visiable\":\ttrue,\n\t\"touchable\":\tfalse,"\ - "\n\t\"draggable\":\tfalse,\n\t\"onClickListener\":\tfalse,\n\t\"onDragListener\":\tfalse,"\ - "\n\t\"onLongPressListener\":\tfalse,\n\t\"currValue\":\t20,\n\t\"rangeMin\":\t0,\n\t\"rangeMax\":\t100\n}"; - EXPECT_EQ(strcmp(tmpStr, standard), 0); - if (tmpStr != nullptr) { - free(tmpStr); - } - RootView::GetInstance()->RemoveAll(); - delete boxProgress; -} - -/** - * @tc.number SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_1000 - * @tc.name test dumpdomtree dumpdomnode api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIDumpDomTreeTest, SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_1000, Function | MediumTest | Level0) -{ - UISlider* slider = new UISlider(); - slider->SetViewId("slider"); - // 5: y-coordinate, 100: width, 20: height - slider->SetPosition(0, 5, 100, 20); - slider->SetRange(100, 0); // 100: max range - slider->SetValue(20); // 20: value - RootView::GetInstance()->Add(slider); - char* tmpStr = UIDumpDomTree::GetInstance()->DumpDomNode("slider"); - const char standard[] = "{\n\t\"name\":\t\"UISlider\",\n\t\"x\":\t0,\n\t\"y\":\t5,\n\t\"width\":\t454,"\ - "\n\t\"height\":\t20,\n\t\"id\":\t\"slider\",\n\t\"visiable\":\ttrue,\n\t\"touchable\":\ttrue,"\ - "\n\t\"draggable\":\ttrue,\n\t\"onClickListener\":\tfalse,\n\t\"onDragListener\":\tfalse,"\ - "\n\t\"onLongPressListener\":\tfalse,\n\t\"currValue\":\t20,\n\t\"rangeMin\":\t0,\n\t\"rangeMax\":\t100\n}"; - EXPECT_EQ(strcmp(tmpStr, standard), 0); - if (tmpStr != nullptr) { - free(tmpStr); - } - RootView::GetInstance()->RemoveAll(); - delete slider; -} - -/** - * @tc.number SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_1100 - * @tc.name test dumpdomtree dumpdomnode api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIDumpDomTreeTest, SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_1100, Function | MediumTest | Level0) -{ - UICircleProgress* circleProgress = new UICircleProgress(); - circleProgress->SetViewId("circle_progress"); - // 5: y-coordinate, 100: width, 20: height - circleProgress->SetPosition(0, 5, 100, 20); - circleProgress->SetRange(100, 0); // 100: max range - circleProgress->SetValue(20); // 20: value - RootView::GetInstance()->Add(circleProgress); - char* tmpStr = UIDumpDomTree::GetInstance()->DumpDomNode("circle_progress"); - const char standard[] = "{\n\t\"name\":\t\"UICircleProgress\",\n\t\"x\":\t0,\n\t\"y\":\t5,"\ - "\n\t\"width\":\t454,\n\t\"height\":\t20,\n\t\"id\":\t\"circle_progress\",\n\t\"visiable\":\ttrue,"\ - "\n\t\"touchable\":\tfalse,\n\t\"draggable\":\tfalse,\n\t\"onClickListener\":\tfalse,"\ - "\n\t\"onDragListener\":\tfalse,\n\t\"onLongPressListener\":\tfalse,\n\t\"currValue\":\t20,"\ - "\n\t\"rangeMin\":\t0,\n\t\"rangeMax\":\t100\n}"; - EXPECT_EQ(strcmp(tmpStr, standard), 0); - if (tmpStr != nullptr) { - free(tmpStr); - } - RootView::GetInstance()->RemoveAll(); - delete circleProgress; -} - -/** - * @tc.number SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_1200 - * @tc.name test dumpdomtree dumpdomnode api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIDumpDomTreeTest, SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_1200, Function | MediumTest | Level0) -{ - UIScrollView* scrollView = new UIScrollView(); - scrollView->SetViewId("scroll_view"); - // 5: y-coordinate, 100: width, 20: height - scrollView->SetPosition(0, 5, 100, 20); - scrollView->SetHorizontalScrollState(false); - scrollView->SetVerticalScrollState(true); - RootView::GetInstance()->Add(scrollView); - char* tmpStr = UIDumpDomTree::GetInstance()->DumpDomNode("scroll_view"); - const char standard[] = "{\n\t\"name\":\t\"UIScrollView\",\n\t\"x\":\t0,\n\t\"y\":\t5,\n\t\"width\":\t454,"\ - "\n\t\"height\":\t20,\n\t\"id\":\t\"scroll_view\",\n\t\"visiable\":\ttrue,\n\t\"touchable\":\ttrue,"\ - "\n\t\"draggable\":\ttrue,\n\t\"onClickListener\":\tfalse,\n\t\"onDragListener\":\tfalse,"\ - "\n\t\"onLongPressListener\":\tfalse,\n\t\"xScrollable\":\tfalse,\n\t\"yScrollable\":\ttrue\n}"; - EXPECT_EQ(strcmp(tmpStr, standard), 0); - if (tmpStr != nullptr) { - free(tmpStr); - } - RootView::GetInstance()->RemoveAll(); - delete scrollView; -} - -/** - * @tc.number SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_1300 - * @tc.name test dumpdomtree dumpdomnode api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIDumpDomTreeTest, SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_1300, Function | MediumTest | Level0) -{ - UIList* list = new UIList(); - list->SetViewId("list"); - // 5: y-coordinate, 100: width, 20: height - list->SetPosition(0, 5, 100, 20); - list->SetLoopState(true); - RootView::GetInstance()->Add(list); - char* tmpStr = UIDumpDomTree::GetInstance()->DumpDomNode("list"); - const char standard[] = "{\n\t\"name\":\t\"UIList\",\n\t\"x\":\t0,\n\t\"y\":\t5,\n\t\"width\":\t454,"\ - "\n\t\"height\":\t20,\n\t\"id\":\t\"list\",\n\t\"visiable\":\ttrue,\n\t\"touchable\":\ttrue,"\ - "\n\t\"draggable\":\ttrue,\n\t\"onClickListener\":\tfalse,\n\t\"onDragListener\":\tfalse,"\ - "\n\t\"onLongPressListener\":\tfalse,\n\t\"isLoopList\":\ttrue\n}"; - EXPECT_EQ(strcmp(tmpStr, standard), 0); - if (tmpStr != nullptr) { - free(tmpStr); - } - RootView::GetInstance()->RemoveAll(); - delete list; -} - -/** - * @tc.number SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_1400 - * @tc.name test dumpdomtree dumpdomnode api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIDumpDomTreeTest, SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_1400, Function | MediumTest | Level0) -{ - UIDigitalClock* digitalClock = new UIDigitalClock(); - digitalClock->SetViewId("digital_clock"); - // 5: y-coordinate, 100: width, 20: height - digitalClock->SetPosition(0, 5, 100, 20); - // 14: hour, 30: minute, 30: second - digitalClock->SetTime24Hour(14, 30, 30); - RootView::GetInstance()->Add(digitalClock); - char* tmpStr = UIDumpDomTree::GetInstance()->DumpDomNode("digital_clock"); - const char standard[] = "{\n\t\"name\":\t\"UIDigitalClock\",\n\t\"x\":\t0,\n\t\"y\":\t5,\n\t\"width\":\t454,"\ - "\n\t\"height\":\t20,\n\t\"id\":\t\"digital_clock\",\n\t\"visiable\":\ttrue,\n\t\"touchable\":\tfalse,"\ - "\n\t\"draggable\":\tfalse,\n\t\"onClickListener\":\tfalse,\n\t\"onDragListener\":\tfalse,"\ - "\n\t\"onLongPressListener\":\tfalse,\n\t\"currentHour\":\t14,\n\t\"currentMinute\":\t30,"\ - "\n\t\"currentSecond\":\t30\n}"; - EXPECT_EQ(strcmp(tmpStr, standard), 0); - if (tmpStr != nullptr) { - free(tmpStr); - } - RootView::GetInstance()->RemoveAll(); - delete digitalClock; -} - -/** - * @tc.number SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_1500 - * @tc.name test dumpdomtree dumpdomnode api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIDumpDomTreeTest, SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_1500, Function | MediumTest | Level0) -{ - UIAnalogClock* analogClock = new UIAnalogClock(); - analogClock->SetViewId("analog_clock"); - // 5: y Indicates, 100: width, 20: height - analogClock->SetPosition(0, 5, 100, 20); - // 14: hour, 30: minute, 30: second - analogClock->SetTime24Hour(14, 30, 30); - RootView::GetInstance()->Add(analogClock); - char* tmpStr = UIDumpDomTree::GetInstance()->DumpDomNode("analog_clock"); - const char standard[] = "{\n\t\"name\":\t\"UIAnalogClock\",\n\t\"x\":\t0,\n\t\"y\":\t5,\n\t\"width\":\t454,"\ - "\n\t\"height\":\t20,\n\t\"id\":\t\"analog_clock\",\n\t\"visiable\":\ttrue,\n\t\"touchable\":\ttrue,"\ - "\n\t\"draggable\":\tfalse,\n\t\"onClickListener\":\tfalse,\n\t\"onDragListener\":\tfalse,"\ - "\n\t\"onLongPressListener\":\tfalse,\n\t\"currentHour\":\t14,\n\t\"currentMinute\":\t30,"\ - "\n\t\"currentSecond\":\t30\n}"; - EXPECT_EQ(strcmp(tmpStr, standard), 0); - if (tmpStr != nullptr) { - free(tmpStr); - } - RootView::GetInstance()->RemoveAll(); - delete analogClock; -} - -/** - * @tc.number SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_1600 - * @tc.name test dumpdomtree dumpdomnode api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIDumpDomTreeTest, SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_1600, Function | MediumTest | Level0) -{ - UIPicker* picker = new UIPicker(); - picker->SetViewId("picker"); - // 5: y Indicates, 100: width, 20: height - picker->SetPosition(0, 5, 100, 20); - picker->SetItemHeight(10); // 10: height of item - picker->SetValues(1, 100); // 1: start integer, 100: end integer - picker->SetSelected(30); // 30: index - RootView::GetInstance()->Add(picker); - char* tmpStr = UIDumpDomTree::GetInstance()->DumpDomNode("picker"); - const char standard[] = "{\n\t\"name\":\t\"UIPicker\",\n\t\"x\":\t0,\n\t\"y\":\t5,\n\t\"width\":\t454,"\ - "\n\t\"height\":\t20,\n\t\"id\":\t\"picker\",\n\t\"visiable\":\ttrue,\n\t\"touchable\":\tfalse,"\ - "\n\t\"draggable\":\tfalse,\n\t\"onClickListener\":\tfalse,\n\t\"onDragListener\":\tfalse,"\ - "\n\t\"onLongPressListener\":\tfalse,\n\t\"selectedIndex\":\t30\n}"; - EXPECT_EQ(strcmp(tmpStr, standard), 0); - if (tmpStr != nullptr) { - free(tmpStr); - } - RootView::GetInstance()->RemoveAll(); - delete picker; -} - -/** - * @tc.number SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_1700 - * @tc.name test dumpdomtree dumpdomnode api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIDumpDomTreeTest, SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_1700, Function | MediumTest | Level0) -{ - UISwipeView* swipeView = new UISwipeView(); - swipeView->SetViewId("swipe_view"); - // 5: y Indicates, 100: width, 20: height - swipeView->SetPosition(0, 5, 100, 20); - UILabel* view1 = new UILabel(); - UILabel* view2 = new UILabel(); - UILabel* view3 = new UILabel(); - swipeView->Add(view1); - swipeView->Add(view2); - swipeView->Add(view3); - swipeView->SetCurrentPage(2, false); // 2: index of a view - swipeView->SetDirection(UISwipeView::VERTICAL); - RootView::GetInstance()->Add(swipeView); - char* tmpStr = UIDumpDomTree::GetInstance()->DumpDomNode("swipe_view"); - const char standard[] = "{\n\t\"name\":\t\"UISwipeView\",\n\t\"x\":\t0,\n\t\"y\":\t5,\n\t\"width\":\t454,"\ - "\n\t\"height\":\t20,\n\t\"id\":\t\"swipe_view\",\n\t\"visiable\":\ttrue,\n\t\"touchable\":\ttrue,"\ - "\n\t\"draggable\":\ttrue,\n\t\"onClickListener\":\tfalse,\n\t\"onDragListener\":\tfalse,"\ - "\n\t\"onLongPressListener\":\tfalse,\n\t\"currentIndex\":\t2,\n\t\"direction\":\t1\n}"; - EXPECT_EQ(strcmp(tmpStr, standard), 0); - if (tmpStr != nullptr) { - free(tmpStr); - } - RootView::GetInstance()->RemoveAll(); - swipeView->RemoveAll(); - delete view1; - delete view2; - delete view3; - delete swipeView; -} - -/** - * @tc.number SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_1800 - * @tc.name test dumpdomtree dumpdomnode api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIDumpDomTreeTest, SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMNODE_1800, Function | MediumTest | Level0) -{ - UITimePicker* timePicker = new UITimePicker(); - timePicker->SetViewId("time_picker"); - // 5: y Indicates, 100: width, 20: height - timePicker->SetPosition(0, 5, 100, 20); - timePicker->EnableSecond(true); - RootView::GetInstance()->Add(timePicker); - char* tmpStr = UIDumpDomTree::GetInstance()->DumpDomNode("time_picker"); - const char standard[] = "{\n\t\"name\":\t\"UITimePicker\",\n\t\"x\":\t0,\n\t\"y\":\t5,\n\t\"width\":\t454,"\ - "\n\t\"height\":\t20,\n\t\"id\":\t\"time_picker\",\n\t\"visiable\":\ttrue,\n\t\"touchable\":\tfalse,"\ - "\n\t\"draggable\":\tfalse,\n\t\"onClickListener\":\tfalse,\n\t\"onDragListener\":\tfalse,"\ - "\n\t\"onLongPressListener\":\tfalse,\n\t\"selectedHour\":\t\"\",\n\t\"selectedMinute\":\t\"\","\ - "\n\t\"selectedSecond\":\t\"\"\n}"; - EXPECT_EQ(strcmp(tmpStr, standard), 0); - if (tmpStr != nullptr) { - free(tmpStr); - } - RootView::GetInstance()->RemoveAll(); - delete timePicker; -} - -/** - * @tc.number SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMTREE_0100 - * @tc.name test dumpdomtree dumpdomtree api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(UIDumpDomTreeTest, SUB_GRAPHIC_DUMPDOMTREE_DUMPDOMTREE_0100, Function | MediumTest | Level0) -{ - UIViewGroup* viewGroup = new UIViewGroup(); - viewGroup->SetViewId("view_group"); - viewGroup->SetPosition(0, 30, 100, 100); // 30: y Indicates, 100: width, 100: height - - UILabel* label = new UILabel(); - viewGroup->Add(label); - label->SetPosition(0, 5, 100, 20); // 5: y Indicates, 100: width, 20: height - label->SetText("label"); - - UICheckBox* checkBox = new UICheckBox(); - checkBox->SetPosition(0, 30, 100, 30); // 30: y Indicates, 100: width, 30: height - checkBox->SetState(UICheckBox::SELECTED); - viewGroup->Add(checkBox); - - UIImageView* imageView = new UIImageView(); - imageView->SetSrc("..\\config\\images\\A020_046_rgb888.bin"); - imageView->SetPosition(0, 100, 100, 100); // 100: y Indicates, 100: width, 100: height - RootView::GetInstance()->Add(viewGroup); - RootView::GetInstance()->Add(imageView); - - EXPECT_EQ(UIDumpDomTree::GetInstance()->DumpDomTree("view_group"), true); - const char standard1[] = "{\r\n\t\"name\":\t\"UIViewGroup\",\r\n\t\"x\":\t0,\r\n\t\"y\":\t30,"\ - "\r\n\t\"width\":\t454,\r\n\t\"height\":\t100,\r\n\t\"id\":\t\"view_group\",\r\n\t\"visiable\":\ttrue,"\ - "\r\n\t\"touchable\":\tfalse,\r\n\t\"draggable\":\tfalse,\r\n\t\"onClickListener\":\tfalse,"\ - "\r\n\t\"onDragListener\":\tfalse,\r\n\t\"onLongPressListener\":\tfalse,\r\n\t\"child\":\t[{"\ - "\r\n\t\t\t\"name\":\t\"UILabel\",\r\n\t\t\t\"x\":\t0,\r\n\t\t\t\"y\":\t35,\r\n\t\t\t\"width\":\t454,"\ - "\r\n\t\t\t\"height\":\t20,\r\n\t\t\t\"visiable\":\ttrue,\r\n\t\t\t\"touchable\":\tfalse,"\ - "\r\n\t\t\t\"draggable\":\tfalse,\r\n\t\t\t\"onClickListener\":\tfalse,"\ - "\r\n\t\t\t\"onDragListener\":\tfalse,\r\n\t\t\t\"onLongPressListener\":\tfalse,"\ - "\r\n\t\t\t\"text\":\t\"label\"\r\n\t\t}, {\r\n\t\t\t\"name\":\t\"UICheckBox\",\r\n\t\t\t\"x\":\t0,"\ - "\r\n\t\t\t\"y\":\t60,\r\n\t\t\t\"width\":\t454,\r\n\t\t\t\"height\":\t30,\r\n\t\t\t\"visiable\":\ttrue,"\ - "\r\n\t\t\t\"touchable\":\ttrue,\r\n\t\t\t\"draggable\":\tfalse,\r\n\t\t\t\"onClickListener\":\tfalse,"\ - "\r\n\t\t\t\"onDragListener\":\tfalse,\r\n\t\t\t\"onLongPressListener\":\tfalse,"\ - "\r\n\t\t\t\"state\":\t\"SELECTED\"\r\n\t\t}]\r\n}"; - - int32_t fd1 = FileOpen(DEFAULT_DUMP_DOM_TREE_PATH, _O_RDONLY | _O_U16TEXT); - if (fd1 > 0) { - char tmp1[825]; - int num1 = FileRead(fd1, tmp1, 824); // 824: count of buffer - tmp1[824] = '\0'; // 824: array index - EXPECT_EQ(strcmp(tmp1, standard1), 0); - EXPECT_EQ(UIDumpDomTree::GetInstance()->DumpDomTree(nullptr), true); - } - RootView::GetInstance()->RemoveAll(); - delete viewGroup; - delete label; - delete checkBox; - delete imageView; -} -} // OHOS \ No newline at end of file diff --git a/graphic_lite/ui/uifont_posix/BUILD.gn b/graphic_lite/ui/uifont_posix/BUILD.gn deleted file mode 100755 index e7349dc03..000000000 --- a/graphic_lite/ui/uifont_posix/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/lite/build/suite_lite.gni") - -hcpptest_suite("ActsUIFontTest") { - suite_name = "acts" - sources = [ "src/font_test.cpp" ] - - include_dirs = [ - "//third_party/bounds_checking_function/include", - "//third_party/cJSON", - "//third_party/libpng", - "//third_party/libjpeg", - "//utils/native/lite/include", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//foundation/distributedschedule/samgr_lite/interfaces/kits/communication/broadcast", - ] - ldflags = [ "-Wl,-Map=toggleButtonTest.map" ] - - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", - "//foundation/distributedschedule/samgr_lite/communication/broadcast", - "//foundation/distributedschedule/samgr_lite/samgr:samgr", - "//foundation/distributedschedule/samgr_lite/samgr_client:client", - "//foundation/graphic/surface:lite_surface", - "//foundation/graphic/ui:lite_ui", - "//foundation/graphic/utils:lite_graphic_hals", - "//foundation/graphic/wms:lite_wms", - "//third_party/bounds_checking_function:libsec_shared", - ] - - cflags = [ "-fno-rtti" ] -} diff --git a/graphic_lite/ui/uifont_posix/Test.json b/graphic_lite/ui/uifont_posix/Test.json deleted file mode 100644 index 3640d1941..000000000 --- a/graphic_lite/ui/uifont_posix/Test.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Config for uikit uibutton test cases", - "environment": [ - { - "type": "device", - "label": "ipcamera" - } - ], - "kits": [ - { - "type": "MountKit", - "server": "NfsServer", - "mount": [ - { - "source": "testcases/graphic", - "target": "/test_root/graphic" - } - ] - } - ], - "driver": { - "type": "CppTestLite", - "execute": "/test_root/graphic/ActsUIFontTest.bin" - } -} \ No newline at end of file diff --git a/graphic_lite/ui/uifont_posix/src/font_test.cpp b/graphic_lite/ui/uifont_posix/src/font_test.cpp deleted file mode 100755 index 2c46305d5..000000000 --- a/graphic_lite/ui/uifont_posix/src/font_test.cpp +++ /dev/null @@ -1,320 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "components/root_view.h" -#include "components/ui_view_group.h" -#include "components/ui_label.h" -#include "font/ui_font.h" -#include "common/ui_text_language.h" - -#include -#include -#include - -using namespace std; -using namespace testing::ext; - -namespace OHOS { -class AbsatrctProgressTest : public testing::Test { -public: - static void SetUpTestCase(void) {} - static void TearDownTestCase(void) {} -}; -/** - * @tc.setup: define a setup for test suit - * @return: true——setup success - */ -bool UIFontTestSetUp() -{ - return true; -} - -/** - * @tc.teardown: define a setup for test suit - * @return: true——teardown success - */ -bool UIFontTestTearDown() -{ - return true; -} - -/** - * @tc.number SUB_GRAPHIC_FONT_SETFONTID_0100 - * @tc.name test font set-fondID api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(AbsatrctProgressTest, SUB_GRAPHIC_FONT_SETFONTID_0100, Function | MediumTest | Level0) -{ - UIFontTestSetUp(); - auto label = std::unique_ptr(new UILabel()); - UIFont::GetInstance()->SetCurrentFontId(UITextLanguageFontId::F_ROBOTOCONDENSED_REGULAR_14_4); - label->SetFontId(UITextLanguageFontId::F_ROBOTOCONDENSED_REGULAR_14_4); - uint8_t fontId = UIFont::GetInstance()->GetCurrentFontId(); - EXPECT_EQ(fontId, 0); // 0: means fontId - UIFontTestTearDown(); - delete label; -} - -/** - * @tc.number SUB_GRAPHIC_FONT_SETFONT_0100 - * @tc.name test font set-fond api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(AbsatrctProgressTest, SUB_GRAPHIC_FONT_SETFONT_0100, Function | MediumTest | Level0) -{ - UIFontTestSetUp(); - auto label = std::unique_ptr(new UILabel()); - uint8_t fontId = UIFont::GetInstance()->GetFontId("RobotoCondensed-Regular"); - UIFont::GetInstance()->SetCurrentFontId(fontId, 18); // 18: means font size - label->SetFont("RobotoCondensed-Regular", 18); // 18: means font size - EXPECT_EQ(fontId, 1); // 1: means fontId - UIFontTestTearDown(); - delete label; -} - -/** - * @tc.number SUB_GRAPHIC_FONT_SETFONTHEIGHT_0100 - * @tc.name test font set-fondheight api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(AbsatrctProgressTest, SUB_GRAPHIC_FONT_SETFONTHEIGHT_0100, Function | MediumTest | Level0) -{ - UIFontTestSetUp(); - auto label = std::unique_ptr(new UILabel()); - label->SetFontId(UITextLanguageFontId::F_HYQIHEI_65S_18_4); - uint16_t height = UIFont::GetInstance()->GetHeight(); - EXPECT_EQ(height, 21); // 21: means font Height - UIFontTestTearDown(); - delete label; -} - -/** - * @tc.number SUB_GRAPHIC_FONT_GETFONTVERSION_0100 - * @tc.name test font get-font-version api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(AbsatrctProgressTest, SUB_GRAPHIC_FONT_GETFONTVERSION_0100, Function | MediumTest | Level0) -{ - UIFontTestSetUp(); - auto label = std::unique_ptr(new UILabel()); - label->SetFontId(UITextLanguageFontId::F_HYQIHEI_65S_14_4); - char dVersion[OHOS::FONT_VERSION_LEN]; - char sVersion[OHOS::FONT_VERSION_LEN]; - UIFont::GetInstance()->GetFontVersion(dVersion, OHOS::FONT_VERSION_LEN, sVersion, - OHOS::FONT_VERSION_LEN); - int ret = strncmp(dVersion, "1.7", OHOS::FONT_VERSION_LEN); // 1.7: means dfont version - EXPECT_EQ(ret, 0); // 0: means equal - ret = strncmp(sVersion, "1.10", OHOS::FONT_VERSION_LEN); // 1.10: means sfont version - EXPECT_EQ(ret, 0); // 0: means equal - UIFontTestTearDown(); - delete label; -} - -/** - * @tc.number SUB_GRAPHIC_FONT_GETFONTID_0100 - * @tc.name test font get-fontID api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(AbsatrctProgressTest, SUB_GRAPHIC_FONT_GETFONTID_0100, Function | MediumTest | Level0) -{ - UIFontTestSetUp(); - auto label = std::unique_ptr(new UILabel()); - label->SetFont("HYQiHei-65S", 18); // 18: means font size - uint8_t fontId = UIFont::GetInstance()->GetFontId("HYQiHei-65S", 18); // 18: means font size - EXPECT_EQ(fontId, 11); // 11: means font Id - UIFontTestTearDown(); - delete label; -} - -/** - * @tc.number SUB_GRAPHIC_FONT_GETFONTWIDTH_0100 - * @tc.name test font get-fontwidth api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(AbsatrctProgressTest, SUB_GRAPHIC_FONT_GETFONTWIDTH_0100, Function | MediumTest | Level0) -{ - UIFontTestSetUp(); - auto label = std::unique_ptr(new UILabel()); - label->SetText(T_RESOURCEID45); - uint16_t width = UIFont::GetInstance()->GetWidth(0x31, 0); // 0x31: letter "1" - EXPECT_EQ(width, 9); // 9: means font width - UIFontTestTearDown(); - delete label; -} - -/** - * @tc.number SUB_GRAPHIC_FONT_GETFONTHEADER_0100 - * @tc.name test font get-fontheader api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(AbsatrctProgressTest, SUB_GRAPHIC_FONT_GETFONTHEADER_0100, Function | MediumTest | Level0) -{ - UIFontTestSetUp(); - auto label = std::unique_ptr(new UILabel()); - label->SetFontId(UITextLanguageFontId::F_HYQIHEI_65S_14_4); - FontHeader fontHeader; - FontHeader expectHeader = {1, 1520, 21, 17, -5, 3552, 3552, 34069, 49699, 0}; - UIFont::GetInstance()->GetCurrentFontHeader(fontHeader); - int ret = memcmp(&fontHeader, &expectHeader, sizeof(FontHeader)); - EXPECT_EQ(ret, 0); // 0: means equal - UIFontTestTearDown(); - delete label; -} - -/** - * @tc.number SUB_GRAPHIC_FONT_GETGLYPHNODE_0100 - * @tc.name test font get-glyphnode api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(AbsatrctProgressTest, SUB_GRAPHIC_FONT_GETGLYPHNODE_0100, Function | MediumTest | Level0) -{ - UIFontTestSetUp(); - auto label = std::unique_ptr(new UILabel()); - label->SetText(T_RESOURCEID45); - label->SetLongMode(UILabel::UI_LABEL_LONG_ROLL); - GlyphNode glyphNode; - UIFont::GetInstance()->GetGlyphNode(0x31, glyphNode); // 0x31: letter "1" - GlyphNode expectNode = {49, 1, 13, 9, 5, 13, 605, 644, 0, 1}; - int ret = memcmp(&glyphNode, &expectNode, sizeof(GlyphNode)); - EXPECT_EQ(ret, 0); // 0: means equal - UIFontTestTearDown(); - delete label; -} - -/** - * @tc.number SUB_GRAPHIC_FONT_GETTEXTPARAM_0100 - * @tc.name test font get-textparam api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(AbsatrctProgressTest, SUB_GRAPHIC_FONT_GETTEXTPARAM_0100, Function | MediumTest | Level0) -{ - UIFontTestSetUp(); - auto label = std::unique_ptr(new UILabel()); - label->SetText(T_RESOURCEID45); - label->SetLongMode(UILabel::UI_LABEL_LONG_ROLL); - UITextLanguageTextParam param; - UIFont::GetInstance()->GetTextParam(T_RESOURCEID45, param); - UITextLanguageTextParam expectParam = {78, 7, TEXT_ALIGNMENT_RIGHT, TEXT_DIRECT_LTR, 1, 0, 607, 0, 607, 0, 607, 0}; - int ret = memcmp(¶m, &expectParam, sizeof(UITextLanguageTextParam)); - EXPECT_EQ(ret, 0); // 0: means equal - UIFontTestTearDown(); - delete label; -} - -/** - * @tc.number SUB_GRAPHIC_FONT_GETTEXTUTF8_0100 - * @tc.name test font get-text-UTF8 api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(AbsatrctProgressTest, SUB_GRAPHIC_FONT_GETTEXTUTF8_0100, Function | MediumTest | Level0) -{ - UIFontTestSetUp(); - auto label = std::unique_ptr(new UILabel()); - label->SetText(T_SCREEN3_CHINA4); - uint8_t *utf8Addr = nullptr; - uint16_t utf8Len; - UIFont::GetInstance()->SetCurrentLangId(LANGUAGE_GB); - UIFont::GetInstance()->GetTextUtf8(T_SCREEN3_CHINA4, &utf8Addr, utf8Len); - int ret = strncmp("VO2max", reinterpret_cast(utf8Addr), utf8Len); - EXPECT_EQ(ret, 0); // 0: means equal - UIFontTestTearDown(); - delete label; -} - -/** - * @tc.number SUB_GRAPHIC_FONT_GETCURLOCALE_0100 - * @tc.name test font get-curlocale api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(AbsatrctProgressTest, SUB_GRAPHIC_FONT_GETCURLOCALE_0100, Function | MediumTest | Level0) -{ - UIFontTestSetUp(); - auto label = std::unique_ptr(new UILabel()); - label->SetText(T_RESOURCEID45); - char *isoAddr = nullptr; - uint8_t isoLen; - UIFont::GetInstance()->GetCurrentLocale(&isoAddr, isoLen); - int ret = strncmp("US,UM", reinterpret_cast(isoAddr), isoLen); - EXPECT_EQ(ret, 0); // 0: means equal - UIFontTestTearDown(); - delete label; -} - -/** - * @tc.number SUB_GRAPHIC_FONT_GETLOCALEBYID_0100 - * @tc.name test font get-locale-by-ID api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(AbsatrctProgressTest, SUB_GRAPHIC_FONT_GETLOCALEBYID_0100, Function | MediumTest | Level0) -{ - UIFontTestSetUp(); - auto label = std::unique_ptr(new UILabel()); - label->SetText(T_RESOURCEID45); - char *isoAddr = nullptr; - uint8_t isoLen; - UIFont::GetInstance()->GetLocaleByLangId(LANGUAGE_FR, &isoAddr, isoLen); - int ret = strncmp("BE,CH,FR,LU,MC", reinterpret_cast(isoAddr), isoLen); - EXPECT_EQ(ret, 0); // 0: means equal - UIFontTestTearDown(); - delete label; -} - -void RunUIFontUnitTest() -{ - Font_FontEngine_FontConvert_Tdd_FontTestSetFontId_001(); - Font_FontEngine_FontConvert_Tdd_FontTestSetFont_001(); - Font_FontEngine_FontConvert_Tdd_FontTestGetFontHeight_001(); - Font_FontEngine_FontConvert_Tdd_FontTestGetFontVersion_001(); - Font_FontEngine_FontConvert_Tdd_FontTestGetFontId_001(); - Font_FontEngine_FontConvert_Tdd_FontTestGetFontWidth_001(); - Font_FontEngine_FontConvert_Tdd_FontTestGetFontHeader_001(); - Font_FontEngine_FontConvert_Tdd_FontTestGetGlyphNode_001(); - Font_FontEngine_FontConvert_Tdd_FontTestGetTextParam_001(); - Font_FontEngine_FontConvert_Tdd_FontTestGetTextUtf8_001(); - Font_FontEngine_FontConvert_Tdd_FontTestGetCurLocale_001(); - Font_FontEngine_FontConvert_Tdd_FontTestGetLocaleById_001(); -} - -/** - * @tc.number SUB_GRAPHIC_FONT_GETCURLOCALE_0100 - * @tc.name test font get-curlocale api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(AbsatrctProgressTest, SUB_GRAPHIC_FONT_GETCURLOCALE_0100, Function | MediumTest | Level0) -{ - UIFontTestSetUp(); - auto label = std::unique_ptr(new UILabel()); - uintptr_t psramAddr = 0; - uint32_t psramLen = 0; - int8_t ret = label->SetPsramMemory(psramAddr, psramLen); - EXPECT_EQ(ret, 0); - delete label; -} - -/** - * @tc.number SUB_GRAPHIC_FONT_GETCURLOCALE_0100 - * @tc.name test font get-curlocale api - * @tc.desc [C- SOFTWARE -0200] - */ -HWTEST_F(AbsatrctProgressTest, Graphic_UIDumpDomTree_Test_DumpDomNode_001, Function | MediumTest | Level0) -{ - UIFontTestSetUp(); - auto label = std::unique_ptr(new UILabel()); - char* dpath = "src/bin"; - char* spath = "src/bin" - int8_t ret = label->SetFontPath(dpath, spath); - EXPECT_EQ(ret, 0); - delete label; -} -} // namespace OHOS \ No newline at end of file -- GitLab