samples/main-debug.cc
changeset 1869 9e5d8b4893b2
parent 1868 06027fd6a68c
parent 1819 c21093326f8d
child 1870 67b3d2dea3d5
equal deleted inserted replaced
1868:06027fd6a68c 1869:9e5d8b4893b2
     1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
       
     2 #include "ns3/debug.h"
       
     3 #include "ns3/assert.h"
       
     4 
       
     5 NS_DEBUG_COMPONENT_DEFINE ("MyComponentA");
       
     6 
       
     7 // declare other function
       
     8 namespace foo {
       
     9 void OneFunction (void);
       
    10 }
       
    11 
       
    12 int main (int argc, int argv)
       
    13 {
       
    14   NS_DEBUG ("nargc="<<argc);
       
    15 
       
    16   foo::OneFunction ();
       
    17 
       
    18   NS_DEBUG ("other debug output");
       
    19 
       
    20   int a;
       
    21   a = 0;
       
    22 
       
    23   NS_ASSERT (a == 0);
       
    24   NS_ASSERT_MSG (a == 0, "my msg");
       
    25   NS_ASSERT (a != 0);
       
    26   NS_ASSERT_MSG (a != 0, "my 2 msg");
       
    27 }