@@ -78,6 +78,48 @@ FOSSIL_TEST_CASE(cpp_add_argument) {
7878 fossil_io_parser_free (palette);
7979} // end case
8080
81+ FOSSIL_TEST_CASE (cpp_argument_types) {
82+ fossil_io_parser_palette_t *palette = fossil_io_parser_create_palette (" test_palette" , " Test Description" );
83+ fossil_io_parser_command_t *command = fossil_io_parser_add_command (palette, " test_command" , " Test Command Description" );
84+
85+ // Test BOOL argument
86+ fossil_io_parser_argument_t *bool_arg = fossil_io_parser_add_argument (command, " bool_arg" , FOSSIL_IO_PARSER_BOOL, NULL , 0 );
87+ FOSSIL_TEST_ASSUME (bool_arg != NULL , " BOOL argument should be added" );
88+ FOSSIL_TEST_ASSUME (bool_arg->type == FOSSIL_IO_PARSER_BOOL, " BOOL argument type should be correct" );
89+
90+ // Test STRING argument
91+ fossil_io_parser_argument_t *string_arg = fossil_io_parser_add_argument (command, " string_arg" , FOSSIL_IO_PARSER_STRING, NULL , 0 );
92+ FOSSIL_TEST_ASSUME (string_arg != NULL , " STRING argument should be added" );
93+ FOSSIL_TEST_ASSUME (string_arg->type == FOSSIL_IO_PARSER_STRING, " STRING argument type should be correct" );
94+
95+ // Test INT argument
96+ fossil_io_parser_argument_t *int_arg = fossil_io_parser_add_argument (command, " int_arg" , FOSSIL_IO_PARSER_INT, NULL , 0 );
97+ FOSSIL_TEST_ASSUME (int_arg != NULL , " INT argument should be added" );
98+ FOSSIL_TEST_ASSUME (int_arg->type == FOSSIL_IO_PARSER_INT, " INT argument type should be correct" );
99+
100+ // Test FLOAT argument
101+ fossil_io_parser_argument_t *float_arg = fossil_io_parser_add_argument (command, " float_arg" , FOSSIL_IO_PARSER_FLOAT, NULL , 0 );
102+ FOSSIL_TEST_ASSUME (float_arg != NULL , " FLOAT argument should be added" );
103+ FOSSIL_TEST_ASSUME (float_arg->type == FOSSIL_IO_PARSER_FLOAT, " FLOAT argument type should be correct" );
104+
105+ // Test DATE argument
106+ fossil_io_parser_argument_t *date_arg = fossil_io_parser_add_argument (command, " date_arg" , FOSSIL_IO_PARSER_DATE, NULL , 0 );
107+ FOSSIL_TEST_ASSUME (date_arg != NULL , " DATE argument should be added" );
108+ FOSSIL_TEST_ASSUME (date_arg->type == FOSSIL_IO_PARSER_DATE, " DATE argument type should be correct" );
109+
110+ // Test ARRAY argument
111+ fossil_io_parser_argument_t *array_arg = fossil_io_parser_add_argument (command, " array_arg" , FOSSIL_IO_PARSER_ARRAY, NULL , 0 );
112+ FOSSIL_TEST_ASSUME (array_arg != NULL , " ARRAY argument should be added" );
113+ FOSSIL_TEST_ASSUME (array_arg->type == FOSSIL_IO_PARSER_ARRAY, " ARRAY argument type should be correct" );
114+
115+ // Test FEATURE argument
116+ fossil_io_parser_argument_t *feature_arg = fossil_io_parser_add_argument (command, " feature_arg" , FOSSIL_IO_PARSER_FEATURE, NULL , 0 );
117+ FOSSIL_TEST_ASSUME (feature_arg != NULL , " FEATURE argument should be added" );
118+ FOSSIL_TEST_ASSUME (feature_arg->type == FOSSIL_IO_PARSER_FEATURE, " FEATURE argument type should be correct" );
119+
120+ fossil_io_parser_free (palette);
121+ } // end case
122+
81123FOSSIL_TEST_CASE (cpp_parse_command) {
82124 fossil_io_parser_palette_t *palette = fossil_io_parser_create_palette (" test_palette" , " Test Description" );
83125 fossil_io_parser_command_t *command = fossil_io_parser_add_command (palette, " test_command" , " Test Command Description" );
@@ -165,6 +207,47 @@ FOSSIL_TEST_CASE(cpp_wrapper_free_palette) {
165207 // No explicit assumptions here, just ensuring no memory leaks or crashes
166208} // end case
167209
210+ FOSSIL_TEST_CASE (cpp_wrapper_argument_types) {
211+ fossil::io::Parser parser;
212+ fossil_io_parser_palette_t *palette = parser.create_palette (" wrapper_palette" , " Wrapper Test Description" );
213+ fossil_io_parser_command_t *command = parser.add_command (palette, " wrapper_command" , " Wrapper Command Description" );
214+
215+ // Test BOOL argument
216+ fossil_io_parser_argument_t *bool_arg = parser.add_argument (command, " bool_arg" , FOSSIL_IO_PARSER_BOOL, NULL , 0 );
217+ FOSSIL_TEST_ASSUME (bool_arg != NULL , " BOOL argument should be added" );
218+ FOSSIL_TEST_ASSUME (bool_arg->type == FOSSIL_IO_PARSER_BOOL, " BOOL argument type should be correct" );
219+
220+ // Test STRING argument
221+ fossil_io_parser_argument_t *string_arg = parser.add_argument (command, " string_arg" , FOSSIL_IO_PARSER_STRING, NULL , 0 );
222+ FOSSIL_TEST_ASSUME (string_arg != NULL , " STRING argument should be added" );
223+ FOSSIL_TEST_ASSUME (string_arg->type == FOSSIL_IO_PARSER_STRING, " STRING argument type should be correct" );
224+
225+ // Test INT argument
226+ fossil_io_parser_argument_t *int_arg = parser.add_argument (command, " int_arg" , FOSSIL_IO_PARSER_INT, NULL , 0 );
227+ FOSSIL_TEST_ASSUME (int_arg != NULL , " INT argument should be added" );
228+ FOSSIL_TEST_ASSUME (int_arg->type == FOSSIL_IO_PARSER_INT, " INT argument type should be correct" );
229+
230+ // Test FLOAT argument
231+ fossil_io_parser_argument_t *float_arg = parser.add_argument (command, " float_arg" , FOSSIL_IO_PARSER_FLOAT, NULL , 0 );
232+ FOSSIL_TEST_ASSUME (float_arg != NULL , " FLOAT argument should be added" );
233+ FOSSIL_TEST_ASSUME (float_arg->type == FOSSIL_IO_PARSER_FLOAT, " FLOAT argument type should be correct" );
234+
235+ // Test DATE argument
236+ fossil_io_parser_argument_t *date_arg = parser.add_argument (command, " date_arg" , FOSSIL_IO_PARSER_DATE, NULL , 0 );
237+ FOSSIL_TEST_ASSUME (date_arg != NULL , " DATE argument should be added" );
238+ FOSSIL_TEST_ASSUME (date_arg->type == FOSSIL_IO_PARSER_DATE, " DATE argument type should be correct" );
239+
240+ // Test ARRAY argument
241+ fossil_io_parser_argument_t *array_arg = parser.add_argument (command, " array_arg" , FOSSIL_IO_PARSER_ARRAY, NULL , 0 );
242+ FOSSIL_TEST_ASSUME (array_arg != NULL , " ARRAY argument should be added" );
243+ FOSSIL_TEST_ASSUME (array_arg->type == FOSSIL_IO_PARSER_ARRAY, " ARRAY argument type should be correct" );
244+
245+ // Test FEATURE argument
246+ fossil_io_parser_argument_t *feature_arg = parser.add_argument (command, " feature_arg" , FOSSIL_IO_PARSER_FEATURE, NULL , 0 );
247+ FOSSIL_TEST_ASSUME (feature_arg != NULL , " FEATURE argument should be added" );
248+ FOSSIL_TEST_ASSUME (feature_arg->type == FOSSIL_IO_PARSER_FEATURE, " FEATURE argument type should be correct" );
249+ parser.free (palette);
250+ } // end case
168251
169252// * * * * * * * * * * * * * * * * * * * * * * * *
170253// * Fossil Logic Test Pool
@@ -176,11 +259,14 @@ FOSSIL_TEST_GROUP(cpp_parser_test_cases) {
176259 FOSSIL_TEST_ADD (cpp_parser_suite, cpp_add_argument);
177260 FOSSIL_TEST_ADD (cpp_parser_suite, cpp_parse_command);
178261 FOSSIL_TEST_ADD (cpp_parser_suite, cpp_free_palette);
262+ FOSSIL_TEST_ADD (cpp_parser_suite, cpp_argument_types);
263+
179264 FOSSIL_TEST_ADD (cpp_parser_suite, cpp_wrapper_create_palette);
180265 FOSSIL_TEST_ADD (cpp_parser_suite, cpp_wrapper_add_command);
181266 FOSSIL_TEST_ADD (cpp_parser_suite, cpp_wrapper_add_argument);
182267 FOSSIL_TEST_ADD (cpp_parser_suite, cpp_wrapper_parse_command);
183268 FOSSIL_TEST_ADD (cpp_parser_suite, cpp_wrapper_free_palette);
269+ FOSSIL_TEST_ADD (cpp_parser_suite, cpp_wrapper_argument_types);
184270
185271 FOSSIL_TEST_REGISTER (cpp_parser_suite);
186272} // end of group
0 commit comments