Updated test cases documentation

This commit is contained in:
Bartek Kryza
2023-12-22 21:44:17 +01:00
parent 3671bf9beb
commit bf7b69bcca
381 changed files with 26178 additions and 19073 deletions

View File

@@ -14,81 +14,7 @@ diagrams:
```
## Source code
File t00019_layer1.h
```cpp
#pragma once
#include <iostream>
#include <string>
namespace clanguml {
namespace t00019 {
template <typename LowerLayer> class Layer1 : public LowerLayer {
using LowerLayer::LowerLayer;
int m1() override
{
std::cout << "m1 called\n";
return LowerLayer::m1();
}
std::string m2() override
{
std::cout << "m2 called\n";
return LowerLayer::m2();
}
};
}
}
```
File t00019.cc
```cpp
#include "t00019_base.h"
#include "t00019_layer1.h"
#include "t00019_layer2.h"
#include "t00019_layer3.h"
#include <memory>
namespace clanguml {
namespace t00019 {
class A {
public:
std::unique_ptr<Layer1<Layer2<Layer3<Base>>>> layers;
};
}
}
```
File t00019_layer2.h
```cpp
#pragma once
namespace clanguml {
namespace t00019 {
template <typename LowerLayer> class Layer2 : public LowerLayer {
using LowerLayer::LowerLayer;
using LowerLayer::m1;
using LowerLayer::m2;
int all_calls_count() const
{
return LowerLayer::m1_calls() + LowerLayer::m2_calls();
}
};
}
}
```
File t00019_layer3.h
File `tests/t00019/t00019_layer3.h`
```cpp
#pragma once
@@ -125,7 +51,57 @@ private:
}
```
File t00019_base.h
File `tests/t00019/t00019_layer1.h`
```cpp
#pragma once
#include <iostream>
#include <string>
namespace clanguml {
namespace t00019 {
template <typename LowerLayer> class Layer1 : public LowerLayer {
using LowerLayer::LowerLayer;
int m1() override
{
std::cout << "m1 called\n";
return LowerLayer::m1();
}
std::string m2() override
{
std::cout << "m2 called\n";
return LowerLayer::m2();
}
};
}
}
```
File `tests/t00019/t00019.cc`
```cpp
#include "t00019_base.h"
#include "t00019_layer1.h"
#include "t00019_layer2.h"
#include "t00019_layer3.h"
#include <memory>
namespace clanguml {
namespace t00019 {
class A {
public:
std::unique_ptr<Layer1<Layer2<Layer3<Base>>>> layers;
};
}
}
```
File `tests/t00019/t00019_base.h`
```cpp
#pragma once
@@ -147,6 +123,30 @@ class Base {
}
}
```
File `tests/t00019/t00019_layer2.h`
```cpp
#pragma once
namespace clanguml {
namespace t00019 {
template <typename LowerLayer> class Layer2 : public LowerLayer {
using LowerLayer::LowerLayer;
using LowerLayer::m1;
using LowerLayer::m2;
int all_calls_count() const
{
return LowerLayer::m1_calls() + LowerLayer::m2_calls();
}
};
}
}
```
## Generated PlantUML diagrams
![t00019_class](./t00019_class.svg "Layercake pattern")
@@ -175,6 +175,7 @@ class Base {
"is_constexpr": false,
"is_constructor": true,
"is_copy_assignment": false,
"is_coroutine": false,
"is_defaulted": true,
"is_deleted": false,
"is_move_assignment": false,
@@ -200,6 +201,7 @@ class Base {
"is_constexpr": true,
"is_constructor": false,
"is_copy_assignment": false,
"is_coroutine": false,
"is_defaulted": true,
"is_deleted": false,
"is_move_assignment": false,
@@ -225,6 +227,7 @@ class Base {
"is_constexpr": false,
"is_constructor": false,
"is_copy_assignment": false,
"is_coroutine": false,
"is_defaulted": false,
"is_deleted": false,
"is_move_assignment": false,
@@ -250,6 +253,7 @@ class Base {
"is_constexpr": false,
"is_constructor": false,
"is_copy_assignment": false,
"is_coroutine": false,
"is_defaulted": false,
"is_deleted": false,
"is_move_assignment": false,
@@ -298,6 +302,7 @@ class Base {
"is_constexpr": false,
"is_constructor": false,
"is_copy_assignment": false,
"is_coroutine": false,
"is_defaulted": false,
"is_deleted": false,
"is_move_assignment": false,
@@ -323,6 +328,7 @@ class Base {
"is_constexpr": false,
"is_constructor": false,
"is_copy_assignment": false,
"is_coroutine": false,
"is_defaulted": false,
"is_deleted": false,
"is_move_assignment": false,
@@ -378,6 +384,7 @@ class Base {
"is_constexpr": false,
"is_constructor": false,
"is_copy_assignment": false,
"is_coroutine": false,
"is_defaulted": false,
"is_deleted": false,
"is_move_assignment": false,
@@ -458,6 +465,7 @@ class Base {
"is_constexpr": false,
"is_constructor": false,
"is_copy_assignment": false,
"is_coroutine": false,
"is_defaulted": false,
"is_deleted": false,
"is_move_assignment": false,
@@ -483,6 +491,7 @@ class Base {
"is_constexpr": false,
"is_constructor": false,
"is_copy_assignment": false,
"is_coroutine": false,
"is_defaulted": false,
"is_deleted": false,
"is_move_assignment": false,
@@ -508,6 +517,7 @@ class Base {
"is_constexpr": false,
"is_constructor": false,
"is_copy_assignment": false,
"is_coroutine": false,
"is_defaulted": false,
"is_deleted": false,
"is_move_assignment": false,
@@ -533,6 +543,7 @@ class Base {
"is_constexpr": false,
"is_constructor": false,
"is_copy_assignment": false,
"is_coroutine": false,
"is_defaulted": false,
"is_deleted": false,
"is_move_assignment": false,
@@ -593,7 +604,7 @@ class Base {
"source_location": {
"column": 11,
"file": "",
"line": 242,
"line": 277,
"translation_unit": "t00019.cc"
},
"template_parameters": [
@@ -629,7 +640,7 @@ class Base {
"source_location": {
"column": 11,
"file": "",
"line": 242,
"line": 277,
"translation_unit": "t00019.cc"
},
"template_parameters": [
@@ -672,7 +683,7 @@ class Base {
"source_location": {
"column": 11,
"file": "",
"line": 242,
"line": 277,
"translation_unit": "t00019.cc"
},
"template_parameters": [