ZT_VISITOR(3)
β¨ zt_visitor β interface for discovering test suites and test cases β¨
okay bestie, so this is page 3 of the LOCAL manual, and it's about zt_visitor and its lil buddy zt_visitor_vtab. they're the interface for discovering test suites and test cases π¦. part of libzt, iykyk.
πΈ SYNOPSIS πΈ
#include <zt.h>
typedef struct zt_visitor { ... } zt_visitor;
and here's the struct layout, because we're not gatekeeping β¨:
void *idβ the object implementing the interface πstruct zt_visitor_vtab *vtabβ the table of interface functions π
π DESCRIPTION π
zt_visitor is an interface for exploring test suites and test cases. like, it's how you go poking around inside them π.
the visitor type gets passed as an argument to all test suites. no exceptions, bestie. test suites can enumerate test cases and other test suites β nesting, we love to see it πͺ.
heads up: this is part of the implementation. it is not expected to be implemented by library users. so if you were about to go write your own, put the keyboard down π«Ά.
zt_visitor_vtab is an opaque type made up of the functions that define the interface. it's only used internally, so the implementation is private π β no peeking, no touchies.
π₯ IMPLEMENTATION NOTES π₯
- interface values combine an object pointer with a function table pointer, and they're passed by value β¨
- an interface can use the
NULLpointer as its object pointer if there's no need to refer to any data specific to an instance β go off, minimalism π - but the function table pointer cannot be null, because it's literally the thing that defines the unique aspect of the implementation. so do not. fr fr π«
π SEE ALSO π
zt_visit_test_case(3)zt_visit_test_suite(3)
β HISTORY β
zt_visitor first appeared in libzt 0.1 π β baby's first release, iconic behaviour, we stan.
π AUTHORS π
Zygmunt Krynicki <me@zygoon.pl> β thank you for your service π«‘π
π that's a wrap, bestie! this page came to you fromlibzt 0.3.1, datedJanuary 12, 2020, and it lives in the LOCAL section of the manual. now go forth and visit some test suites, you absolute main character π β¨π¦
π¦ where this page comes from
- debian bookworm: libzt-doc 0.3.1-4 Β· LGPL-3.0-only
- debian trixie: libzt-doc 0.3.1-4 Β· LGPL-3.0-only
- ubuntu jammy: libzt-doc 0.3.1-4 Β· LGPL-3.0-only
- ubuntu noble: libzt-doc 0.3.1-4build1 Β· LGPL-3.0-only
- ubuntu questing: libzt-doc 0.3.1-4build1
- ubuntu resolute: libzt-doc 0.3.1-4build2 Β· LGPL-3.0-only
- ubuntu stonking: libzt-doc 0.3.1-4build2 Β· LGPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms