A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
int64x64-test-suite.cc File Reference
#include "ns3/int64x64.h"
#include "ns3/test.h"
+ Include dependency graph for int64x64-test-suite.cc:

Go to the source code of this file.

Classes

class  ns3::Int64x64128TestSuite
class  ns3::Int64x64ArithmeticTestCase
class  ns3::Int64x64Bug455TestCase
class  ns3::Int64x64Bug863TestCase
class  ns3::Int64x64CompareTestCase
class  ns3::Int64x64FracTestCase
class  ns3::Int64x64InputOutputTestCase
class  ns3::Int64x64InputTestCase
class  ns3::Int64x64InvertTestCase

Namespaces

namespace  ns3
 Every class exported by the ns3 library is enclosed in the ns3 namespace.

Macros

#define CHECK_EXPECTED(a, b)   NS_TEST_ASSERT_MSG_EQ ((a).GetHigh (),b,"Arithmetic failure: " << ((a).GetHigh ()) << "!=" << (b))
#define TEST(factor)
#define V(v)   int64x64_t (v)

Variables

ns3::Int64x64128TestSuite ns3::g_int64x64TestSuite

Macro Definition Documentation

#define CHECK_EXPECTED (   a,
 
)    NS_TEST_ASSERT_MSG_EQ ((a).GetHigh (),b,"Arithmetic failure: " << ((a).GetHigh ()) << "!=" << (b))

Definition at line 113 of file int64x64-test-suite.cc.

Referenced by ns3::Int64x64ArithmeticTestCase::DoRun().

#define TEST (   factor)
Value:
do { \
int64x64_t a; \
a = int64x64_t::Invert (factor); \
int64x64_t b = V (factor); \
b.MulByInvert (a); \
NS_TEST_ASSERT_MSG_EQ (b.GetHigh (), 1, \
"x * 1/x should be 1 for x=" << factor); \
int64x64_t c = V (1); \
c.MulByInvert (a); \
NS_TEST_ASSERT_MSG_EQ (c.GetHigh (), 0, \
"1 * 1/x should be 0 for x=" << factor); \
int64x64_t d = V (1); \
d /= (V (factor)); \
NS_TEST_ASSERT_MSG_EQ (d.GetDouble (), c.GetDouble (), \
"1 * 1/x should be equal to 1/x for x=" << factor); \
int64x64_t e = V (-factor); \
e.MulByInvert (a); \
NS_TEST_ASSERT_MSG_EQ (e.GetHigh (), -1, \
"-x * 1/x should be -1 for x=" << factor); \
} \
while(false)

Referenced by ns3::Int64x64InvertTestCase::DoRun().