domo update rest server to new API
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
75
src/tests/test_domo.c
Normal file
75
src/tests/test_domo.c
Normal file
@@ -0,0 +1,75 @@
|
||||
/*!
|
||||
* test_domo.c
|
||||
*
|
||||
* Copyright (c) 2015-2020, NADAL Jean-Baptiste. All rights reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*
|
||||
* @Author: NADAL Jean-Baptiste
|
||||
* @Date: 21/02/2020
|
||||
*
|
||||
*/
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
TEST("Domo - Server - Create Free\t")
|
||||
{
|
||||
restd_server_t *rest_server;
|
||||
|
||||
rest_server = restd_server_new();
|
||||
ASSERT_NOT_NULL(rest_server);
|
||||
|
||||
restd_server_free(rest_server);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
TEST("Domo - Test API correct access\t")
|
||||
{
|
||||
struct event_base *ev_base;
|
||||
restd_server_t *rest_server;
|
||||
devices_manager_t *dm;
|
||||
char *config_path;
|
||||
int ret;
|
||||
|
||||
dm = devices_manager_new();
|
||||
ASSERT_NOT_NULL(dm);
|
||||
|
||||
ev_base = event_base_new();
|
||||
ASSERT_NOT_NULL(ev_base);
|
||||
|
||||
rest_server = restd_server_new();
|
||||
ASSERT_NOT_NULL(rest_server);
|
||||
|
||||
ret = restd_server_attach_event_loop(rest_server, ev_base);
|
||||
ASSERT_EQUAL_INT(ret, 0);
|
||||
|
||||
config_path = get_config_path();
|
||||
ASSERT_NOT_NULL(config_path);
|
||||
|
||||
ret = setup_rest_server(rest_server, kserver_port, config_path, dm);
|
||||
ASSERT_EQUAL_INT(ret, 0);
|
||||
|
||||
// TODO
|
||||
|
||||
restd_server_free(rest_server);
|
||||
devices_manager_free(dm);
|
||||
free(config_path);
|
||||
}
|
||||
Reference in New Issue
Block a user