c++ dos自定义测试框架

2019-12-20 14:50:23 浏览数 (1)

代码语言:javascript复制
LOOP:
  cout << "CHOOSE DEBUG MODE:ntENTER INTO DEFAULT MODEntOTHER INTO MANUL DEBUG MODE:t";

  // char buf[1024] = {0};

  if (getchar() == 10)
  {
    while ((c = getchar()) != EOF && c != 'n')
      ;
    do
    {
      cout << "事件1" << endl;
      cout << "回车继续下一条" << endl;
      c = getchar();
      if (c != 10)
      {
        while ((c = getchar()) != EOF && c != 'n')
          ;
        goto LOOP;
      }
    } while (1);
  }
  else
  {
    while ((c = getchar()) != EOF && c != 'n')
      ;
    do
    {
      char epid[32] = {0};
      char epvalue[32] = {0};
      char *pid = &epid[0];
      char *pval = &epvalue[0];
      cout << "PLEASE ENTER COMMAND INFORMATIONn";
      cout << "tepId:";
      while ((c = getchar()) != 10)
      {
        *pid   = c;
      }

      if (1 > atoi(epid) || epid[0] == ' ' || epid[0] == '')
      {
        cout << "INVALID FUNCTION POINT ID";
        continue;
      }
      cout << "tepvalue:";
      while ((c = getchar()) != 10)
      {
        *pval   = c;
      }

      cout << "事件1" << endl;


      cout << "回车继续下一条" << endl;
      c = getchar();
      if (c != 10)
      {
        while ((c = getchar()) != EOF && c != 'n')
          ;
        goto LOOP;
      }
    } while (1);
  }

0 人点赞