⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 r2outset.c

📁 这是一个C程序分析工具
💻 C
字号:
/*====================================================================*/
/*  UNIT   :  @(#)r2outset.c	2.4  -  08/04/99 */
/*====================================================================*/
/*  PURPOSE:  Writes an output report showing, for each component,    */
/*            which of the sets defined in M. Scully, "Augmenting     */
/*            Program Understanding Strategies with Test Case         */
/*            Based Methods", it belongs in.                          */
/*            The computation compares the With and Tot counts for    */
/*            each component to the overall number of cases With      */
/*            and Tot in the r2anl.lst file. (Note: "with" refers    */
/*            to test cases that exhibit the feature being sought     */
/*            while "tot" is the total number of cases                */
/*            The set membership rules are that a component is in:    */
/*               ICOMPS (abrev. IC) if With >0                        */
/*               IICOMPS (II) if With = CasesWith                     */
/*               CCOMPS (CC) if Tot = CasesTot                        */
/*               RCOMPS (RC) if With = CasesWith and Tot < casesTot   */
/*               SHARED (SH) if With = CasesWith and Tot < casesTot   */
/*                              and With < Tot                        */
/*               UCOMPS (UC) if With = Tot                            */
/*                                                                    */
/*  USED BY:  main()                                                  */
/*                                                                    */
/*  HISTORY:                                                          */
/*  VER   DATE       AUTHOR        DESCRIPTION                        */
/*       5 Nov 93    N. Wilde    Created unit.                        */
/*  1.01 30 Mar 97   L. Landry   Added btree interface                */
/*  2.2  31 Jan 98   W. Hall     Changed a format descriptor to clean */
/*                               up a compiler warning issue.         */
/*  2.30 18 Apr 98   A. Conwell  TISK30 changes                       */
/*--------------------------------------------------------------------*/

/*==[ INTERFACE ]=====================================================*/

#include "r2.h"
#include "r2outset.h"
#include <stdio.h>

/*==[ PRIVATE IMPLEMENTATION ]========================================*/

#include <string.h>

/*==[ PUBLIC IMPLEMENTATION ]=========================================*/

/*--------------------------------------------------------------------*/
/*  FUNCTION        ReadTestData                                      */
/*--------------------------------------------------------------------*/

extern void OutputSets(
  COMPLIST  	*cl,			/* Final component list   */
  int		casesWith,		/* Cnt. cases that exhibit feature*/
  int		casesTot,		/* Cnt. test cases total */
  Tree          *ptree                  /* Binary tree with source file*/
)
{
  COMPELEM	*elem;			/* Component node	      */
  COMPNODE	*node;

  if (2 == gTALK)
    printf( "R2Analyz: casesWith = %i; casesTot= %i\n", casesWith, casesTot );

  /* Iterate over the entire list */
  node=get_first_node(cl);

  /* Traverse the entire list, printing the sets each comp is in */

  do
  {
    elem=(COMPELEM *)node->key;
    printf("%s %05u %c ", SeekOut(elem->Index, ptree), elem->Line, elem->Cval);
    if ('S' == elem->Cval) printf("%10li ", elem->Sval);
    if (elem->With > 0) printf("#IC# ");
    if (elem->With == casesWith) printf("#II# ");
    if (elem->Tot == casesTot) printf("#CC# ");
    if ((elem->With == casesWith)&&(elem->Tot < casesTot)) printf("#RC# ");
    if ( (elem->With == casesWith)
       &&(elem->Tot < casesTot)
       &&(elem->With < elem->Tot)) printf("#SH# ");
    if (elem->With == elem->Tot) printf("#UC# ");
    printf("\n");
    node=get_successor(node);
  } while (node->key!=NULL);

} /* OutputSets() */

/*====================================================================*/
/*  EOF    :  r2outset.c                                                */
/*====================================================================*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -