litespeed-quic/tests/test_engine_ctor.c
Dmitri Tikhonov 06b2a2363e Release 2.27.1
- [API] New knob to set outgoing packet batch size.
- Aborted connection now become tickable immediately.
- Abort connection when HTTP/3 frame cannot be opened (can only happen
  when malloc fails).
2021-01-06 09:00:05 -05:00

36 lines
924 B
C

/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include "lsquic.h"
int
main (void)
{
struct lsquic_engine_settings settings;
lsquic_engine_t *engine;
unsigned versions;
const unsigned flags = LSENG_SERVER;
lsquic_engine_init_settings(&settings, flags);
struct lsquic_engine_api api;
memset(&api, 0, sizeof(api));
api.ea_settings = &settings;
api.ea_packets_out = (void *) (uintptr_t) 1;
api.ea_stream_if = (void *) (uintptr_t) 2;
engine = lsquic_engine_new(flags, &api);
assert(engine);
versions = lsquic_engine_quic_versions(engine);
assert(versions == settings.es_versions);
lsquic_engine_destroy(engine);
settings.es_versions |= (1 << N_LSQVER /* Invalid value by definition */);
engine = lsquic_engine_new(flags, &api);
assert(!engine);
return 0;
}