• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nasa / trick / 20283694683

16 Dec 2025 09:44PM UTC coverage: 55.586% (-0.3%) from 55.934%
20283694683

push

github

web-flow
Add vs support for stl vector, deque, and array containers of supported data types (#1996)

* Added TV GUI side support for vectors

* Initial check-in for variable server to support vector.

* Added accessor functions to ATTRIBUTES to get stl container size and element at index so mm ref_dim can get element at index for a vector as getting element of an array plus bounds check for vector.

* Added support to deque and array as they be treated similar to vector.

* Updated the test due to vs vector support change.

* Added vector/deque/array of TRICK_STRUCTURED data type support.

* Updated to support vector<bool>.

* Updated to support vector/deque/array of *.

* Updated to support vector/deque/array of TRICK_ENUMERATED and display enum name for the stl enum elements for TV; also updated to show bool element as normal bool var for TV.

* Made elements of vector/array/deque to be editable from TV.

* Not to change the stl type to element when not indexing.

* Added special handling for updating vector of bool since std::vector<bool> is optimized to store bits compactly (8 bools per byte) in c++.

* Need to print NULL for the newly added ATTRIBUTES assessor function for filed attributes in io src file.

* Added var_get_stl_size command to vs sesssion and updated tv to show index range as constraint arrays for vector/deque/array when adding a var.

* Added test cases for vector/deque/array and also changed to use its own vs msg type for var_get_stl_size.

* Removed the unused function as it was changed to use clang api instead.

* Updated not to use static temp attr for working on storing vector<boo> to its ref_attr.

---------

Co-authored-by: plherrin <pherring04@gmail.com>

46 of 212 new or added lines in 8 files covered. (21.7%)

2 existing lines in 2 files now uncovered.

12508 of 22502 relevant lines covered (55.59%)

304713.82 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

68.29
/trick_source/sim_services/MemoryManager/trickTypeCharString.c
1

2
#include "trick/parameter_types.h"
3

4
const char* trickTypeCharString( TRICK_TYPE type, const char* name) {
5

6
    const char *type_spec;
7
    switch (type) {
2,733✔
8
       case TRICK_VOID:               type_spec = "void"; break;
1✔
9
       case TRICK_CHARACTER:          type_spec = "char"; break;
145✔
10
       case TRICK_UNSIGNED_CHARACTER: type_spec = "unsigned char"; break;
1✔
11
       case TRICK_STRING:             type_spec = "std::string"; break;
2,073✔
12
       case TRICK_SHORT:              type_spec = "short"; break;
4✔
13
       case TRICK_UNSIGNED_SHORT:     type_spec = "unsigned short"; break;
1✔
14
       case TRICK_INTEGER:            type_spec = "int"; break;
86✔
15
       case TRICK_UNSIGNED_INTEGER:   type_spec = "unsigned int"; break;
6✔
16
       case TRICK_LONG:               type_spec = "long"; break;
2✔
17
       case TRICK_UNSIGNED_LONG:      type_spec = "unsigned long"; break;
2✔
18
       case TRICK_FLOAT:              type_spec = "float"; break;
2✔
19
       case TRICK_DOUBLE:             type_spec = "double"; break;
104✔
20
       case TRICK_BITFIELD:           type_spec = "TRICK_BITFIELD"; break;
1✔
21
       case TRICK_UNSIGNED_BITFIELD:  type_spec = "TRICK_UNSIGNED_BITFIELD"; break;
1✔
22
       case TRICK_LONG_LONG:          type_spec = "long long"; break;
5✔
23
       case TRICK_UNSIGNED_LONG_LONG: type_spec = "unsigned long long"; break;
1✔
24
       case TRICK_FILE_PTR:           type_spec = "FILE*"; break;
1✔
25
       case TRICK_BOOLEAN:            type_spec = "bool"; break;
4✔
26
       case TRICK_WCHAR:              type_spec = "wchar_t"; break;
1✔
27
       case TRICK_WSTRING:            type_spec = "wchar_t*"; break;
1✔
28
       case TRICK_VOID_PTR:           type_spec = "void*"; break;
1✔
29
       case TRICK_ENUMERATED:         type_spec = name; break;
9✔
30
       case TRICK_STRUCTURED:         type_spec = name; break;
278✔
31
       case TRICK_OPAQUE_TYPE:        type_spec = name;  break;
1✔
32
       case TRICK_STL:                type_spec = name;  break;
1✔
33
       default:                       type_spec = "UNKNOWN_TYPE"; break;
1✔
34
    }
35
    return (type_spec);
2,733✔
36
}
37

38
const char* trickSTLTypeCharString( TRICK_STL_TYPE type) {
39
    const char *type_spec;
NEW
40
    switch (type) {
×
NEW
41
       case TRICK_STL_VECTOR:         type_spec = "std::vector"; break;
×
NEW
42
       case TRICK_STL_ARRAY:          type_spec = "std::array"; break;
×
NEW
43
       case TRICK_STL_LIST:           type_spec = "std::list"; break;
×
NEW
44
       case TRICK_STL_DEQUE:          type_spec = "std::deque"; break;
×
NEW
45
       case TRICK_STL_SET:            type_spec = "std::set"; break;
×
NEW
46
       case TRICK_STL_MAP:            type_spec = "std::map"; break;
×
NEW
47
       case TRICK_STL_PAIR:           type_spec = "std::pair"; break;
×
NEW
48
       case TRICK_STL_QUEUE:          type_spec = "std::queue"; break;
×
NEW
49
       case TRICK_STL_STACK:          type_spec = "std::stack"; break;
×
NEW
50
       case TRICK_STL_PRIORITY_QUEUE: type_spec = "std::priority_queue"; break;
×
NEW
51
       default:                       type_spec = "UNKNOWN_TYPE"; break;
×
52
    }
NEW
53
    return (type_spec);
×
54
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc