diff --git a/tests/engine/test_token_bucket.cpp b/tests/engine/test_token_bucket.cpp index 412c996b..01893027 100644 --- a/tests/engine/test_token_bucket.cpp +++ b/tests/engine/test_token_bucket.cpp @@ -74,4 +74,10 @@ TEST_CASE("token bucket with 2 tokens/sec rate, max 10 tokens", "[token_bucket]" } } } -} \ No newline at end of file +} + +TEST_CASE("token bucket default initialization", "[token_bucket]") +{ + token_bucket tb; + REQUIRE(tb.get_tokens() == 1); +} diff --git a/userspace/engine/token_bucket.h b/userspace/engine/token_bucket.h index 03c4790e..1dd60c26 100644 --- a/userspace/engine/token_bucket.h +++ b/userspace/engine/token_bucket.h @@ -22,8 +22,6 @@ limitations under the License. #include #include -using token_timer = std::function; - // A simple token bucket that accumulates tokens at a fixed rate and allows // for limited bursting in the form of "banked" tokens. class token_bucket @@ -79,4 +77,4 @@ class token_bucket // Nanoseconds since the epoch. // uint64_t m_last_seen; -}; \ No newline at end of file +};