A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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#include "test.h"
27
28#include <stdint.h>
29
30/**
31 * \brief Test that a pair of new/reference ascii files are equal
32 *
33 * \param gotFilename The name of the new file to read in including
34 * its path
35 * \param expectedFilename The name of the reference file to read in
36 * including its path
37 */
38#define NS_ASCII_TEST_EXPECT_EQ(gotFilename, expectedFilename) \
39 do \
40 { \
41 uint64_t line(0); \
42 bool diff = AsciiFile::Diff(gotFilename, expectedFilename, line); \
43 NS_TEST_EXPECT_MSG_EQ(diff, \
44 false, \
45 "ASCII traces " << gotFilename << " and " << expectedFilename \
46 << " differ starting from line " << line); \
47 } while (false)
48
49#endif /* ASCII_TEST_H */
ns3::TestCase, ns3::TestSuite, ns3::TestRunner declarations, and NS_TEST_ASSERT macro definitions.