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

nasa / trick / 16179091313

09 Jul 2025 08:05PM UTC coverage: 55.919% (-0.03%) from 55.948%
16179091313

Pull #1922

github

web-flow
Merge 04a907d09 into d9a49c036
Pull Request #1922: Added a check for unconstrained dimensions boundary.

14 of 25 new or added lines in 3 files covered. (56.0%)

4 existing lines in 2 files now uncovered.

12334 of 22057 relevant lines covered (55.92%)

252313.66 hits per line

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

85.71
/trick_source/sim_services/MemoryManager/MemoryManager_ref_attributes.cpp
1

2
#include <string.h>
3
#include <stdio.h>
4
#include <stdlib.h>
5
#include <sstream>
6
#include "trick/MemoryManager.hh"
7
#include "trick/RefParseContext.hh"
8

9
extern int REF_debug;
10

11
REF2 *Trick::MemoryManager::ref_attributes(const char* name) {
12,792✔
12

13
    std::stringstream reference_sstream;
12,792✔
14
    REF2 * result = NULL;
12,792✔
15
    RefParseContext* context = NULL;
12,792✔
16

17
    /** @par Design Details: */
18
    reference_sstream << name;
12,792✔
19

20
    REF_debug = 0;
12,792✔
21

22
    /** @li Create a parse context. */
23
    context = new RefParseContext(this, &reference_sstream);
12,792✔
24

25
    /** @li Call REF_parse to parse the variable reference. */
26
    if (context != NULL) {
12,792✔
27
        int parse_ret = REF_parse(context);
12,792✔
28
        if ( parse_ret == 0) {
12,792✔
29
            /* throw away the reference returned by the ref_parser, it isn't the same
30
               name as requested as "name" */
31
            if ( context->result->reference ) {
12,685✔
32
                free(context->result->reference) ;
12,685✔
33
            }
34
            context->result->reference = strdup(name);
12,685✔
35
            result = context->result;
12,685✔
36
        } else if ( parse_ret == TRICK_PARAMETER_ARRAY_SIZE) {
107✔
37
            /* print out of bounds error message if MM debug_level is greater than 1 */
38
            if (debug_level > 1) {
1✔
NEW
39
                std::stringstream message;
×
NEW
40
                message << name << " contains out of bounds array index.";
×
NEW
41
                emitError(message.str());
×
42
            }
43
        }
44
        /** @li Delete the parse context. */
45
        delete( context);
12,792✔
46
    }
47

48
    /** @li Return the the REF2 object.*/
49
    return ( result);
25,584✔
50
}
51

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