Debian Codegraph @

pencil/test/test_data/test_data_setup.h

raw
1 /* File: test_data_setup.h; Copyright and License: see below */
2
3 #ifndef TEST_DATA_SETUP_H
4 #define TEST_DATA_SETUP_H
5
6 /* public file for the doxygen documentation: */
7 /*!
8 * \file
9 * \brief Provides functions to setup test case input data
10 */
11
12 #include "set/data_visible_set.h"
13
14
15 /*!
16 * \brief enumeration of all diagram types
17 */
18 enum test_data_setup_mode_enum {
19 TEST_DATA_SETUP_MODE_GOOD_CASES = 0, /*!< diagram data that should be drawn by pencil without overlaps or other problems */
20 TEST_DATA_SETUP_MODE_CHALLENGING_CASES = 1, /*!< diagram data that should be drawn by pencil, possibly with overlaps or other warnings */
21 TEST_DATA_SETUP_MODE_EDGE_CASES = 2, /*!< diagram data that should be drawn by pencil, possibly only partly or with rendering errors */
22 };
23
24 typedef enum test_data_setup_mode_enum test_data_setup_mode_t;
25
26
27 /*!
28 * \brief attributes of the test_data_setup_t
29 */
30 struct test_data_setup_struct {
31 unsigned int variant; /*!< current variant for which to produce test data */
32 test_data_setup_mode_t mode; /*!< kind of test data that shall be produced */
33 };
34
35 typedef struct test_data_setup_struct test_data_setup_t;
36
37 /*!
38 * \brief initializes the test_data_setup_t
39 *
40 * \param this_ pointer to own object attributes
41 * \param mode the mode attribute
42 */
43 static inline void test_data_setup_init( test_data_setup_t *this_, test_data_setup_mode_t mode );
44
45 /*!
46 * \brief er-initializes the test_data_setup_t
47 *
48 * \param this_ pointer to own object attributes
49 */
50 static inline void test_data_setup_reinit( test_data_setup_t *this_ );
51
52 /*!
53 * \brief destroys the test_data_setup_t
54 *
55 * \param this_ pointer to own object attributes
56 */
57 static inline void test_data_setup_destroy( test_data_setup_t *this_ );
58
59 /*!
60 * \brief selects the next variant. In case there is no next variant, switches to invalid variant
61 *
62 * \param this_ pointer to own object attributes
63 */
64 static inline void test_data_setup_next_variant( test_data_setup_t *this_ );
65
66 /*!
67 * \brief checks if the current variant is a valid variant
68 *
69 * \param this_ pointer to own object attributes
70 * \return true if there is a next variant
71 */
72 static inline bool test_data_setup_is_valid_variant( const test_data_setup_t *this_ );
73
74 /*!
75 * \brief gets the current variant
76 *
77 * \param this_ pointer to own object attributes
78 * \return variant attribute
79 */
80 static inline unsigned int test_data_setup_get_variant( const test_data_setup_t *this_ );
81
82 /*!
83 * \brief gets the current mode
84 *
85 * \param this_ pointer to own object attributes
86 * \return mode attribute
87 */
88 static inline test_data_setup_mode_t test_data_setup_get_mode( const test_data_setup_t *this_ );
89
90 /*!
91 * \brief initializes the data_visible_set_t according to the mode and the set variant
92 *
93 * \param this_ pointer to own object attributes
94 * \param io_data_set pointer to the data_visible_set_t which shall be partily initialized
95 */
96 static inline void test_data_setup_get_variant_data( const test_data_setup_t *this_, data_visible_set_t *io_data_set );
97
98 /*!
99 * \brief initializes the diagram in the data_visible_set_t according to the set variant
100 *
101 * \param this_ pointer to own object attributes
102 * \param io_data_set pointer to the data_visible_set_t which shall be partily initialized
103 */
104 static inline void test_data_setup_private_set_diagram( const test_data_setup_t *this_, data_visible_set_t *io_data_set );
105
106 /*!
107 * \brief adds visibla_classifiers to the data_visible_set_t according to the set variant
108 *
109 * \param this_ pointer to own object attributes
110 * \param io_data_set pointer to the data_visible_set_t which shall be partily initialized
111 */
112 static inline void test_data_setup_private_add_classifiers( const test_data_setup_t *this_, data_visible_set_t *io_data_set );
113
114 /*!
115 * \brief adds lifelines to the data_visible_set_t, one per visible classifier
116 *
117 * \param this_ pointer to own object attributes
118 * \param io_data_set pointer to the data_visible_set_t which contains visible classifiers and which shall be partily initialized
119 */
120 static inline void test_data_setup_private_add_lifelines( const test_data_setup_t *this_, data_visible_set_t *io_data_set );
121
122 /*!
123 * \brief adds features to the data_visible_set_t according to the set variant
124 *
125 * \param this_ pointer to own object attributes
126 * \param io_data_set pointer to the data_visible_set_t which contains visible classifiers and which shall be partily initialized
127 */
128 static inline void test_data_setup_private_add_features( const test_data_setup_t *this_, data_visible_set_t *io_data_set );
129
130 /*!
131 * \brief adds relationships to the data_visible_set_t according to the set variant
132 *
133 * \param this_ pointer to own object attributes
134 * \param io_data_set pointer to the data_visible_set_t which contains visible classifiers and which shall be partily initialized
135 */
136 static inline void test_data_setup_private_add_relationships( const test_data_setup_t *this_, data_visible_set_t *io_data_set );
137
138
139 #include "test_data_setup.inl"
140
141 #endif /* TEST_DATA_SETUP_H */
142
143
144 /*
145 * Copyright 2021-2026 Andreas Warnke
146 *
147 * Licensed under the Apache License, Version 2.0 (the "License");
148 * you may not use this file except in compliance with the License.
149 * You may obtain a copy of the License at
150 *
151 * http://www.apache.org/licenses/LICENSE-2.0
152 *
153 * Unless required by applicable law or agreed to in writing, software
154 * distributed under the License is distributed on an "AS IS" BASIS,
155 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
156 * See the License for the specific language governing permissions and
157 * limitations under the License.
158 */