#ifndef TESTUTILS_H
#define TESTUTILS_H
#include "test.h"
#include "../public/nsapi.h"
#include "../daemon/httprequest.h"
#include "../util/io.h"
#include <cx/buffer.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct TestIOStream {
HttpStream io;
CxBuffer *buf;
int max_write;
} TestIOStream;
Session* testutil_session(
void);
Request* testutil_request(
pool_handle_t *pool,
const char *method,
const char *uri);
Connection* testutil_dummy_connection(
pool_handle_t *pool);
void testutil_request_body(Session *sn, Request *rq,
const char *body,
size_t len);
void testutil_destroy_session(Session *sn);
TestIOStream* testutil_iostream(
size_t size,
int autoextend);
void testutil_iostream_destroy(TestIOStream *stream);
#ifdef __cplusplus
}
#endif
#endif