src/common/stream-tracer-test.cc
changeset 1421 df273f351a4c
parent 1323 08174b13d76f
parent 1420 3feedd3e4f5f
child 1422 d40dfd686fc3
equal deleted inserted replaced
1323:08174b13d76f 1421:df273f351a4c
     1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
       
     2 /*
       
     3  * Copyright (c) 2006 INRIA
       
     4  * All rights reserved.
       
     5  *
       
     6  * This program is free software; you can redistribute it and/or modify
       
     7  * it under the terms of the GNU General Public License version 2 as
       
     8  * published by the Free Software Foundation;
       
     9  *
       
    10  * This program is distributed in the hope that it will be useful,
       
    11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    13  * GNU General Public License for more details.
       
    14  *
       
    15  * You should have received a copy of the GNU General Public License
       
    16  * along with this program; if not, write to the Free Software
       
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
       
    18  *
       
    19  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
       
    20  */
       
    21 #include "stream-tracer.h"
       
    22 #include "ns3/test.h"
       
    23 #include <iostream>
       
    24 
       
    25 #ifdef RUN_SELF_TESTS
       
    26 
       
    27 namespace {
       
    28 
       
    29 class TestStreamTracer : public ns3::Test {
       
    30 public:
       
    31   TestStreamTracer ();
       
    32   virtual bool RunTests (void);
       
    33 };
       
    34 
       
    35 static TestStreamTracer gTestStream;
       
    36 
       
    37 TestStreamTracer::TestStreamTracer ()
       
    38   : Test ("StreamTracer")
       
    39 {}
       
    40 
       
    41 bool
       
    42 TestStreamTracer::RunTests (void)
       
    43 {
       
    44   bool ok = true;
       
    45   ns3::StreamTracer trace;
       
    46   //trace.setStream (&std::cout);
       
    47   trace << 1;
       
    48   trace << " X ";
       
    49   trace << 1.0;
       
    50   trace << std::endl;
       
    51   trace << "test ";
       
    52   trace << 1 << " test";
       
    53   trace << "test "
       
    54         << 1.0 << " "
       
    55         << 0xdeadbead
       
    56         << std::endl;
       
    57   trace << "0x" << std::hex 
       
    58         << 0xdeadbeaf 
       
    59         << std::dec << " "
       
    60         << 0xdeadbeaf
       
    61         << std::endl;
       
    62   return ok;
       
    63 }
       
    64 
       
    65 
       
    66 }; // namespace ns3
       
    67 
       
    68 #endif /* RUN_SELF_TESTS */