ratelimiter_test.c revision b3eeac48ea16234be25bacd7cd0c74e112f60ced
a094c46640de70bb03a9351211fb17c41b6fbbb5Automatic Updater * Copyright (C) 1999, 2000 Internet Software Consortium.
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews * Permission to use, copy, modify, and distribute this software for any
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater * purpose with or without fee is hereby granted, provided that the above
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews * copyright notice and this permission notice appear in all copies.
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
37dee1ff94960a61243f611c0f87f8c316815c53Mark Andrews int times[N] = { 1, 2, 3, 10000, 10001, 10002, 11500 };
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews RUNTIME_CHECK(isc_taskmgr_create(mctx, 3, 0, &taskmgr) ==
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews RUNTIME_CHECK(isc_timermgr_create(mctx, &timermgr) ==
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews RUNTIME_CHECK(isc_task_create(taskmgr, 0, &task) ==
37dee1ff94960a61243f611c0f87f8c316815c53Mark Andrews RUNTIME_CHECK(isc_ratelimiter_create(mctx, timermgr, task,
c5387e694299c41361660e54f23e89c7da3ede1dMark Andrews RUNTIME_CHECK(isc_ratelimiter_setinterval(rlim, &linterval) ==
c5387e694299c41361660e54f23e89c7da3ede1dMark Andrews for (i = 0; i < N; i++) {
37dee1ff94960a61243f611c0f87f8c316815c53Mark Andrews for (i = 0; i < N; i++) {