A Discrete-Event Network Simulator
API
ascii-test.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012 University of Washington
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Mitch Watrous (watrous@u.washington.edu)
18  *
19  * This file is based on pcap-test.h by Craig Dowell (craigdo@ee.washington.edu)
20  */
21 
22 #ifndef ASCII_TEST_H
23 #define ASCII_TEST_H
24 
25 #include "ascii-file.h"
26 
27 #include "ns3/test.h"
28 
29 #include <stdint.h>
30 
39 #define NS_ASCII_TEST_EXPECT_EQ(gotFilename, expectedFilename) \
40  do \
41  { \
42  uint64_t line(0); \
43  bool diff = AsciiFile::Diff(gotFilename, expectedFilename, line); \
44  NS_TEST_EXPECT_MSG_EQ(diff, \
45  false, \
46  "ASCII traces " << gotFilename << " and " << expectedFilename \
47  << " differ starting from line " << line); \
48  } while (false)
49 
50 #endif /* ASCII_TEST_H */