summaryrefslogtreecommitdiff
path: root/src/tests/elementary/spec/efl_test_gfx_view.c
blob: fc411138b620c1ef34a764e9f7cd5e33f3ce5641 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#endif

#include <Efl_Ui.h>
#include "efl_ui_spec_suite.h"
#include "suite_helpers.h"

/* spec-meta-start
      {"test-interface":"Efl.Gfx.View",
       "test-widgets": ["Efl.Ui.Animation_View"]}
   spec-meta-end */

EFL_START_TEST(view_size)
{
#define TUPLE_CHECK(W, H) \
  do { \
   Eina_Size2D sz; \
   efl_gfx_view_size_set(widget, EINA_SIZE2D(W, H)); \
   sz = efl_gfx_view_size_get(widget); \
   ck_assert(W == sz.w); \
   ck_assert(H == sz.h); \
  } while(0);

  TUPLE_CHECK(100, 100);
  TUPLE_CHECK(100, 200);
  TUPLE_CHECK(200, 100);
  TUPLE_CHECK(800, 700);
  TUPLE_CHECK(10, 50);

#undef TUPLE_CHECK
}
EFL_END_TEST

void
efl_gfx_view_behavior_test(TCase *tc)
{
   tcase_add_test(tc, view_size);
}