Sacado Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Macros | Functions
FadUnitTests.hpp File Reference
#include "Sacado_No_Kokkos.hpp"
#include "Sacado_Random.hpp"
#include "Fad/fad.h"
#include <gtest/gtest.h>
#include "GTestUtils.hpp"
Include dependency graph for FadUnitTests.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  FadOpsUnitTest< FadType >
 

Macros

#define BINARY_OP_TEST(FIXTURENAME, TESTNAME, OP)
 
#define RELOP_TEST(FIXTURENAME, TESTNAME, OP)
 
#define BINARY_FUNC_TEST(FIXTURENAME, TESTNAME, FUNC)
 
#define UNARY_OP_TEST(FIXTURENAME, TESTNAME, OP)
 
#define UNARY_FUNC_TEST(FIXTURENAME, TESTNAME, FUNC)
 
#define UNARY_ASSIGNOP_TEST(FIXTURENAME, TESTNAME, OP)
 

Functions

 TYPED_TEST_SUITE_P (FadOpsUnitTest)
 
 TYPED_TEST_P (FadOpsUnitTest, testMax)
 
 TYPED_TEST_P (FadOpsUnitTest, testMin)
 
 TYPED_TEST_P (FadOpsUnitTest, testComposite1)
 
 TYPED_TEST_P (FadOpsUnitTest, testPlusLR)
 
 TYPED_TEST_P (FadOpsUnitTest, testMinusLR)
 
 TYPED_TEST_P (FadOpsUnitTest, testTimesLR)
 
 TYPED_TEST_P (FadOpsUnitTest, testDivideLR)
 
 TYPED_TEST_P (FadOpsUnitTest, testPowConstB)
 
 REGISTER_TYPED_TEST_SUITE_P (FadOpsUnitTest, testAddition, testSubtraction, testMultiplication, testDivision, testEquals, testNotEquals, testLessThanOrEquals, testGreaterThanOrEquals, testLessThan, testGreaterThan, testPow, testUnaryPlus, testUnaryMinus, testExp, testLog, testLog10, testSqrt, testCos, testSin, testTan, testACos, testASin, testATan, testCosh, testSinh, testTanh, testAbs, testFAbs, testPlusEquals, testMinusEquals, testTimesEquals, testDivideEquals, testMax, testMin, testComposite1, testPlusLR, testMinusLR, testTimesLR, testDivideLR, testPowConstB)
 

Macro Definition Documentation

#define BINARY_OP_TEST (   FIXTURENAME,
  TESTNAME,
  OP 
)
Value:
TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
auto a_dfad = this->a_dfad_; \
auto b_dfad = this->b_dfad_; \
auto c_dfad = this->c_dfad_; \
auto a_fad = this->a_fad_; \
auto b_fad = this->b_fad_; \
auto c_fad = this->c_fad_; \
c_dfad = a_dfad OP b_dfad; \
c_fad = a_fad OP b_fad; \
COMPARE_FADS(c_dfad, c_fad); \
\
double val = this->urand.number(); \
c_dfad = a_dfad OP val; \
c_fad = a_fad OP val; \
COMPARE_FADS(c_dfad, c_fad); \
\
c_dfad = val OP b_dfad; \
c_fad = val OP b_fad; \
COMPARE_FADS(c_dfad, c_fad); \
}
TYPED_TEST_P(FadBLASUnitTests, testSCAL1)
expr val()
#define COMPARE_FADS(a, b)
Definition: GTestUtils.hpp:92

Definition at line 94 of file FadUnitTests.hpp.

#define RELOP_TEST (   FIXTURENAME,
  TESTNAME,
  OP 
)
Value:
TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
auto a_dfad = this->a_dfad_; \
auto b_dfad = this->b_dfad_; \
auto a_fad = this->a_fad_; \
auto b_fad = this->b_fad_; \
bool r1 = a_dfad OP b_dfad; \
bool r2 = a_fad OP b_fad; \
ASSERT_TRUE(r1 == r2); \
\
double val = this->urand.number(); \
r1 = a_dfad OP val; \
r2 = a_fad OP val; \
ASSERT_TRUE(r1 == r2); \
\
r1 = val OP b_dfad; \
r2 = val OP b_fad; \
ASSERT_TRUE(r1 == r2); \
}
TYPED_TEST_P(FadBLASUnitTests, testSCAL1)
expr val()
#define ASSERT_TRUE(condition)
Definition: gtest.h:1985

Definition at line 116 of file FadUnitTests.hpp.

#define BINARY_FUNC_TEST (   FIXTURENAME,
  TESTNAME,
  FUNC 
)
Value:
TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
auto a_dfad = this->a_dfad_; \
auto b_dfad = this->b_dfad_; \
auto c_dfad = this->c_dfad_; \
auto a_fad = this->a_fad_; \
auto b_fad = this->b_fad_; \
auto c_fad = this->c_fad_; \
c_dfad = FUNC (a_dfad,b_dfad); \
c_fad = FUNC (a_fad,b_fad); \
COMPARE_FADS(c_dfad, c_fad); \
\
double val = this->urand.number(); \
c_dfad = FUNC (a_dfad,val); \
c_fad = FUNC (a_fad,val); \
COMPARE_FADS(c_dfad, c_fad); \
\
c_dfad = FUNC (val,b_dfad); \
c_fad = FUNC (val,b_fad); \
COMPARE_FADS(c_dfad, c_fad); \
}
TYPED_TEST_P(FadBLASUnitTests, testSCAL1)
expr val()
#define COMPARE_FADS(a, b)
Definition: GTestUtils.hpp:92

