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  Int64x64128TestSuite
 
class  Int64x64ArithmeticTestCase
 
class  Int64x64Bug455TestCase
 See Bug 455 More...
 
class  Int64x64Bug863TestCase
 See Bug 863 More...
 
class  Int64x64CompareTestCase
 
class  Int64x64FracTestCase
 
class  Int64x64InputOutputTestCase
 
class  Int64x64InputTestCase
 
class  Int64x64InvertTestCase
 

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

Int64x64128TestSuite 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 112 of file int64x64-test-suite.cc.

Referenced by 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)
#define V(v)
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
Definition: test.h:137

Referenced by Int64x64InvertTestCase::DoRun().

Variable Documentation

Int64x64128TestSuite g_int64x64TestSuite
static