mirror of
https://gitea.invidious.io/iv-org/litespeed-quic.git
synced 2024-08-15 00:53:43 +00:00
Rename test/unittests to tests/ and test/ to bin/
This commit is contained in:
parent
ecfd688117
commit
9a690580c9
92 changed files with 38 additions and 39 deletions
36
tests/test_engine_ctor.c
Normal file
36
tests/test_engine_ctor.c
Normal file
|
@ -0,0 +1,36 @@
|
|||
/* Copyright (c) 2017 - 2020 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue