tconfig: add new toml config parser for gfx.toml
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
#if defined(HAVE_CONFIG_H)
|
||||
#include "config_ac.h"
|
||||
#endif
|
||||
|
||||
#include "xrdp_tconfig.h"
|
||||
#include "test_xrdp.h"
|
||||
#include "xrdp.h"
|
||||
|
||||
START_TEST(test_tconfig_gfx_always_success)
|
||||
{
|
||||
ck_assert_int_eq(1, 1);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(test_tconfig_gfx_x264_load_basic)
|
||||
{
|
||||
struct xrdp_tconfig_gfx gfxconfig;
|
||||
int rv = tconfig_load_gfx(XRDP_TOP_SRCDIR "/xrdp/gfx.toml", &gfxconfig);
|
||||
|
||||
ck_assert_int_eq(rv, 0);
|
||||
|
||||
/* default */
|
||||
ck_assert_str_eq(gfxconfig.x264_param[0].preset, "ultrafast");
|
||||
ck_assert_str_eq(gfxconfig.x264_param[0].tune, "zerolatency");
|
||||
ck_assert_str_eq(gfxconfig.x264_param[0].profile, "main");
|
||||
ck_assert_int_eq(gfxconfig.x264_param[0].vbv_max_bitrate, 0);
|
||||
ck_assert_int_eq(gfxconfig.x264_param[0].vbv_buffer_size, 0);
|
||||
ck_assert_int_eq(gfxconfig.x264_param[0].fps_num, 24);
|
||||
ck_assert_int_eq(gfxconfig.x264_param[0].fps_den, 1);
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
/******************************************************************************/
|
||||
Suite *
|
||||
make_suite_tconfig_load_gfx(void)
|
||||
{
|
||||
Suite *s;
|
||||
TCase *tc_tconfig_load_gfx;
|
||||
|
||||
s = suite_create("GfxLoad");
|
||||
|
||||
tc_tconfig_load_gfx = tcase_create("xrdp_tconfig_load_gfx");
|
||||
tcase_add_test(tc_tconfig_load_gfx, test_tconfig_gfx_always_success);
|
||||
tcase_add_test(tc_tconfig_load_gfx, test_tconfig_gfx_x264_load_basic);
|
||||
|
||||
suite_add_tcase(s, tc_tconfig_load_gfx);
|
||||
|
||||
return s;
|
||||
}
|
||||
@@ -7,5 +7,6 @@ Suite *make_suite_test_bitmap_load(void);
|
||||
Suite *make_suite_test_keymap_load(void);
|
||||
Suite *make_suite_egfx_base_functions(void);
|
||||
Suite *make_suite_region(void);
|
||||
Suite *make_suite_tconfig_load_gfx(void);
|
||||
|
||||
#endif /* TEST_XRDP_H */
|
||||
|
||||
@@ -58,6 +58,7 @@ int main (void)
|
||||
srunner_add_suite(sr, make_suite_test_keymap_load());
|
||||
srunner_add_suite(sr, make_suite_egfx_base_functions());
|
||||
srunner_add_suite(sr, make_suite_region());
|
||||
srunner_add_suite(sr, make_suite_tconfig_load_gfx());
|
||||
|
||||
srunner_set_tap(sr, "-");
|
||||
srunner_run_all (sr, CK_ENV);
|
||||
|
||||
Reference in New Issue
Block a user