mirror of
https://github.com/falcosecurity/falco.git
synced 2025-08-29 19:23:16 +00:00
new: test token bucket declaration triggers the default init
Co-Authored-By: Lorenzo Fontana <lo@linux.com> Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
This commit is contained in:
parent
9bc28951ad
commit
08454dfa53
@ -75,3 +75,9 @@ TEST_CASE("token bucket with 2 tokens/sec rate, max 10 tokens", "[token_bucket]"
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE("token bucket default initialization", "[token_bucket]")
|
||||||
|
{
|
||||||
|
token_bucket tb;
|
||||||
|
REQUIRE(tb.get_tokens() == 1);
|
||||||
|
}
|
||||||
|
@ -22,8 +22,6 @@ limitations under the License.
|
|||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
using token_timer = std::function<uint64_t()>;
|
|
||||||
|
|
||||||
// A simple token bucket that accumulates tokens at a fixed rate and allows
|
// A simple token bucket that accumulates tokens at a fixed rate and allows
|
||||||
// for limited bursting in the form of "banked" tokens.
|
// for limited bursting in the form of "banked" tokens.
|
||||||
class token_bucket
|
class token_bucket
|
||||||
|
Loading…
Reference in New Issue
Block a user