Definition at line 136 of file FadUnitTests.hpp.

#define UNARY_OP_TEST (   FIXTURENAME,
  TESTNAME,
  OP 
)
Value:
TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
auto a_dfad = this->a_dfad_; \
auto c_dfad = this->c_dfad_; \
auto a_fad = this->a_fad_; \
auto c_fad = this->c_fad_; \
c_dfad = OP a_dfad; \
c_fad = OP a_fad; \
COMPARE_FADS(c_dfad, c_fad); \
}
TYPED_TEST_P(FadBLASUnitTests, testSCAL1)
#define COMPARE_FADS(a, b)
Definition: GTestUtils.hpp:92

Definition at line 158 of file FadUnitTests.hpp.

#define UNARY_FUNC_TEST (   FIXTURENAME,
  TESTNAME,
  FUNC 
)
Value:
TYPED_TEST_P(FIXTURENAME, TESTNAME) { \
auto a_dfad = this->a_dfad_; \
auto c_dfad = this->c_dfad_; \
auto a_fad = this->a_fad_; \
auto c_fad = this->c_fad_; \
c_dfad = FUNC (a_dfad); \
c_fad = FUNC (a_fad); \
COMPARE_FADS(c_dfad, c_fad); \
}
TYPED_TEST_P(FadBLASUnitTests, testSCAL1)
#define COMPARE_FADS(a, b)
Definition: GTestUtils.hpp:92

Definition at line 169 of file FadUnitTests.hpp.

#define UNARY_ASSIGNOP_TEST (   FIXTURENAME,
  TESTNAME,
  OP 
)
Value:
TYPED_TEST_P(FIXTURENAME, TESTNAME){ \
auto a_dfad = this->a_dfad_; \
auto b_dfad = this->b_dfad_; \
auto c_dfad = this->c_dfad_; \
auto a_fad = this->a_fad_; \
auto b_fad = this->b_fad_; \
auto c_fad = this->c_fad_; \
c_dfad = b_dfad; \
c_fad = b_fad; \
c_dfad OP a_dfad; \
c_fad OP a_fad; \
COMPARE_FADS(c_dfad, c_fad); \
\
double val = this->urand.number(); \
c_dfad OP val; \
c_fad OP val; \
COMPARE_FADS(c_dfad, c_fad); \
}
TYPED_TEST_P(FadBLASUnitTests, testSCAL1)
expr val()
#define COMPARE_FADS(a, b)
Definition: GTestUtils.hpp:92

Definition at line 180 of file FadUnitTests.hpp.

Function Documentation

TYPED_TEST_SUITE_P ( FadOpsUnitTest  )
TYPED_TEST_P ( FadOpsUnitTest  ,
testMax   
)

Definition at line 238 of file FadUnitTests.hpp.

TYPED_TEST_P ( FadOpsUnitTest  ,
testMin   
)

Definition at line 309 of file FadUnitTests.hpp.

TYPED_TEST_P ( FadOpsUnitTest  ,
testComposite1   
)

Definition at line 366 of file FadUnitTests.hpp.

TYPED_TEST_P ( FadOpsUnitTest  ,
testPlusLR   
)

Definition at line 379 of file FadUnitTests.hpp.

TYPED_TEST_P ( FadOpsUnitTest  ,
testMinusLR   
)

Definition at line 397 of file FadUnitTests.hpp.

TYPED_TEST_P ( FadOpsUnitTest  ,
testTimesLR   
)

Definition at line 415 of file FadUnitTests.hpp.

TYPED_TEST_P ( FadOpsUnitTest  ,
testDivideLR   
)

Definition at line 433 of file FadUnitTests.hpp.

TYPED_TEST_P ( FadOpsUnitTest  ,
testPowConstB   
)

Definition at line 452 of file FadUnitTests.hpp.

REGISTER_TYPED_TEST_SUITE_P ( FadOpsUnitTest  ,
testAddition  ,
testSubtraction  ,
testMultiplication  ,
testDivision  ,
testEquals  ,
testNotEquals  ,
testLessThanOrEquals  ,
testGreaterThanOrEquals  ,
testLessThan  ,
testGreaterThan  ,
testPow  ,
testUnaryPlus  ,
testUnaryMinus  ,
testExp  ,
testLog  ,
testLog10  ,
testSqrt  ,
testCos  ,
testSin  ,
testTan  ,
testACos  ,
testASin  ,
testATan  ,
testCosh  ,
testSinh  ,
testTanh  ,
testAbs  ,
testFAbs  ,
testPlusEquals  ,
testMinusEquals  ,
testTimesEquals  ,
testDivideEquals  ,
testMax  ,
testMin  ,
testComposite1  ,
testPlusLR  ,
testMinusLR  ,
testTimesLR  ,
testDivideLR  ,
testPowConstB   
)