| 1 | #cxx . . $ `<file>/tools/test_item.c`/include "test_item.h"cxx . . $ `<file>/tools/test_item.h`/ |
| 2 | |
| 3 | #include <stdlib.h> |
| 4 | #include <string.h> |
| 5 | |
| 6 | #include <cgreen/internal/unit_implementation.h>cxx . . $ `<file>/include/cgreen/internal/unit_implementation.h`/ |
| 7 | |
| 8 | #include <stdio.h> |
| 9 | |
| 10 | |
| 11 | static const char *skip_to_separatorcxx . . $ skip_to_separator(fb58d2e09a2a1ce6).(const char *start) { |
| 12 | return strstrcxx . . $ strstr(a713fe7b9a57cf96).(start, CGREEN_SEPARATORcxx . . $ `include/cgreen/internal/unit_implementation.h:30:9`!); |
| 13 | } |
| 14 | |
| 15 | static const char *skip_over_separatorcxx . . $ skip_over_separator(fb58d2e09a2a1ce6).(const char *start) { |
| 16 | return strstrcxx . . $ strstr(a713fe7b9a57cf96).(start, CGREEN_SEPARATORcxx . . $ `include/cgreen/internal/unit_implementation.h:30:9`!)+strlencxx . . $ strlen(751346f8406fd082).(CGREEN_SEPARATORcxx . . $ `include/cgreen/internal/unit_implementation.h:30:9`!); |
| 17 | } |
| 18 | |
| 19 | static const char *skip_cgreen_spec_markercxx . . $ skip_cgreen_spec_marker(fb58d2e09a2a1ce6).(const char *string) { |
| 20 | return &string[strlencxx . . $ strlen(751346f8406fd082).(CGREEN_SPEC_PREFIXcxx . . $ `include/cgreen/internal/unit_implementation.h:29:9`! CGREEN_SEPARATORcxx . . $ `include/cgreen/internal/unit_implementation.h:30:9`!)]; |
| 21 | } |
| 22 | |
| 23 | static const char *string_copy_ofcxx . . $ string_copy_of(1320557f0feba62c).(const char *start, const char *end) { |
| 24 | char *string = strdupcxx . . $ strdup(a8b8e32347182212).(start); |
| 25 | string[end-start] = '\0'; |
| 26 | return string; |
| 27 | } |
| 28 | |
| 29 | static const char *context_name_fromcxx . . $ context_name_from(fb58d2e09a2a1ce6).(const char *specification_name) { |
| 30 | const char *start = skip_cgreen_spec_markercxx . . $ skip_cgreen_spec_marker(fb58d2e09a2a1ce6).(specification_name); |
| 31 | const char *end = skip_to_separatorcxx . . $ skip_to_separator(fb58d2e09a2a1ce6).(start); |
| 32 | return string_copy_ofcxx . . $ string_copy_of(1320557f0feba62c).(start, end); |
| 33 | } |
| 34 | |
| 35 | static const char *test_name_fromcxx . . $ test_name_from(fb58d2e09a2a1ce6).(const char *specification_name) { |
| 36 | const char *start = skip_cgreen_spec_markercxx . . $ skip_cgreen_spec_marker(fb58d2e09a2a1ce6).(specification_name); |
| 37 | start = skip_over_separatorcxx . . $ skip_over_separator(fb58d2e09a2a1ce6).(start); |
| 38 | const char *end = skip_to_separatorcxx . . $ skip_to_separator(fb58d2e09a2a1ce6).(start); |
| 39 | return string_copy_ofcxx . . $ string_copy_of(1320557f0feba62c).(start, end? end : &start[strlencxx . . $ strlen(751346f8406fd082).(start)]); |
| 40 | } |
| 41 | |
| 42 | TestItemcxx . . $ TestItem# *create_test_item_fromcxx . . $ create_test_item_from(4b4482ac30013e03).(const char *specification_name) { |
| 43 | TestItemcxx . . $ TestItem# *test_item = (TestItemcxx . . $ TestItem# *)malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(sizeof(TestItemcxx . . $ TestItem#)); |
| 44 | |
| 45 | test_item->specification_namecxx . . $ test_item#specification_name. = strdupcxx . . $ strdup(a8b8e32347182212).(specification_name); |
| 46 | test_item->context_namecxx . . $ test_item#context_name. = context_name_fromcxx . . $ context_name_from(fb58d2e09a2a1ce6).(specification_name); |
| 47 | test_item->test_namecxx . . $ test_item#test_name. = test_name_fromcxx . . $ test_name_from(fb58d2e09a2a1ce6).(specification_name); |
| 48 | |
| 49 | return test_item; |
| 50 | } |
| 51 | |
| 52 | void destroy_test_itemcxx . . $ destroy_test_item(ca46adf33924622e).(TestItemcxx . . $ TestItem# *item) { |
| 53 | freecxx . . $ free(5d22bdacc48458e8).((void *)item->specification_namecxx . . $ test_item#specification_name.); |
| 54 | freecxx . . $ free(5d22bdacc48458e8).((void *)item->context_namecxx . . $ test_item#context_name.); |
| 55 | freecxx . . $ free(5d22bdacc48458e8).((void *)item->test_namecxx . . $ test_item#test_name.); |
| 56 | freecxx . . $ free(5d22bdacc48458e8).((void *)item); |
| 57 | } |