Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
c/benchmarks/bench_user.cpp
Go to the documentation of this file.
1// First benchmark, maybe add CMock for mocking fetch_github_user for the
2// webserver
3#include "../src/user.h"
4#include <benchmark/benchmark.h>
5
6User fake_octo_user = {.login = "octocat",
7 .name = "The Octocat",
8 .company = "GitHub",
9 .location = "San Francisco"};
10
11// cppcheck-suppress constParameterCallback
12static void BM_PrintUser(benchmark::State &state) {
13 for (auto _ : state) {
15 }
16}
17
18// Cast the function pointer to the expected signature
20
BENCHMARK_MAIN()
static void BM_PrintUser(benchmark::State &state)
User fake_octo_user
BENCHMARK(BM_PrintUser)
#define _(String)
Definition gi18n-lib.h:32
Structure representing a GitHub user.
Definition user.h:9
const char * login
GitHub username.
Definition user.h:10
void print_github_user(const User *user)
Print a User's information to the console.
Definition user.c:230