home *** CD-ROM | disk | FTP | other *** search
/ C/C++ User's Journal & Wi…eveloper's Journal Tools / C-C__Users_Journal_and_Windows_Developers_Journal_Tools_1997.iso / windbase / memslcpp.3 / trace.cpp < prev    next >
C/C++ Source or Header  |  1996-07-23  |  4KB  |  147 lines

  1. /*****************************************************************************\
  2. **                                         **
  3. **  WW       WW IIIIIIII NNN   NN    DDDDDDD     BBBBBBB     AA        SSSSSS EEEEEEEE  **
  4. **  WW    W  WW     II    NNNN  NN    DD    DD BB    BB  AA  AA  SS       EE         **
  5. **  WW    W  WW     II    NN NN NN    DD    DD BBBBBBB  AAAAAAAA  SSSSSS EEEEEE    **
  6. **   WW    W WW     II    NN  NNNN    DD    DD BB    BB AA    AA    SS EE         **
  7. **    WWWWW   IIIIIIII NN   NNN    DDDDDDD     BBBBBBB  AA    AA SSSSSS  EEEEEEEE  **
  8. **                                         **
  9. **   SSSSSS  OOOOOO  FFFFFFFF TTTTTTTT WW     WW    AA      RRRRRRR  EEEEEEEE  **
  10. **  SS        OO      OO FF         TT    WW  W  WW  AA  AA  RR    RR EE         **
  11. **   SSSSS  OO      OO FFFFF     TT    WW  W  WW AAAAAAAA RRRRRRR  EEEEEE    **
  12. **     SS OO      OO FF         TT    WW W WW     AA    AA RR   RR  EE         **
  13. **  SSSSSS   OOOOOO  FF         TT     WWWWW     AA    AA RR    RR EEEEEEEE  **
  14. **                                         **
  15. *********** NOTICE ************************************************************
  16. **      This file contains valuable trade secrets and    proprietary         **
  17. **      assets of Windbase Software Inc.  Embodying substantial         **
  18. **      creative efforts and confidential information.  Unauthorized         **
  19. **      use, copying,    decompiling, translating, disclosure or             **
  20. **      transfer, of any kind, is strictly prohibited.             **
  21. **                                         **
  22. **      COPYRIGHT (C)    1992, 1993, 1994.  Windbase Software Inc.         **
  23. **      ALL RIGHTS RESERVED.                             **
  24. \*****************************************************************************/
  25.  
  26. #include <stdlib.h>
  27.  
  28. #define    WBTRC_LEVEL1
  29. #define    WBTRC_LEVEL2
  30.  
  31. #include "trace.h"
  32.  
  33. class Trace_Test
  34.   {
  35.     int    i;
  36.  
  37.     public:
  38.  
  39.       Trace_Test()
  40.     {
  41.       WBTrcEntry(0,"Trace_Test::Trace_Test",("No args"));
  42.       i = 0;
  43.       WBTrcVReturn(0,("void    return"));
  44.     }
  45.  
  46.       ~Trace_Test()
  47.     {
  48.       WBTrcEntry(0,"Trace_Test::~Trace_Test",("No args"));
  49.       WBTrcVReturn(0,("void    return"));
  50.     }
  51.       void Test1()
  52.     {
  53.       WBTrcEntry(0,"Trace_Test::Test1",("No    args"));
  54.       if (i++ < 3)
  55.         Test1();
  56.       WBTrcVReturn(0,("void    return"));
  57.     }
  58.  
  59.       void Test1_2();
  60.  
  61.       int Test2()
  62.     {
  63.       WBTrcEntry(0,"Trace_Test::Test1",("No    args"));
  64.       WBTrcReturn(0,1,("1"));
  65.     }
  66.  
  67.       int Test2_2();
  68.  
  69.       void Test3(int test1, char *test2)
  70.     {
  71.       WBTrcEntry(0,"Trace_Test::Test1",("%d, %s",test1,test2));
  72.  
  73.       WBTrcHexDump(0, "test2", test2, 10)
  74.  
  75.       WBTrcVReturn(0,("void    return"));
  76.     }
  77.  
  78.       void Test3_2(int test1, char *test2);
  79.  
  80.       int Test4(int test1, char    *test2)
  81.     {
  82.       WBTrcEntry(0,"Trace_Test::Test1",("%d, %s",test1,test2));
  83.  
  84.       WBTrcWatch(0,    "test2", test2,    1);
  85.  
  86.       *test2 = 't';
  87.  
  88.       WBTrcReturn(0,1,("1"));
  89.     }
  90.  
  91.       int Test4_2(int test1, char *test2);
  92.   };
  93.  
  94. void Trace_Test::Test1_2()
  95.   {
  96.     WBTrcEntry(0,"Trace_Test::Test1_2",("No args"));
  97.     WBTrcVReturn(0,("void return"));
  98.   }
  99.  
  100. int Trace_Test::Test2_2()
  101.   {
  102.     WBTrcEntry(0,"Trace_Test::Test2_2",("No args"));
  103.     WBTrcReturn(0,1,("1"));
  104.   }
  105.  
  106. void Trace_Test::Test3_2(int test1, char *test2)
  107.   {
  108.     WBTrcEntry(0,"Trace_Test::Test3_2",("%d, %s",test1,test2));
  109.  
  110.     WBTrcHexDump(0, "test2", test2, 10);
  111.  
  112.     WBTrcVReturn(0,("void return"));
  113.   }
  114.  
  115. int Trace_Test::Test4_2(int test1, char    *test2)
  116.   {
  117.     WBTrcEntry(0,"Trace_Test::Test4_2",("%d, %s",test1,test2));
  118.  
  119.     WBTrcWatch(0, "test2", test2, 1);
  120.  
  121.     *test2 = 't';
  122.  
  123.     WBTrcReturn(0,1,("1"));
  124.   }
  125.  
  126. int main(int argc, char    **argv,    char **envp)
  127.   {
  128.     Trace_Test *test;
  129.  
  130.     WBTrcFrcMainEntry(1);
  131.  
  132.     test = new Trace_Test;
  133.  
  134.     test->Test1();
  135.     test->Test1_2();
  136.     test->Test2();
  137.     test->Test2_2();
  138.     test->Test3(1,"Dump    test");
  139.     test->Test3_2(2,"Dump test");
  140.     test->Test4(3,"Watch test");
  141.     test->Test4_2(4,"Watch test");
  142.  
  143.     delete test;
  144.  
  145.     WBTrcExit(0,0,("0"));
  146.   }
  147.