2021-01-06 14:00:05 +00:00
|
|
|
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
|
2017-09-22 21:00:03 +00:00
|
|
|
#include <assert.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2018-03-09 19:17:39 +00:00
|
|
|
#include <inttypes.h>
|
2021-12-15 16:38:20 +00:00
|
|
|
#ifdef _MSC_VER
|
|
|
|
#include "vc_compat.h"
|
|
|
|
#endif
|
2017-09-22 21:00:03 +00:00
|
|
|
#include "lsquic_int_types.h"
|
|
|
|
#include "lsquic_senhist.h"
|
2019-09-11 15:27:58 +00:00
|
|
|
#include "lsquic_types.h"
|
2018-03-09 19:17:39 +00:00
|
|
|
#include "lsquic_logger.h"
|
2017-09-22 21:00:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
main (void)
|
|
|
|
{
|
2020-06-09 15:55:56 +00:00
|
|
|
struct lsquic_senhist hist = { 0, 0
|
2018-03-30 14:57:17 +00:00
|
|
|
#if !LSQUIC_SENHIST_FATAL
|
|
|
|
, 0
|
|
|
|
#endif
|
|
|
|
};
|
2017-09-22 21:00:03 +00:00
|
|
|
lsquic_packno_t packno;
|
|
|
|
|
2019-09-11 15:27:58 +00:00
|
|
|
lsquic_senhist_init(&hist, 0);
|
2017-09-22 21:00:03 +00:00
|
|
|
|
2018-03-09 19:17:39 +00:00
|
|
|
assert(0 == lsquic_senhist_largest(&hist));
|
2017-09-22 21:00:03 +00:00
|
|
|
|
|
|
|
for (packno = 1; packno < 100; ++packno)
|
|
|
|
lsquic_senhist_add(&hist, packno);
|
|
|
|
|
2018-03-09 19:17:39 +00:00
|
|
|
assert(99 == lsquic_senhist_largest(&hist));
|
2017-09-22 21:00:03 +00:00
|
|
|
|
|
|
|
lsquic_senhist_cleanup(&hist);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|