#include "stat.h"
#include "defines.h"
#include "util.h"
Functions | |
| void | statistic_create (statistic **stat) |
| Creates and initializes a new statistic structure. | |
| bool | statistic_is_empty (statistic *stat) |
| Returns TRUE if the given statistic structure contains no coverage information. | |
| void | statistic_dealloc (statistic *stat) |
| Deallocates memory for a statistic structure. | |
|
|
Creates and initializes a new statistic structure. Allocates new memory for a coverage statistic structure and initializes its values.
00033 { PROFILE(STATISTIC_CREATE);
00034
00035 if( *stat == NULL ) {
00036 *stat = (statistic*)malloc_safe( sizeof( statistic ) );
00037 }
00038
00039 (*stat)->line_hit = 0;
00040 (*stat)->line_excluded = 0;
00041 (*stat)->line_total = 0;
00042 (*stat)->tog01_hit = 0;
00043 (*stat)->tog10_hit = 0;
00044 (*stat)->tog_excluded = 0;
00045 (*stat)->tog_total = 0;
00046 (*stat)->tog_cov_found = FALSE;
00047 (*stat)->comb_hit = 0;
00048 (*stat)->comb_excluded = 0;
00049 (*stat)->comb_total = 0;
00050 (*stat)->state_total = 0;
00051 (*stat)->state_hit = 0;
00052 (*stat)->arc_total = 0;
00053 (*stat)->arc_hit = 0;
00054 (*stat)->arc_excluded = 0;
00055 (*stat)->assert_hit = 0;
00056 (*stat)->assert_excluded = 0;
00057 (*stat)->assert_total = 0;
00058 (*stat)->mem_wr_hit = 0;
00059 (*stat)->mem_rd_hit = 0;
00060 (*stat)->mem_ae_total = 0;
00061 (*stat)->mem_tog01_hit = 0;
00062 (*stat)->mem_tog10_hit = 0;
00063 (*stat)->mem_tog_total = 0;
00064 (*stat)->mem_cov_found = FALSE;
00065 (*stat)->mem_excluded = 0;
00066 (*stat)->show = TRUE;
00067
00068 PROFILE_END;
00069
00070 }
|
|
|
Deallocates memory for a statistic structure. Destroys the specified statistic structure from heap memory.
00104 { PROFILE(STATISTIC_DEALLOC);
00105
00106 if( stat != NULL ) {
00107
00108 /* Free up memory for entire structure */
00109 free_safe( stat, sizeof( statistic ) );
00110
00111 }
00112
00113 PROFILE_END;
00114
00115 }
|
|
|
Returns TRUE if the given statistic structure contains no coverage information.
00078 { PROFILE(STATISTIC_IS_EMPTY);
00079
00080 bool retval; /* Return value for this function */
00081
00082 assert( stat != NULL );
00083
00084 retval = (stat->line_total == 0) &&
00085 (stat->tog_total == 0) &&
00086 (stat->comb_total == 0) &&
00087 (stat->state_total == 0) &&
00088 (stat->arc_total == 0) &&
00089 (stat->assert_total == 0) &&
00090 (stat->mem_ae_total == 0) &&
00091 (stat->mem_tog_total == 0);
00092
00093 PROFILE_END;
00094
00095 return( retval );
00096
00097 }
|
1.3.4