xo-umbrella2/xo-printjson/utest/printjson_utest_appcx.hpp
Roland Conybeare b6d4acca82
Some checks failed
cmake-docker / cmake-build (clang, clang++) (push) Failing after 10m52s
CI / smoke-test (push) Has been cancelled
cmake-docker / cmake-build (gcc, g++) (push) Has been cancelled
xo-facet: common base align recovers alloc size from ptr [REFACTOR]
2026-09-25 08:20:21 -04:00

29 lines
959 B
C++

/** @file printjson_utest_appcx.hpp
*
* @author Roland Conybeare, Sep 2026
*
* Access to the utest process's FacetAppcx, for tests that need one.
*
* Why an accessor rather than each test file owning a context: an
* Indentlog2Appcx maps a temp arena and installs a PrettySinkFactory, so a
* second one is not free and not obviously harmless. There is one chain, it
* is built by printjson_utest_main.cpp, and this is how a test reaches it.
*
* ObjectSlotJson.test.cpp needs it because a non-empty ObjectSlot can only be
* made by a DHandleStore, which requires FacetAppcxCreated evidence -- see
* .xo-backlog/xo-facet/issues/04.
**/
#pragma once
#include <xo/facet/cx/FacetAppcx.hpp>
namespace xo {
/** the utest process's facet context.
*
* Valid for the whole of main(); tests run inside its lifetime.
**/
FacetAppcx & printjson_utest_facet_appcx();
} /*namespace xo*/
/* end printjson_utest_appcx.hpp */