LUMIERA.clone/tests/lib/par/parameter-domain-test.cpp
Ichthyostega 82b7acac57 Parameters: pick up work on type handling experiments
...after an extended break where I focused on learning IO_URING,
which is the topic of my upcoming talk at Froscon-2026;
(I built a prototype to read and display video with async IO)

Today ''I have re-read my design notes'' and the analysis seems to hold up well;
furthermore I solved the coding problem how to generate type handlers for a list of types.
2026-07-19 22:48:50 +02:00

107 lines
2.1 KiB
C++
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
ParameterDomain(Test) - document the handling of parameter type domain
Copyright (C)
2026, Hermann Vosseler <Ichthyostega@web.de>
  **Lumiera** is free software; you can redistribute it and/or modify it
  under the terms of the GNU General Public License as published by the
  Free Software Foundation; either version 2 of the License, or (at your
  option) any later version. See the file COPYING for further details.
* *****************************************************************/
/** @file parameter-domain-test.cpp
** unit test \ref ParameterDomain_test
*/
#include "test/run.hpp"
//#include "test/test-helper.hpp"
#include "lib/par/domain.hpp"
//#include "lib/format-cout.hpp"
//#include <utility>
//#include <string>
//#include <vector>
//using std::string;
//using std::vector;
//using std::swap;
namespace lib {
namespace par {
namespace test{
// using lumiera::error::LUMIERA_ERROR_LOGIC;
namespace {//Test fixture....
class Thing
{ };
template<typename X>
struct Some
{
X x;
};
typedef Some<Thing> SomeThing;
}//(End)Test fixture
/**************************************************************************//**
* @test cover properties of generic parameter containers.
*/
class ParameterDomain_test : public Test
{
virtual void
run (Arg)
{
seedRand();
basics();
verify_typeVisitor();
}
void
basics()
{
}
void
verify_typeVisitor()
{
BaseDomain<int> domInt;
Domain& d1{domInt};
int val1 = 1 + rani (1000);
ValBuff& src1 = asValBuff (val1);
uint target1{0};
CHECK (not target1);
TypeHandler<uint>& dd1{d1};
dd1.extractAs (target1, src1);
CHECK (target1 == uint(val1));
}
};
/** Register this test class... */
LAUNCHER (ParameterDomain_test, "unit lib");
}}} // namespace lib::par::test