add: tests

add: schedule endpoints
This commit is contained in:
Tobias Reisinger 2020-05-05 22:29:04 +02:00
parent 6d828fcffc
commit b5a8523ae0
14 changed files with 468 additions and 42 deletions

View file

@ -28,4 +28,6 @@
#define PIFACE_GPIO_BASE 200
#define STANDARD_HEADERS "Access-Control-Allow-Origin: *"
#endif /* CORE_CONTANTS_H */

View file

@ -12,4 +12,10 @@ api_v1_schedules_GET(struct mg_connection *c, endpoint_args_t *args, struct http
void
api_v1_schedules_STR_GET(struct mg_connection *c, endpoint_args_t *args, struct http_message *hm);
void
api_v1_schedules_STR_PUT(struct mg_connection *c, endpoint_args_t *args, struct http_message *hm);
void
api_v1_schedules_STR_DELETE(struct mg_connection *c, endpoint_args_t *args, struct http_message *hm);
#endif /* CORE_ENDPOINTS_API_V1_SCHEDULES_H */

View file

@ -6,7 +6,12 @@
#include <colors.h>
#include <config.h>
#include <macros.h>
#ifndef SOURCE_PATH_SIZE
#define SOURCE_PATH_SIZE 0
#endif
#define __FILENAME__ (__FILE__ + SOURCE_PATH_SIZE)
void
logger_log(FILE *stream, log_level_t level, const char *filename, int line, const char *func, const char *msg, ...);

View file

@ -1,13 +0,0 @@
#ifndef CORE_MACROS_H
#define CORE_MACROS_H
#include <colors.h>
#include <logger.h>
#ifndef SOURCE_PATH_SIZE
#define SOURCE_PATH_SIZE 0
#endif
#define __FILENAME__ (__FILE__ + SOURCE_PATH_SIZE)
#endif //CORE_MACROS_H

View file

@ -22,6 +22,9 @@ schedule_save(schedule_t *schedule);
int
schedule_remove(schedule_t *schedule);
int
schedule_is_protected(schedule_t *schedule);
void
schedule_free(schedule_t *schedule);
@ -46,6 +49,9 @@ schedule_get_by_id_or_off(int id);
schedule_t*
schedule_get_by_id(int id);
schedule_t*
schedule_get_by_uid(uuid_t uid);
schedule_t**
schedule_get_all();