(file) Return to Tracer.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common / tests / Tracer

  1 karl  1.26 //%2006////////////////////////////////////////////////////////////////////////
  2 mike  1.2  //
  3 karl  1.18 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
  4            // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
  5            // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
  6 karl  1.16 // IBM Corp.; EMC Corporation, The Open Group.
  7 karl  1.18 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
  8            // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
  9 karl  1.21 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 10            // EMC Corporation; VERITAS Software Corporation; The Open Group.
 11 karl  1.26 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 12            // EMC Corporation; Symantec Corporation; The Open Group.
 13 mike  1.2  //
 14            // Permission is hereby granted, free of charge, to any person obtaining a copy
 15            // of this software and associated documentation files (the "Software"), to
 16            // deal in the Software without restriction, including without limitation the
 17            // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 18            // sell copies of the Software, and to permit persons to whom the Software is
 19            // furnished to do so, subject to the following conditions:
 20 kumpf 1.9  // 
 21 mike  1.2  // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 22            // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 23            // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 24            // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 25            // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 26            // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 27            // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 28            // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 29            //
 30            //==============================================================================
 31            //
 32            // Author: Sushma Fernandes (sushma_fernandes@hp.com)
 33            //
 34 kumpf 1.4  // Modified By: Jenny Yu (jenny_yu@hp.com)
 35 kumpf 1.11 //              Carol Ann Krug Graves, Hewlett-Packard Company
 36            //                (carolann_graves@hp.com)
 37 a.arora 1.17 //              Amit K Arora, IBM (amita@in.ibm.com) for PEP#101
 38 david.dillard 1.25 //              David Dillard, VERITAS Software Corp.
 39                    //                  (david.dillard@veritas.com)
 40 mike          1.2  //
 41                    //%/////////////////////////////////////////////////////////////////////////////
 42                    
 43                    #include <fstream>
 44                    #include <cstring>
 45                    #include <Pegasus/Common/System.h>
 46                    #include <Pegasus/Common/Tracer.h>
 47 a.arora       1.17 #include <Pegasus/Common/AutoPtr.h>
 48 mike          1.2  
 49                    PEGASUS_USING_STD;
 50                    PEGASUS_USING_PEGASUS;
 51                    
 52                    // If Windows platform then set the EOF_CHAR to 2
 53                    #if defined(PEGASUS_OS_TYPE_WINDOWS)
 54                        #define EOF_CHAR 2
 55                    #else
 56                        #define EOF_CHAR 1
 57                    #endif
 58                    
 59                    // Trace files for test purposes
 60 kumpf         1.11 // Will be created in the $(PEGASUS_TMP) directory, or if not set,
 61                    // in the current directory
 62 kumpf         1.15 CString FILE1;
 63                    CString FILE2;
 64                    CString FILE3;
 65                    CString FILE4;
 66 mike          1.2  
 67                    // 
 68                    // Reads the last trace message from a given trace file and compares the 
 69                    // given string with the string read from file
 70                    //
 71                    // return 0 if the strings match
 72                    // return 1 if the strings do not match
 73                    //
 74                    Uint32 compare(const char* fileName, const char* compareStr)
 75                    {
 76                        Uint32 count=0;
 77                        Uint32 retCode=0;
 78                        fstream file;
 79 david.dillard 1.23     Uint32 size= static_cast<Uint32>(strlen(compareStr));
 80 a.arora       1.17     AutoArrayPtr<char> readStr(new char[size+EOF_CHAR+1]);
 81 mike          1.2  
 82                        file.open(fileName,fstream::in);
 83                        if (!file.good())
 84                        {
 85 a.arora       1.17       return 1;
 86 mike          1.2      }
 87 david.dillard 1.22     file.seekg((Sint32) -(static_cast<Sint32>(size)+EOF_CHAR),fstream::end);
 88 a.arora       1.17     memset(readStr.get(), 0, (size+EOF_CHAR+1)*sizeof(char));
 89 david.dillard 1.25     file.read(readStr.get(),size+EOF_CHAR);
 90 a.arora       1.17     (readStr.get())[size]='\0';
 91                        retCode=strcmp(compareStr,readStr.get());
 92 karl          1.27 
 93                        /* Diagnostic to determnine string differences
 94                        if (!retCode)
 95                            cout << "Compare Error: compareStr= \n\"" << compareStr 
 96                                << "\". readStr= \n\"" << readStr.get() << "\"" << endl;
 97                        */
 98                    
 99 mike          1.2      file.close();
100                        return retCode;
101                    }
102                    
103                    //
104                    // Description:
105                    // Trace properties file, level and component are not set
106                    // Should not log a trace message
107                    //
108                    // Type:
109                    // Negative 
110                    //
111                    // return 0 if the test passed
112                    // return 1 if the test failed
113                    //
114                    Uint32 test1()
115                    {
116                        const char* METHOD_NAME = "test1";
117 kumpf         1.10     PEG_METHOD_ENTER(TRC_CONFIG,METHOD_NAME);
118 mike          1.2      Tracer::trace(__FILE__,__LINE__,TRC_CONFIG,Tracer::LEVEL2,"%s %d",
119                    	"This message should not appear value=",123);
120 kumpf         1.10     PEG_METHOD_EXIT();
121 mike          1.2      return(compare(FILE1,""));
122                    }
123                    
124                    //
125                    // Description:
126                    // Trace properties level and component are not set
127                    // Should not log a trace message
128                    //
129                    // Type:
130                    // Negative 
131                    //
132                    // return 0 if the test passed
133                    // return 1 if the test failed
134                    //
135                    Uint32 test2()
136                    {
137                        const char* METHOD_NAME = "test2";
138                        Tracer::setTraceFile(FILE1);
139 kumpf         1.10     PEG_METHOD_ENTER(TRC_CONFIG,METHOD_NAME);
140 mike          1.2      Tracer::trace(__FILE__,__LINE__,TRC_CONFIG,Tracer::LEVEL2,"%s %d",
141                    	"This message should not appear value=",123);
142                        return(compare(FILE1,"This message should not appear value=123"));
143                    }
144                    
145                    //
146                    // Description:
147                    // Trace properties component is not set
148                    // Should not log a trace message
149                    //
150                    // Type:
151                    // Negative 
152                    //
153                    // return 0 if the test passed
154                    // return 1 if the test failed
155                    //
156                    Uint32 test3()
157                    {
158                        const char* METHOD_NAME = "test3";
159                        Tracer::setTraceLevel(Tracer::LEVEL1);
160 kumpf         1.10     PEG_METHOD_ENTER(TRC_CONFIG,METHOD_NAME);
161 mike          1.2      Tracer::trace(__FILE__,__LINE__,TRC_CONFIG,Tracer::LEVEL2,"%s",
162                    	"This message should not appear");
163                        return(compare(FILE1,"This message should not appear"));
164                    }
165                    
166                    //
167                    // Description:
168                    // Trace properties file, level and component are set
169                    // should log a trace message
170                    //
171                    // Type:
172                    // Positive 
173                    //
174                    // return 0 if the test passed
175                    // return 1 if the test failed
176                    //
177                    Uint32 test4()
178                    {
179                        const char* METHOD_NAME = "test4";
180                        Tracer::setTraceComponents("Config");
181 kumpf         1.10     PEG_METHOD_ENTER(TRC_CONFIG,METHOD_NAME);
182 mike          1.2      return(compare(FILE1,"Entering method test4"));
183                    }
184                    
185                    //
186                    // Description:
187                    // Trace component is set to an invalid component
188                    // should not log a trace message
189                    //
190                    // Type:
191                    // Negative 
192                    //
193                    // return 0 if the test passed
194                    // return 1 if the test failed
195                    //
196                    Uint32 test5()
197                    {
198                        const char* METHOD_NAME = "test5";
199                        Tracer::setTraceComponents("Wrong Component Name");
200 karl          1.27 
201                        PEG_METHOD_ENTER(TRC_CONFIG,METHOD_NAME);
202                        PEG_METHOD_EXIT();
203 mike          1.2      return(compare(FILE1,"Entering method test4"));
204                    }
205                    
206                    //
207                    // Description:
208                    // Trace level is set to LEVEL 2 and logs a LEVEL 4 message 
209                    // should not log a trace message
210                    //
211                    // Type:
212                    // Negative 
213                    //
214                    // return 0 if the test passed
215                    // return 1 if the test failed
216                    //
217                    
218                    Uint32 test6()
219                    {
220                        const char* METHOD_NAME = "test6";
221                        Tracer::setTraceComponents("Config");
222                        Tracer::setTraceLevel(Tracer::LEVEL2);
223                        Tracer::trace(TRC_CONFIG,Tracer::LEVEL2,"%s %s",
224 mike          1.2  	"Test Message for Level2 in",METHOD_NAME);
225                        Tracer::trace(__FILE__,__LINE__,TRC_CONFIG,Tracer::LEVEL2,"%s %s",
226                    	"Test Message for Level2 in",METHOD_NAME);
227                        Tracer::trace(__FILE__,__LINE__,TRC_CONFIG,Tracer::LEVEL4,"%s",
228                    	"This Message should not appear");
229                        return(compare(FILE1,"Test Message for Level2 in test6"));
230                    }
231                    
232                    //
233                    // Description:
234                    // Trace level is set to an invalid level
235                    // should not log a trace message
236                    //
237                    // Type:
238                    // Negative 
239                    //
240                    // return 0 if the test passed
241                    // return 1 if the test failed
242                    //
243                    Uint32 test7()
244                    {
245 mike          1.2      const char* METHOD_NAME = "test7";
246                        Tracer::setTraceLevel(100);
247 karl          1.27     PEG_METHOD_ENTER(TRC_CONFIG,METHOD_NAME);
248                        PEG_METHOD_EXIT();
249 mike          1.2      return(compare(FILE1,"Test Message for Level2 in test6"));
250                    }
251                    
252                    //
253                    // Description:
254                    // Trace level is set to LEVEL1 for a non entry/exit message
255                    // should not log a trace message, should log an error
256                    //
257                    // Type:
258                    // Negative 
259                    //
260                    // return 0 if the test passed
261                    // return 1 if the test failed
262                    //
263                    Uint32 test8()
264                    {
265                        const char* METHOD_NAME = "test8";
266                        Tracer::setTraceLevel(Tracer::LEVEL1);
267                        Tracer::trace(__FILE__,__LINE__,TRC_CONFIG,Tracer::LEVEL1,"%s",
268 karl          1.27         "Test Message for Level4");
269 mike          1.2      return(compare(FILE1,"Test Message for Level2 in test6"));
270                    }
271                    
272                    //
273                    // Description:
274                    // Changes the trace file to FILE2 
275                    //
276                    // Type:
277                    // Positive 
278                    //
279                    // return 0 if the test passed
280                    // return 1 if the test failed
281                    //
282                    Uint32 test9()
283                    {
284                        const char* METHOD_NAME = "test9";
285                        Tracer::setTraceLevel(Tracer::LEVEL3);
286                        Tracer::setTraceFile(FILE2);
287                    
288 kumpf         1.10     PEG_METHOD_ENTER(TRC_CONFIG,METHOD_NAME);
289 mike          1.2      Tracer::trace(TRC_CONFIG,Tracer::LEVEL3,"%s %s",
290                    	"Test Message for Level3 in",METHOD_NAME);
291                        return(compare(FILE2,"Test Message for Level3 in test9"));
292                    }
293                    
294                    //
295                    // Description:
296                    // Passes invalid component in the trace call
297                    // should not log a trace message
298                    //
299                    // Type:
300                    // Negative 
301                    //
302                    // return 0 if the test passed
303                    // return 1 if the test failed
304                    //
305 karl          1.27 // This test not required with change t0
306                    // use and test macros only.
307 mike          1.2  
308                    Uint32 test10()
309                    {
310                        const char* METHOD_NAME = "test10";
311                        Tracer::setTraceComponents("ALL");
312 karl          1.27     PEG_METHOD_ENTER(TRC_CONFIG,METHOD_NAME);
313                        PEG_METHOD_EXIT();
314 mike          1.2      return(compare(FILE2,"Test Message for Level3 in test9"));
315                    }
316                    
317                    //
318                    // Description:
319                    // Implements trace call for Tracer::Level1
320                    // should log a trace message
321                    //
322                    // Type:
323                    // Positive 
324                    //
325                    // return 0 if the test passed
326                    // return 1 if the test failed
327                    //
328                    
329                    Uint32 test11()
330                    {
331                        const char* METHOD_NAME = "test11";
332                        Tracer::setTraceComponents("ALL");
333                        Tracer::setTraceLevel(Tracer::LEVEL4);
334 kumpf         1.10     PEG_METHOD_ENTER(TRC_CONFIG,METHOD_NAME);
335 mike          1.2      return(compare(FILE2,"Entering method test11"));
336                    }
337                    
338                    //
339                    // Description:
340                    // Implements trace call for Tracer::Level1
341                    // should log a trace message
342                    //
343                    // Type:
344                    // Positive 
345                    //
346                    // return 0 if the test passed
347                    // return 1 if the test failed
348                    //
349                    
350                    Uint32 test12()
351                    {
352                        const char* METHOD_NAME = "test12";
353                        Tracer::setTraceComponents("ALL");
354                        Tracer::setTraceLevel(Tracer::LEVEL4);
355 karl          1.27     PEG_METHOD_ENTER(TRC_CONFIG,METHOD_NAME);
356                        PEG_METHOD_EXIT();
357 mike          1.2      return(compare(FILE2,"Exiting method test12"));
358                    }
359                    
360                    //
361                    // Description:
362                    // Implements trace call for Tracer::Level2
363                    // should log a trace message
364                    //
365                    // Type:
366                    // Positive 
367                    //
368                    // return 0 if the test passed
369                    // return 1 if the test failed
370                    //
371                    
372                    Uint32 test13()
373                    {
374                        const char* METHOD_NAME = "test13";
375                        Tracer::setTraceComponents("ALL");
376                        Tracer::setTraceLevel(Tracer::LEVEL4);
377                        Tracer::trace(__FILE__,__LINE__,TRC_CONFIG,Tracer::LEVEL2,"%s %s",
378 mike          1.2  	"Test Message for Level2 in",METHOD_NAME);
379                        return(compare(FILE2,"Test Message for Level2 in test13"));
380                    }
381                    
382                    //
383                    // Description:
384                    // Implements trace call for Tracer::Level3
385                    // should log a trace message
386                    //
387                    // Type:
388                    // Positive 
389                    //
390                    // return 0 if the test passed
391                    // return 1 if the test failed
392                    //
393                    
394                    Uint32 test14()
395                    {
396                        const char* METHOD_NAME = "test14";
397                        Tracer::setTraceComponents("ALL");
398                        Tracer::setTraceLevel(Tracer::LEVEL4);
399 mike          1.2      Tracer::setTraceFile(FILE3);
400                        Tracer::trace(__FILE__,__LINE__,TRC_CONFIG,Tracer::LEVEL3,"%s %s",
401                    	"Test Message for Level3 in",METHOD_NAME);
402                        return(compare(FILE3,"Test Message for Level3 in test14"));
403                    }
404                    
405                    //
406                    // Description:
407                    // Implements trace call for Tracer::Level4
408                    // should log a trace message
409                    //
410                    // Type:
411                    // Positive 
412                    //
413                    // return 0 if the test passed
414                    // return 1 if the test failed
415                    //
416                    
417                    Uint32 test15()
418                    {
419                        const char* METHOD_NAME = "test15";
420 mike          1.2      Tracer::setTraceComponents("ALL");
421                        Tracer::setTraceLevel(Tracer::LEVEL4);
422                        Tracer::trace(__FILE__,__LINE__,TRC_CONFIG,Tracer::LEVEL4,"%s %s",
423                    	"Test Message for Level4 in",METHOD_NAME);
424                        return(compare(FILE3,"Test Message for Level4 in test15"));
425                    }
426                    
427                    //
428                    // Description:
429                    // calls the setTraceComponents with null string
430                    // should log a trace message
431                    //
432                    // Type:
433                    // Negative 
434                    //
435                    // return 0 if the test passed
436                    // return 1 if the test failed
437                    //
438                    
439                    Uint32 test16()
440                    {
441 mike          1.2      const char* METHOD_NAME = "test16";
442                        Tracer::setTraceComponents("");
443                        Tracer::setTraceLevel(Tracer::LEVEL4);
444                        Tracer::trace(__FILE__,__LINE__,TRC_CONFIG,Tracer::LEVEL4,"%s %s",
445                    	"This Message should not appear in",METHOD_NAME);
446                        return(compare(FILE3,"Test Message for Level4 in test15"));
447                    }
448                    
449                    //
450                    // Description:
451                    // calls the setTraceComponents with one valid and another invalid component
452                    // should log a trace message
453                    //
454                    // Type:
455                    // Negative 
456                    //
457                    // return 0 if the test passed
458                    // return 1 if the test failed
459                    //
460                    
461                    Uint32 test17()
462 mike          1.2  {
463                        const char* METHOD_NAME = "test17";
464 kumpf         1.3      Tracer::setTraceComponents("InvalidComp");
465 mike          1.2      Tracer::setTraceLevel(Tracer::LEVEL4);
466                        Tracer::trace(__FILE__,__LINE__,TRC_CONFIG,Tracer::LEVEL4,"%s %s",
467                    	"This Message should not appear in",METHOD_NAME);
468                        return(compare(FILE3,"Test Message for Level4 in test15"));
469                    }
470 kumpf         1.3  //
471                    // Description:
472                    // calls the _traceBuffer call
473                    // should log a trace message
474                    //
475                    // Type:
476                    // Positive
477                    //
478                    // return 0 if the test passed
479                    // return 1 if the test failed
480                    //
481                    
482                    Uint32 test18()
483                    {
484                        const char* METHOD_NAME = "test18";
485                        Tracer::setTraceComponents("Config,InvalidComp");
486                        Tracer::setTraceLevel(Tracer::LEVEL4);
487                        Tracer::traceBuffer(__FILE__,__LINE__,TRC_CONFIG,Tracer::LEVEL4,
488                            "This Message should appear in",4);
489                        Tracer::traceBuffer(TRC_CONFIG,Tracer::LEVEL4,
490                            "This Message should appear in",4);
491 kumpf         1.3      return(compare(FILE3,"This"));
492                    }
493                    
494                    //
495                    // Description:
496                    // calls the isValid call 
497                    // should not log a trace message
498                    //
499                    // Type:
500                    // Positive
501                    //
502                    // return 0 if the test passed
503                    // return 1 if the test failed
504                    //
505                    
506                    Uint32 test19()
507                    {
508 kumpf         1.4      const char* METHOD_NAME = "test18";
509                        Tracer::setTraceComponents("Config,InvalidComp");
510 kumpf         1.3      Tracer::setTraceLevel(Tracer::LEVEL4);
511 kumpf         1.4      Tracer::traceBuffer(__FILE__,__LINE__,TRC_CONFIG,Tracer::LEVEL4,
512                            "This Message should appear in",4);
513                        Tracer::traceBuffer(TRC_CONFIG,Tracer::LEVEL4,
514                            "This Message should appear in",4);
515 kumpf         1.3      return(compare(FILE3,"This"));
516                    }
517 mike          1.2  
518 kumpf         1.4  //
519                    // Description:
520                    // Trace a string.
521                    // Calls the _traceString() method
522                    // should log a trace message
523                    //
524                    // Type:
525                    // Positive
526                    //
527                    // return 0 if the test passed
528                    // return 1 if the test failed
529                    //
530                    
531                    Uint32 test20()
532                    {
533                        const char* METHOD_NAME = "test20";
534                        Tracer::setTraceFile(FILE4);
535                        Tracer::setTraceComponents("ALL");
536                        Tracer::setTraceLevel(Tracer::LEVEL4);
537                    
538                        PEG_METHOD_ENTER(TRC_CONFIG, METHOD_NAME);
539 kumpf         1.4      Tracer::trace(__FILE__,__LINE__,TRC_CONFIG,Tracer::LEVEL4,
540                    	"Test Message for Level4 in test20");
541                        return(compare(FILE4,"Test Message for Level4 in test20"));
542                    }
543                    
544                    //
545                    // Description:
546                    // Trace a CIMException.
547                    // Calls the traceCIMException() method
548                    // should log a trace message
549                    //
550                    // Type:
551                    // Positive
552                    //
553                    // return 0 if the test passed
554                    // return 1 if the test failed
555                    //
556                    
557                    Uint32 test21()
558                    {
559                        const char* METHOD_NAME = "test21";
560 kumpf         1.4      Tracer::setTraceFile(FILE4);
561                        Tracer::setTraceComponents("ALL");
562                        Tracer::setTraceLevel(Tracer::LEVEL4);
563                    
564                        PEG_METHOD_ENTER(TRC_CONFIG, METHOD_NAME);
565                    
566                        // test tracing CIMException
567                        try
568                        {
569                            throw PEGASUS_CIM_EXCEPTION(
570                                CIM_ERR_NOT_SUPPORTED, 
571                                "CIM Exception Message for Level4 in test21.");
572                        }
573 kumpf         1.12     catch (CIMException& e)
574 kumpf         1.4      {
575                            Tracer::traceCIMException(TRC_CONFIG,Tracer::LEVEL4, e);
576                        }
577                    
578                        return 0;
579                    }
580                    
581                    //
582                    // Description:
583                    // Trace a string using macro.
584                    // should log a trace message
585                    //
586                    // Type:
587                    // Positive
588                    //
589                    // return 0 if the test passed
590                    // return 1 if the test failed
591                    //
592                    Uint32 test22()
593                    {
594                        const char* METHOD_NAME = "test22";
595 kumpf         1.4      Tracer::setTraceFile(FILE4);
596                        Tracer::setTraceComponents("ALL");
597                        Tracer::setTraceLevel(Tracer::LEVEL4);
598                    
599                        PEG_METHOD_ENTER(TRC_CONFIG, METHOD_NAME);
600                    
601                        PEG_TRACE_STRING(TRC_CONFIG,Tracer::LEVEL4,"Test message for Level4 in test22.");
602                    
603                        return(compare(FILE4,"Test message for Level4 in test22."));
604                    }
605                    
606 karl          1.7  int main(int argc, char** argv)
607 mike          1.2  {
608                    
609                    // Execute the tests only if trace calls are included
610                    
611                    #ifdef PEGASUS_REMOVE_TRACE
612 karl          1.7      cout << argv[0] << " +++++ passed all tests" << endl;
613 mike          1.2      return 0;
614                    #else
615 kumpf         1.11 
616                        const char* tmpDir = getenv ("PEGASUS_TMP");
617                        if (tmpDir == NULL)
618                        {
619                            tmpDir = ".";
620                        }
621                        String f1 (tmpDir);
622 kumpf         1.13     f1.append("/testtracer1.trace");
623 kumpf         1.14     FILE1 = f1.getCString();
624 kumpf         1.11     String f2 (tmpDir);
625 kumpf         1.13     f2.append("/testtracer2.trace");
626 kumpf         1.14     FILE2 = f2.getCString();
627 kumpf         1.11     String f3 (tmpDir);
628 kumpf         1.13     f3.append("/testtracer3.trace");
629 kumpf         1.14     FILE3 = f3.getCString();
630 kumpf         1.11     String f4 (tmpDir);
631 kumpf         1.13     f4.append("/testtracer4.trace");
632 kumpf         1.14     FILE4 = f4.getCString();
633 kumpf         1.11 
634 mike          1.2      System::removeFile(FILE1);
635                        System::removeFile(FILE2);
636                        System::removeFile(FILE3);
637 kumpf         1.4      System::removeFile(FILE4);
638 mike          1.2      if (test1() == 0)
639                        {
640                           cout << "Tracer test (test1) failed" << endl;
641                           exit(1);
642                        }
643                        if (test2() == 0)
644                        {
645                           cout << "Tracer test (test2) failed" << endl;
646                           exit(1);
647                        }
648                        if (test3() == 0)
649                        {
650                           cout << "Tracer test (test3) failed" << endl;
651                           exit(1);
652                        }
653                        if (test4() != 0)
654                        {
655                           cout << "Tracer test (test4) failed" << endl;
656                           exit(1);
657                        }
658                        if (test5() != 0)
659 mike          1.2      {
660                           cout << "Tracer test (test5) failed" << endl;
661                           exit(1);
662                        }
663                        if (test6() != 0)
664                        {
665                           cout << "Tracer test (test6) failed" << endl;
666                           exit(1);
667                        }
668                        if (test7() != 0)
669                        {
670                           cout << "Tracer test (test7) failed" << endl;
671                           exit(1);
672                        }
673                        if (test8() != 0)
674                        {
675                           cout << "Tracer test (test8) failed" << endl;
676                           exit(1);
677                        }
678                        if (test9() != 0)
679                        {
680 mike          1.2         cout << "Tracer test (test9) failed" << endl;
681                           exit(1);
682                        }
683 karl          1.27     /*************************** 
684                           Test 10 bypassed when tests changed to
685                           use macros.  It did an invalid call which is
686                           not possible with macros
687                    
688 mike          1.2      if (test10() != 0)
689                        {
690                           cout << "Tracer test (test10) failed" << endl;
691                           exit(1);
692                        }
693 karl          1.27     ******************************/
694 mike          1.2      if (test11() != 0)
695                        {
696                           cout << "Tracer test (test11) failed" << endl;
697                           exit(1);
698                        }
699                        if (test12() != 0)
700                        {
701                           cout << "Tracer test (test12) failed" << endl;
702                           exit(1);
703                        }
704                        if (test13() != 0)
705                        {
706                           cout << "Tracer test (test13) failed" << endl;
707                           exit(1);
708                        }
709                        if (test14() != 0)
710                        {
711                           cout << "Tracer test (test14) failed" << endl;
712                           exit(1);
713                        }
714                        if (test15() != 0)
715 mike          1.2      {
716                           cout << "Tracer test (test15) failed" << endl;
717                           exit(1);
718                        }
719                        if (test16() != 0)
720                        {
721                           cout << "Tracer test (test16) failed" << endl;
722 kumpf         1.3         exit(1);
723                        }
724                        if (test17() != 0)
725                        {
726                           cout << "Tracer test (test17) failed" << endl;
727                           exit(1);
728                        }
729                        if (test18() != 0)
730                        {
731                           cout << "Tracer test (test18) failed" << endl;
732                           exit(1);
733                        }
734                        if (test19() != 0)
735                        {
736                           cout << "Tracer test (test19) failed" << endl;
737 mike          1.2         exit(1);
738                        }
739 kumpf         1.4      if (test20() != 0)
740                        {
741                           cout << "Tracer test (test20) failed" << endl;
742                           exit(1);
743                        }
744                        if (test21() != 0)
745                        {
746                           cout << "Tracer test (test21) failed" << endl;
747                           exit(1);
748                        }
749                        if (test22() != 0)
750                        {
751                           cout << "Tracer test (test22) failed" << endl;
752                           exit(1);
753                        }
754 karl          1.7      cout << argv[0] << " +++++ passed all tests" << endl;
755 mike          1.2      System::removeFile(FILE1);
756                        System::removeFile(FILE2);
757                        System::removeFile(FILE3);
758 kumpf         1.4      System::removeFile(FILE4);
759 mike          1.2      return 0;
760                    #endif
761                    }
762                    

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2