/*====================================================================*\ FILE : TestQcr.c PURPOSE : Utilities for handling QCR files in Pro/TOOLKIT regression tests. HISTORY.. DATE AUTHOR MODIFICATIONS 9 Feb 96 Alistair $$1 06-Oct-97 H-03-25 Pavel $$2 More includes 20-Jan-98 H-03-37 aab $$3 Fixed some bugs for c++ compiler 01-Jun-99 I-03-12 mka $$4 More includes \*====================================================================*/ /*--------------------------------------------------------------------*\ Pro/TOOLKIT includes \*--------------------------------------------------------------------*/ #include #include #include /*--------------------------------------------------------------------*\ Application includes \*--------------------------------------------------------------------*/ #include "TestError.h" #include "UtilString.h" /*====================================================================*\ FUNCTION : TestQcrName() PURPOSE : Generate a name for an output QCR file. \*====================================================================*/ char *ProTestQcrName( ProMdl *model, /* Input - model */ char filext[], /* Input - file extension */ char filename[]) /* Output - file name */ { ProError status; char model_name[30], model_type[10]; char *ProUtilModelnameGet(ProMdl*,char*,char*); /*--------------------------------------------------------------------*\ Get the current model \*--------------------------------------------------------------------*/ if(model == NULL) { status = ProMdlCurrentGet(model); /* No error check so this code can be used out of mode */ TEST_CALL_REPORT("ProMdlCurrentGet()", "ProTestQcrName()", status, status != PRO_TK_NO_ERROR); } /*--------------------------------------------------------------------*\ If there is still no model (so no current mode), use the name "nomodel". \*--------------------------------------------------------------------*/ if(model == NULL) strcpy(filename,"nomodel"); else { /*--------------------------------------------------------------------*\ Use the name of the current model as the file name. \*--------------------------------------------------------------------*/ ProUtilModelnameGet(model, model_name, model_type); strcpy(filename,model_name); } /*--------------------------------------------------------------------*\ Add the file extension. \*--------------------------------------------------------------------*/ strcat(filename,filext); return(filename); }