MCPcopy Create free account
hub / github.com/ClickHouse/ai-sdk-cpp / assertUsage

Method assertUsage

tests/utils/test_fixtures.cpp:344–353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

342}
343
344void TestAssertions::assertUsage(const Usage& usage,
345 int expected_prompt,
346 int expected_completion) {
347 EXPECT_EQ(usage.prompt_tokens, expected_prompt)
348 << "Unexpected prompt token count";
349 EXPECT_EQ(usage.completion_tokens, expected_completion)
350 << "Unexpected completion token count";
351 EXPECT_EQ(usage.total_tokens, expected_prompt + expected_completion)
352 << "Total tokens should equal sum";
353}
354
355void TestAssertions::assertValidRequestJson(const nlohmann::json& request) {
356 EXPECT_TRUE(request.contains("model")) << "Request missing model field";

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected