cpp-common/bt2c: add `format_as()` functions for `Uuid` and `UuidView`
[babeltrace.git] / tests / cpp-common / test-uuid.cpp
CommitLineData
e05975eb
SM
1/*
2 * SPDX-License-Identifier: GPL-2.0-only
3 *
4 * Copyright (C) 2024 EfficiOS, Inc.
5 */
6
7#include "cpp-common/bt2c/fmt.hpp"
8#include "cpp-common/bt2c/uuid.hpp"
9#include "cpp-common/vendor/fmt/format.h"
10
11#include "tap/tap.h"
12
13namespace {
14
15constexpr auto uuidStr = "c2281e4a-699b-4b78-903f-2f8407fe2b77";
16const bt2c::Uuid uuid {uuidStr};
17const bt2c::UuidView uuidView {uuid};
18
19void testFormatAs()
20{
21 const auto resUuid = fmt::to_string(uuid);
22 const auto resUuidView = fmt::to_string(uuidView);
23
24 ok(resUuid == uuidStr, "result of format_as() for `Uuid` is expected");
25 ok(resUuidView == uuidStr, "result of format_as() for `UuidView` is expected");
26}
27
28} /* namespace */
29
30int main()
31{
32 plan_tests(2);
33 testFormatAs();
34 return exit_status();
35}
This page took 0.022957 seconds and 4 git commands to generate.