Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-29 08:25:01

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2026 Wouter Deconinck
0003 //
0004 // Tests for the NameMixin base class
0005 //
0006 #include <algorithms/name.h>
0007 
0008 #include <catch2/catch_test_macros.hpp>
0009 
0010 #include <string>
0011 
0012 using namespace algorithms;
0013 
0014 TEST_CASE("NameMixin keeps a copy of its name and description", "[name]") {
0015   std::string name{"myName"};
0016   std::string description{"my description"};
0017   const NameMixin n{name, description};
0018 
0019   // modifying the originals must not affect the stored values
0020   name        = "changed";
0021   description = "changed";
0022 
0023   CHECK(n.name() == "myName");
0024   CHECK(n.description() == "my description");
0025 }