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

nasa / trick / 8557346443

04 Apr 2024 03:33PM UTC coverage: 55.952% (+0.02%) from 55.934%
8557346443

push

github

web-flow
In MemoryManager change delete_var(const char*) to delete_var(std::string) (#1687)

2 of 2 new or added lines in 1 file covered. (100.0%)

1 existing line in 1 file now uncovered.

12287 of 21960 relevant lines covered (55.95%)

70034.67 hits per line

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

87.88
/trick_source/sim_services/Message/MessageCout.cpp
1

2
#include "trick/MessageCout.hh"
3
#include "trick/message_type.h"
4

5
#include <sstream>
6

7
Trick::MessageCout::MessageCout() {
208✔
8
    /** By default, this subscriber is enabled when it is created. */
9
    enabled = 1 ;
208✔
10
    color = 1 ;
208✔
11
    name = "cout" ;
208✔
12
}
208✔
13

14
void Trick::MessageCout::update( unsigned int level , std::string header , std::string message ) {
1,926✔
15

16
    /** @par Design Details: */
17
    std::string color_code ;
3,852✔
18

19
    switch (level) {
1,926✔
20
        case MSG_NORMAL :
1,803✔
21
            color_code = "\033[00m" ; // normal
1,803✔
22
            break ;
1,803✔
23
        case MSG_INFO :
53✔
24
            color_code = "\033[32m" ; // green
53✔
25
            break ;
53✔
26
        case MSG_WARNING :
13✔
27
            color_code = "\033[33m" ; // yellow
13✔
28
            break ;
13✔
29
        case MSG_ERROR :
26✔
30
            color_code = "\033[31m" ; // red
26✔
31
            break ;
26✔
32
        case MSG_DEBUG :
×
33
            color_code = "\033[36m" ; // cyan
×
34
            break ;
×
35
        default :
31✔
36
            color_code = "\033[00m" ; // normal
31✔
37
            break ;
31✔
38
    }
39

40
    /** @li Prints the received message to the standard output stream. */
41
    if (enabled && level < 100 ) {
1,926✔
42

43
        // Building the final string in a temporary stream ensures an automic call to cout, which prevents
44
        // multithreaded sims from interleaving header and message elements.
45
        std::ostringstream oss;
1,926✔
46
        if ( color ) {
1,926✔
47
            oss << header << color_code << message << "\033[00m" ;
1,926✔
48
        } else {
UNCOV
49
            oss << header << message ;
×
50
        }
51
        std::cout << oss.str() << std::flush;
1,926✔
52
    }
53
}
1,926✔
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

© 2025 Coveralls, Inc