Changeset cdf5361 in mainline for uspace/app/display-cfg/test/seats.c


Ignore:
Timestamp:
2023-04-25T11:48:50Z (17 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
aace43d8
Parents:
97d3d9d
git-author:
Jiri Svoboda <jiri@…> (2023-04-24 17:48:39)
git-committer:
Jiri Svoboda <jiri@…> (2023-04-25 11:48:50)
Message:

Factor out test display service

So that we can use it in display-cfg unit tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/display-cfg/test/seats.c

    r97d3d9d rcdf5361  
    2727 */
    2828
     29#include <async.h>
     30#include <dispcfg.h>
     31#include <dispcfg_srv.h>
    2932#include <errno.h>
    3033#include <pcut/pcut.h>
     34#include <testdc.h>
    3135#include "../display-cfg.h"
    3236#include "../seats.h"
     
    3539
    3640PCUT_TEST_SUITE(seats);
     41
     42static const char *test_dispcfg_server = "test-dispcfg";
     43static const char *test_dispcfg_svc = "test/dispcfg";
    3744
    3845/** Test dcfg_seats_create() and dcfg_seats_destroy() */
     
    8188PCUT_TEST(seats_list_populate)
    8289{
     90        errno_t rc;
     91        service_id_t sid;
     92        dispcfg_t *dispcfg = NULL;
     93        test_response_t resp;
     94
     95        async_set_fallback_port_handler(test_dispcfg_conn, &resp);
     96
     97        // FIXME This causes this test to be non-reentrant!
     98        rc = loc_server_register(test_dispcfg_server);
     99        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     100
     101        rc = loc_service_register(test_dispcfg_svc, &sid);
     102        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     103
     104        rc = dispcfg_open(test_dispcfg_svc, NULL, NULL, &dispcfg);
     105        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     106        PCUT_ASSERT_NOT_NULL(dispcfg);
     107
     108        dispcfg_close(dispcfg);
     109        rc = loc_service_unregister(sid);
     110        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
    83111}
    84112
Note: See TracChangeset for help on using the changeset viewer.