• 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

50.0
/include/trick/parameter_types.h
1
#ifndef PARAMETER_TYPES_H
2
#define PARAMETER_TYPES_H
3

4
/*
5
    PURPOSE: ( Defines the Trick data-types, used in ATTRIBUTES descriptions of
6
               variables, found in io_src files.)
7
*/
8

9
#ifdef __cplusplus
10
extern "C" {
11
#endif
12

13
/**
14
 * The TRICK_STL_CONTAINER_TYPE enumeration represents the Trick STL types.
15
 */
16
    typedef enum {
17
        TRICK_STL_VECTOR            = 0, /* STL vector */
18
        TRICK_STL_ARRAY             = 1, /* STL array */
19
        TRICK_STL_LIST              = 2, /* STL list */
20
        TRICK_STL_DEQUE             = 3, /* STL deque */
21
        TRICK_STL_SET               = 4, /* STL set */
22
        TRICK_STL_MAP               = 5, /* STL map */
23
        TRICK_STL_PAIR              = 6, /* STL pair */
24
        TRICK_STL_QUEUE             = 7, /* STL queue */
25
        TRICK_STL_STACK             = 8, /* STL stack */
26
        TRICK_STL_PRIORITY_QUEUE    = 9, /* STL priority_queue */
27
        TRICK_STL_UNKNOWN
28
    } TRICK_STL_TYPE ;
29

30
/**
31
 * The TRICK_TYPE enumeration represents the Trick data types.
32
 */
33
    typedef enum {
34
        TRICK_VOID               =   0, /* No type */
35
        TRICK_CHARACTER          =   1, /* (char) */
36
        TRICK_UNSIGNED_CHARACTER =   2, /* (unsigned char) */
37
        TRICK_STRING             =   3, /* (char *) */
38
        TRICK_SHORT              =   4, /* (short) */
39
        TRICK_UNSIGNED_SHORT     =   5, /* (unsigned short) */
40
        TRICK_INTEGER            =   6, /* (int) */
41
        TRICK_UNSIGNED_INTEGER   =   7, /* (unsigned int) */
42
        TRICK_LONG               =   8, /* (long) */
43
        TRICK_UNSIGNED_LONG      =   9, /* (unsigned long) */
44
        TRICK_FLOAT              =  10, /* (float) */
45
        TRICK_DOUBLE             =  11, /* (double) */
46
        TRICK_BITFIELD           =  12, /* (signed int : 1) */
47
        TRICK_UNSIGNED_BITFIELD  =  13, /* (unsigned int : 1) */
48
        TRICK_LONG_LONG          =  14, /* (long long) */
49
        TRICK_UNSIGNED_LONG_LONG =  15, /* (long long) */
50
        TRICK_FILE_PTR           =  16, /* (file *) */
51
        TRICK_BOOLEAN            =  17, /* (C++ boolean) */
52
        TRICK_WCHAR              =  18, /* (wchar_t) */
53
        TRICK_WSTRING            =  19, /* (wchar_t *) */
54
        TRICK_VOID_PTR           =  20, /* an arbitrary address */
55
        TRICK_ENUMERATED         =  21, /* User defined type (enumeration) */
56
        TRICK_STRUCTURED         =  22, /* User defined type (struct/class) */
57
        TRICK_OPAQUE_TYPE        =  23, /* User defined type (where type details are as yet unknown) */
58
        TRICK_STL                =  24, /* Standard template library type */
59
        TRICK_NUMBER_OF_TYPES
60
    } TRICK_TYPE ;
61

62
const char* trickTypeCharString( TRICK_TYPE type, const char* name);
2,733✔
NEW
63
const char* trickSTLTypeCharString( TRICK_STL_TYPE type);
×
64

65
/* here for backwards compatibility */
66
#define TRICK_USER_DEFINED_TYPE TRICK_OPAQUE_TYPE
67

68
/* Define int_64t and uint_64t depending on compiler options */
69
#if __linux__
70
#  include <stdint.h>
71
#  include <sys/types.h>
72
#  if __WORDSIZE == 64
73
#    define TRICK_INT64 TRICK_LONG
74
#    define TRICK_UINT64 TRICK_UNSIGNED_LONG
75
#  else
76
#    define TRICK_INT64 TRICK_LONG_LONG
77
#    define TRICK_UINT64 TRICK_UNSIGNED_LONG_LONG
78
#  endif
79
#endif
80

81
#if __APPLE__
82
   /* only checked the 32bit version of the OS, have no access to 64 bit version */
83
#  include <stdint.h>
84
#  include <sys/types.h>
85
#  define TRICK_INT64 TRICK_LONG_LONG
86
#  define TRICK_UINT64 TRICK_UNSIGNED_LONG_LONG
87
#endif
88

89
#if __QNX__
90
#  include <stdint.h>
91
#  include <sys/types.h>
92
#  if __INT_BITS__ == 64
93
#    define TRICK_INT64 TRICK_LONG
94
#    define TRICK_UINT64 TRICK_UNSIGNED_LONG
95
#  else
96
#    define TRICK_INT64 TRICK_LONG_LONG
97
#    define TRICK_UINT64 TRICK_UNSIGNED_LONG_LONG
98
#  endif
99
#endif
100

101
#if __Lynx__
102
#  include <stdint.h>
103
#  include <sys/types.h>
104
#  define TRICK_INT64 TRICK_LONG_LONG
105
#  define TRICK_UINT64 TRICK_UNSIGNED_LONG_LONG
106
#endif
107

108
#if __sgi
109
#  include <sgidefs.h>
110
#  include <sys/types.h>
111
#  if _MIPS_SZLONG == 64
112
#    define TRICK_INT64 TRICK_LONG
113
#    define TRICK_UINT64 TRICK_UNSIGNED_LONG
114
#  else
115
#    define TRICK_INT64 TRICK_LONG_LONG
116
#    define TRICK_UINT64 TRICK_UNSIGNED_LONG_LONG
117
#  endif
118
#endif
119

120
#ifdef __cplusplus
121
}
122
#endif
123
#endif
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