litespeed-quic/tests/test_alt_svc_ver.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

18 lines
658 B
C

/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
#include <assert.h>
#include <string.h>
#include "lsquic.h"
#define B(x) (1<<(x))
int
main (void)
{
assert(0 == strcmp("", lsquic_get_alt_svc_versions(0xF000))); /* Invalid bits ignored and no crash */
assert(0 == strcmp("43", lsquic_get_alt_svc_versions(B(LSQVER_043))));
assert(0 == strcmp("43,46", lsquic_get_alt_svc_versions(B(LSQVER_046)|B(LSQVER_043))));
assert(0 == strcmp("43,46", lsquic_get_alt_svc_versions(0xFF0000|B(LSQVER_046)|B(LSQVER_043))));
assert(0 == strcmp("46", lsquic_get_alt_svc_versions(B(LSQVER_046)|B(LSQVER_050))));
return 0;
}