Skip to content

Commit

Permalink
tconfig: Fix path to stub gfx.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
metalefty committed Aug 24, 2024
1 parent 90716ff commit 1f79694
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 0 additions & 1 deletion tests/xrdp/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
AM_CPPFLAGS = \
-DXRDP_TOP_SRCDIR=\"$(top_srcdir)\" \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-I$(top_builddir) \
-I$(top_srcdir)/xrdp \
-I$(top_srcdir)/libxrdp \
Expand Down
14 changes: 8 additions & 6 deletions tests/xrdp/test_tconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include "test_xrdp.h"
#include "xrdp.h"

#define GFXCONF_STUBDIR XRDP_TOP_SRCDIR "/tests/xrdp/gfx/"

START_TEST(test_tconfig_gfx_always_success)
{
ck_assert_int_eq(1, 1);
Expand All @@ -15,7 +17,7 @@ END_TEST
START_TEST(test_tconfig_gfx_x264_load_basic)
{
struct xrdp_tconfig_gfx gfxconfig;
int rv = tconfig_load_gfx("./gfx/gfx.toml", &gfxconfig);
int rv = tconfig_load_gfx(GFXCONF_STUBDIR "/gfx.toml", &gfxconfig);

ck_assert_int_eq(rv, 0);

Expand All @@ -36,29 +38,29 @@ START_TEST(test_tconfig_gfx_codec_order)
struct xrdp_tconfig_gfx gfxconfig;

/* H264 earlier */
tconfig_load_gfx("./gfx/gfx_codec_h264_preferred.toml", &gfxconfig);
tconfig_load_gfx(GFXCONF_STUBDIR "/gfx_codec_h264_preferred.toml", &gfxconfig);
ck_assert_int_gt(gfxconfig.codec.h264_idx, -1);
ck_assert_int_gt(gfxconfig.codec.rfx_idx, -1);
ck_assert_int_lt(gfxconfig.codec.h264_idx, gfxconfig.codec.rfx_idx);

/* H264 only */
tconfig_load_gfx("./gfx/gfx_codec_h264_only.toml", &gfxconfig);
tconfig_load_gfx(GFXCONF_STUBDIR "/gfx_codec_h264_only.toml", &gfxconfig);
ck_assert_int_gt(gfxconfig.codec.h264_idx, -1);
ck_assert_int_eq(gfxconfig.codec.rfx_idx, -1);

/* RFX earlier */
tconfig_load_gfx("./gfx/gfx_codec_rfx_preferred.toml", &gfxconfig);
tconfig_load_gfx(GFXCONF_STUBDIR "/gfx_codec_rfx_preferred.toml", &gfxconfig);
ck_assert_int_gt(gfxconfig.codec.h264_idx, -1);
ck_assert_int_gt(gfxconfig.codec.rfx_idx, -1);
ck_assert_int_lt(gfxconfig.codec.rfx_idx, gfxconfig.codec.h264_idx);

/* RFX only */
tconfig_load_gfx("./gfx/gfx_codec_rfx_only.toml", &gfxconfig);
tconfig_load_gfx(GFXCONF_STUBDIR "/gfx_codec_rfx_only.toml", &gfxconfig);
ck_assert_int_eq(gfxconfig.codec.h264_idx, -1);
ck_assert_int_gt(gfxconfig.codec.rfx_idx, -1);

/* RFX is preferred if order undefined */
tconfig_load_gfx("./gfx/gfx_codec_order_undefined.toml", &gfxconfig);
tconfig_load_gfx(GFXCONF_STUBDIR "/gfx_codec_order_undefined.toml", &gfxconfig);
ck_assert_int_gt(gfxconfig.codec.h264_idx, -1);
ck_assert_int_gt(gfxconfig.codec.rfx_idx, -1);
ck_assert_int_lt(gfxconfig.codec.h264_idx, gfxconfig.codec.rfx_idx);
Expand Down

0 comments on commit 1f79694

Please sign in to comment.