2018-04-02 19:17:56 +00:00
|
|
|
/* Copyright (c) 2017 - 2018 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>
|
2017-09-22 21:00:03 +00:00
|
|
|
|
|
|
|
#include "lsquic_int_types.h"
|
|
|
|
#include "lsquic_senhist.h"
|
2018-03-09 19:17:39 +00:00
|
|
|
#include "lsquic_logger.h"
|
2017-09-22 21:00:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
main (void)
|
|
|
|
{
|
2018-03-30 14:57:17 +00:00
|
|
|
struct lsquic_senhist hist = { 0
|
|
|
|
#if !LSQUIC_SENHIST_FATAL
|
|
|
|
, 0
|
|
|
|
#endif
|
|
|
|
};
|
2017-09-22 21:00:03 +00:00
|
|
|
lsquic_packno_t packno;
|
|
|
|
|
|
|
|
lsquic_senhist_init(&hist);
|
|
|
|
|
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;
|
|
|
|
}
|