tytest: add test_textgrid_cellrow_get()
to mock evas_object_textgrid_cellrow_get()
This commit is contained in:
parent
904b3cf62e
commit
73f461e281
|
@ -262,6 +262,11 @@ main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
|
||||||
|
|
||||||
eina_init();
|
eina_init();
|
||||||
|
|
||||||
|
#ifdef TYTEST
|
||||||
|
tytest_init();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
_log_domain = eina_log_domain_register(
|
_log_domain = eina_log_domain_register(
|
||||||
#ifdef TYTEST
|
#ifdef TYTEST
|
||||||
"tytest",
|
"tytest",
|
||||||
|
@ -348,6 +353,10 @@ main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
|
||||||
|
|
||||||
_termpty_shutdown(&_ty);
|
_termpty_shutdown(&_ty);
|
||||||
|
|
||||||
|
#ifdef TYTEST
|
||||||
|
tytest_shutdown();
|
||||||
|
#endif
|
||||||
|
|
||||||
eina_shutdown();
|
eina_shutdown();
|
||||||
free(_config);
|
free(_config);
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
#define TYTEST 1
|
#define TYTEST 1
|
||||||
#include "tyfuzz.c"
|
#include "tyfuzz.c"
|
||||||
|
|
||||||
const char *_cursor_shape = "undefined";
|
static const char *_cursor_shape = "undefined";
|
||||||
|
static Evas_Textgrid_Cell *_cells;
|
||||||
|
|
||||||
typedef struct _Termpty_Tests
|
typedef struct _Termpty_Tests
|
||||||
{
|
{
|
||||||
|
@ -151,3 +152,24 @@ _tytest_checksum(Termpty *ty)
|
||||||
md5out[2 * MD5_HASHBYTES] = '\0';
|
md5out[2 * MD5_HASHBYTES] = '\0';
|
||||||
printf("%s", md5out);
|
printf("%s", md5out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Evas_Textgrid_Cell *
|
||||||
|
test_textgrid_cellrow_get(Evas_Object *obj EINA_UNUSED, int y)
|
||||||
|
{
|
||||||
|
assert (y >= 0 && y < TY_H);
|
||||||
|
return &_cells[y * TY_W];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
tytest_init(void)
|
||||||
|
{
|
||||||
|
_cells = calloc(TY_H * TY_W, sizeof(Evas_Textgrid_Cell));
|
||||||
|
assert(_cells != NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
tytest_shutdown(void)
|
||||||
|
{
|
||||||
|
free(_cells);
|
||||||
|
}
|
||||||
|
|
|
@ -11,5 +11,13 @@ test_textgrid_palette_get(const Evas_Object *obj,
|
||||||
int *g,
|
int *g,
|
||||||
int *b,
|
int *b,
|
||||||
int *a);
|
int *a);
|
||||||
|
|
||||||
|
#define evas_object_textgrid_cellrow_get test_textgrid_cellrow_get
|
||||||
|
Evas_Textgrid_Cell *
|
||||||
|
test_textgrid_cellrow_get(Evas_Object *obj, int y);
|
||||||
|
|
||||||
|
void tytest_init(void);
|
||||||
|
void tytest_shutdown(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue