(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                    // Changes the trace file to FILE2 
255                    //
256                    // Type:
257                    // Positive 
258                    //
259                    // return 0 if the test passed
260                    // return 1 if the test failed
261                    //
262                    Uint32 test9()
263                    {
264                        const char* METHOD_NAME = "test9";
265                        Tracer::setTraceLevel(Tracer::LEVEL3);
266                        Tracer::setTraceFile(FILE2);
267                    
268 kumpf         1.10     PEG_METHOD_ENTER(TRC_CONFIG,METHOD_NAME);
269 mike          1.2      Tracer::trace(TRC_CONFIG,Tracer::LEVEL3,"%s %s",
270                    	"Test Message for Level3 in",METHOD_NAME);
271                        return(compare(FILE2,"Test Message for Level3 in test9"));
272                    }
273                    
274                    //
275                    // Description:
276                    // Passes invalid component in the trace call
277                    // should not log a trace message
278                    //
279                    // Type:
280                    // Negative 
281                    //
282                    // return 0 if the test passed
283                    // return 1 if the test failed
284                    //
285 karl          1.27 // This test not required with change t0
286                    // use and test macros only.
287 mike          1.2  
288                    Uint32 test10()
289                    {
290                        const char* METHOD_NAME = "test10";
291                        Tracer::setTraceComponents("ALL");
292 karl          1.27     PEG_METHOD_ENTER(TRC_CONFIG,METHOD_NAME);
293                        PEG_METHOD_EXIT();
294 mike          1.2      return(compare(FILE2,"Test Message for Level3 in test9"));
295                    }
296                    
297                    //
298                    // Description:
299                    // Implements trace call for Tracer::Level1
300                    // should log a trace message
301                    //
302                    // Type:
303                    // Positive 
304                    //
305                    // return 0 if the test passed
306                    // return 1 if the test failed
307                    //
308                    
309                    Uint32 test11()
310                    {
311                        const char* METHOD_NAME = "test11";
312                        Tracer::setTraceComponents("ALL");
313                        Tracer::setTraceLevel(Tracer::LEVEL4);
314 kumpf         1.10     PEG_METHOD_ENTER(TRC_CONFIG,METHOD_NAME);
315 mike          1.2      return(compare(FILE2,"Entering method test11"));
316                    }
317                    
318                    //
319                    // Description:
320                    // Implements trace call for Tracer::Level1
321                    // should log a trace message
322                    //
323                    // Type:
324                    // Positive 
325                    //
326                    // return 0 if the test passed
327                    // return 1 if the test failed
328                    //
329                    
330                    Uint32 test12()
331                    {
332                        const char* METHOD_NAME = "test12";
333                        Tracer::setTraceComponents("ALL");
334                        Tracer::setTraceLevel(Tracer::LEVEL4);
335 karl          1.27     PEG_METHOD_ENTER(TRC_CONFIG,METHOD_NAME);
336                        PEG_METHOD_EXIT();
337 mike          1.2      return(compare(FILE2,"Exiting method test12"));
338                    }
339                    
340                    //
341                    // Description:
342                    // Implements trace call for Tracer::Level2
343                    // should log a trace message
344                    //
345                    // Type:
346                    // Positive 
347                    //
348                    // return 0 if the test passed
349                    // return 1 if the test failed
350                    //
351                    
352                    Uint32 test13()
353                    {
354                        const char* METHOD_NAME = "test13";
355                        Tracer::setTraceComponents("ALL");
356                        Tracer::setTraceLevel(Tracer::LEVEL4);
357                        Tracer::trace(__FILE__,__LINE__,TRC_CONFIG,Tracer::LEVEL2,"%s %s",
358 mike          1.2  	"Test Message for Level2 in",METHOD_NAME);
359                        return(compare(FILE2,"Test Message for Level2 in test13"));
360                    }
361                    
362                    //
363                    // Description:
364                    // Implements trace call for Tracer::Level3
365                    // should log a trace message
366                    //
367                    // Type:
368                    // Positive 
369                    //
370                    // return 0 if the test passed
371                    // return 1 if the test failed
372                    //
373                    
374                    Uint32 test14()
375                    {
376                        const char* METHOD_NAME = "test14";
377                        Tracer::setTraceComponents("ALL");
378                        Tracer::setTraceLevel(Tracer::LEVEL4);
379 mike          1.2      Tracer::setTraceFile(FILE3);
380                        Tracer::trace(__FILE__,__LINE__,TRC_CONFIG,Tracer::LEVEL3,"%s %s",
381                    	"Test Message for Level3 in",METHOD_NAME);
382                        return(compare(FILE3,"Test Message for Level3 in test14"));
383                    }
384                    
385                    //
386                    // Description:
387                    // Implements trace call for Tracer::Level4
388                    // should log a trace message
389                    //
390                    // Type:
391                    // Positive 
392                    //
393                    // return 0 if the test passed
394                    // return 1 if the test failed
395                    //
396                    
397                    Uint32 test15()
398                    {
399                        const char* METHOD_NAME = "test15";
400 mike          1.2      Tracer::setTraceComponents("ALL");
401                        Tracer::setTraceLevel(Tracer::LEVEL4);
402                        Tracer::trace(__FILE__,__LINE__,TRC_CONFIG,Tracer::LEVEL4,"%s %s",
403                    	"Test Message for Level4 in",METHOD_NAME);
404                        return(compare(FILE3,"Test Message for Level4 in test15"));
405                    }
406                    
407                    //
408                    // Description:
409                    // calls the setTraceComponents with null string
410                    // should log a trace message
411                    //
412                    // Type:
413                    // Negative 
414                    //
415                    // return 0 if the test passed
416                    // return 1 if the test failed
417                    //
418                    
419                    Uint32 test16()
420                    {
421 mike          1.2      const char* METHOD_NAME = "test16";
422                        Tracer::setTraceComponents("");
423                        Tracer::setTraceLevel(Tracer::LEVEL4);
424                        Tracer::trace(__FILE__,__LINE__,TRC_CONFIG,Tracer::LEVEL4,"%s %s",
425                    	"This Message should not appear in",METHOD_NAME);
426                        return(compare(FILE3,"Test Message for Level4 in test15"));
427                    }
428                    
429                    //
430                    // Description:
431                    // calls the setTraceComponents with one valid and another invalid component
432                    // should log a trace message
433                    //
434                    // Type:
435                    // Negative 
436                    //
437                    // return 0 if the test passed
438                    // return 1 if the test failed
439                    //
440                    
441                    Uint32 test17()
442 mike          1.2  {
443                        const char* METHOD_NAME = "test17";
444 kumpf         1.3      Tracer::setTraceComponents("InvalidComp");
445 mike          1.2      Tracer::setTraceLevel(Tracer::LEVEL4);
446                        Tracer::trace(__FILE__,__LINE__,TRC_CONFIG,Tracer::LEVEL4,"%s %s",
447                    	"This Message should not appear in",METHOD_NAME);
448                        return(compare(FILE3,"Test Message for Level4 in test15"));
449                    }
450 kumpf         1.3  //
451                    // Description:
452                    // calls the _traceBuffer call
453                    // should log a trace message
454                    //
455                    // Type:
456                    // Positive
457                    //
458                    // return 0 if the test passed
459                    // return 1 if the test failed
460                    //
461                    
462                    Uint32 test18()
463                    {
464                        const char* METHOD_NAME = "test18";
465                        Tracer::setTraceComponents("Config,InvalidComp");
466                        Tracer::setTraceLevel(Tracer::LEVEL4);
467 marek         1.27.22.1     Tracer::traceCString(__FILE__,__LINE__,TRC_CONFIG,Tracer::LEVEL4,
468                                 "This Message should appear in");
469                             return(compare(FILE3,"This Message should appear in"));
470 kumpf         1.3       }
471 mike          1.2       
472 kumpf         1.4       //
473                         // Description:
474                         // Trace a string.
475                         // Calls the _traceString() method
476                         // should log a trace message
477                         //
478                         // Type:
479                         // Positive
480                         //
481                         // return 0 if the test passed
482                         // return 1 if the test failed
483                         //
484                         
485                         Uint32 test20()
486                         {
487                             const char* METHOD_NAME = "test20";
488                             Tracer::setTraceFile(FILE4);
489                             Tracer::setTraceComponents("ALL");
490                             Tracer::setTraceLevel(Tracer::LEVEL4);
491                         
492                             PEG_METHOD_ENTER(TRC_CONFIG, METHOD_NAME);
493 kumpf         1.4           Tracer::trace(__FILE__,__LINE__,TRC_CONFIG,Tracer::LEVEL4,
494                         	"Test Message for Level4 in test20");
495                             return(compare(FILE4,"Test Message for Level4 in test20"));
496                         }
497                         
498                         //
499                         // Description:
500                         // Trace a CIMException.
501                         // Calls the traceCIMException() method
502                         // should log a trace message
503                         //
504                         // Type:
505                         // Positive
506                         //
507                         // return 0 if the test passed
508                         // return 1 if the test failed
509                         //
510                         
511                         Uint32 test21()
512                         {
513                             const char* METHOD_NAME = "test21";
514 kumpf         1.4           Tracer::setTraceFile(FILE4);
515                             Tracer::setTraceComponents("ALL");
516                             Tracer::setTraceLevel(Tracer::LEVEL4);
517                         
518                             PEG_METHOD_ENTER(TRC_CONFIG, METHOD_NAME);
519                         
520                             // test tracing CIMException
521                             try
522                             {
523                                 throw PEGASUS_CIM_EXCEPTION(
524                                     CIM_ERR_NOT_SUPPORTED, 
525                                     "CIM Exception Message for Level4 in test21.");
526                             }
527 kumpf         1.12          catch (CIMException& e)
528 kumpf         1.4           {
529                                 Tracer::traceCIMException(TRC_CONFIG,Tracer::LEVEL4, e);
530                             }
531                         
532                             return 0;
533                         }
534                         
535                         //
536                         // Description:
537                         // Trace a string using macro.
538                         // should log a trace message
539                         //
540                         // Type:
541                         // Positive
542                         //
543                         // return 0 if the test passed
544                         // return 1 if the test failed
545                         //
546                         Uint32 test22()
547                         {
548                             const char* METHOD_NAME = "test22";
549 kumpf         1.4           Tracer::setTraceFile(FILE4);
550                             Tracer::setTraceComponents("ALL");
551                             Tracer::setTraceLevel(Tracer::LEVEL4);
552                         
553                             PEG_METHOD_ENTER(TRC_CONFIG, METHOD_NAME);
554                         
555                             PEG_TRACE_STRING(TRC_CONFIG,Tracer::LEVEL4,"Test message for Level4 in test22.");
556                         
557                             return(compare(FILE4,"Test message for Level4 in test22."));
558                         }
559                         
560 marek         1.27.22.1 //
561                         // Description:
562                         // Trace a character string using macro.
563                         // should log a trace message
564                         //
565                         // Type:
566                         // Positive
567                         //
568                         // return 0 if the test passed
569                         // return 1 if the test failed
570                         //
571                         Uint32 test23()
572                         {
573                             const char* METHOD_NAME = "test23";
574                             Tracer::setTraceFile(FILE4);
575                             Tracer::setTraceComponents("ALL");
576                             Tracer::setTraceLevel(Tracer::LEVEL4);
577                         
578                             PEG_METHOD_ENTER(TRC_CONFIG, METHOD_NAME);
579                         
580                             PEG_TRACE_CSTRING(TRC_CONFIG,Tracer::LEVEL4,"Test message for Level4 in test23.");
581 marek         1.27.22.1 
582                             return(compare(FILE4,"Test message for Level4 in test23."));
583                         }
584                         
585 karl          1.7       int main(int argc, char** argv)
586 mike          1.2       {
587                         
588                         // Execute the tests only if trace calls are included
589                         
590                         #ifdef PEGASUS_REMOVE_TRACE
591 karl          1.7           cout << argv[0] << " +++++ passed all tests" << endl;
592 mike          1.2           return 0;
593                         #else
594 kumpf         1.11      
595                             const char* tmpDir = getenv ("PEGASUS_TMP");
596                             if (tmpDir == NULL)
597                             {
598                                 tmpDir = ".";
599                             }
600                             String f1 (tmpDir);
601 kumpf         1.13          f1.append("/testtracer1.trace");
602 kumpf         1.14          FILE1 = f1.getCString();
603 kumpf         1.11          String f2 (tmpDir);
604 kumpf         1.13          f2.append("/testtracer2.trace");
605 kumpf         1.14          FILE2 = f2.getCString();
606 kumpf         1.11          String f3 (tmpDir);
607 kumpf         1.13          f3.append("/testtracer3.trace");
608 kumpf         1.14          FILE3 = f3.getCString();
609 kumpf         1.11          String f4 (tmpDir);
610 kumpf         1.13          f4.append("/testtracer4.trace");
611 kumpf         1.14          FILE4 = f4.getCString();
612 kumpf         1.11      
613 mike          1.2           System::removeFile(FILE1);
614                             System::removeFile(FILE2);
615                             System::removeFile(FILE3);
616 kumpf         1.4           System::removeFile(FILE4);
617 mike          1.2           if (test1() == 0)
618                             {
619                                cout << "Tracer test (test1) failed" << endl;
620                                exit(1);
621                             }
622                             if (test2() == 0)
623                             {
624                                cout << "Tracer test (test2) failed" << endl;
625                                exit(1);
626                             }
627                             if (test3() == 0)
628                             {
629                                cout << "Tracer test (test3) failed" << endl;
630                                exit(1);
631                             }
632                             if (test4() != 0)
633                             {
634                                cout << "Tracer test (test4) failed" << endl;
635                                exit(1);
636                             }
637                             if (test5() != 0)
638 mike          1.2           {
639                                cout << "Tracer test (test5) failed" << endl;
640                                exit(1);
641                             }
642                             if (test6() != 0)
643                             {
644                                cout << "Tracer test (test6) failed" << endl;
645                                exit(1);
646                             }
647                             if (test7() != 0)
648                             {
649                                cout << "Tracer test (test7) failed" << endl;
650                                exit(1);
651                             }
652                             if (test9() != 0)
653                             {
654                                cout << "Tracer test (test9) failed" << endl;
655                                exit(1);
656                             }
657 karl          1.27          /*************************** 
658                                Test 10 bypassed when tests changed to
659                                use macros.  It did an invalid call which is
660                                not possible with macros
661                         
662 mike          1.2           if (test10() != 0)
663                             {
664                                cout << "Tracer test (test10) failed" << endl;
665                                exit(1);
666                             }
667 karl          1.27          ******************************/
668 mike          1.2           if (test11() != 0)
669                             {
670                                cout << "Tracer test (test11) failed" << endl;
671                                exit(1);
672                             }
673                             if (test12() != 0)
674                             {
675                                cout << "Tracer test (test12) failed" << endl;
676                                exit(1);
677                             }
678                             if (test13() != 0)
679                             {
680                                cout << "Tracer test (test13) failed" << endl;
681                                exit(1);
682                             }
683                             if (test14() != 0)
684                             {
685                                cout << "Tracer test (test14) failed" << endl;
686                                exit(1);
687                             }
688                             if (test15() != 0)
689 mike          1.2           {
690                                cout << "Tracer test (test15) failed" << endl;
691                                exit(1);
692                             }
693                             if (test16() != 0)
694                             {
695                                cout << "Tracer test (test16) failed" << endl;
696 kumpf         1.3              exit(1);
697                             }
698                             if (test17() != 0)
699                             {
700                                cout << "Tracer test (test17) failed" << endl;
701                                exit(1);
702                             }
703                             if (test18() != 0)
704                             {
705                                cout << "Tracer test (test18) failed" << endl;
706                                exit(1);
707                             }
708 kumpf         1.4           if (test20() != 0)
709                             {
710                                cout << "Tracer test (test20) failed" << endl;
711                                exit(1);
712                             }
713                             if (test21() != 0)
714                             {
715                                cout << "Tracer test (test21) failed" << endl;
716                                exit(1);
717                             }
718                             if (test22() != 0)
719                             {
720                                cout << "Tracer test (test22) failed" << endl;
721                                exit(1);
722                             }
723 marek         1.27.22.1     if (test23() != 0)
724                             {
725                                cout << "Tracer test (test23) failed" << endl;
726                                exit(1);
727                             }
728 karl          1.7           cout << argv[0] << " +++++ passed all tests" << endl;
729 mike          1.2           System::removeFile(FILE1);
730                             System::removeFile(FILE2);
731                             System::removeFile(FILE3);
732 kumpf         1.4           System::removeFile(FILE4);
733 mike          1.2           return 0;
734                         #endif
735                         }
736                         

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2