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:112

Definition at line 114 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 136 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:112

Definition at line 156 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:112

Definition at line 178 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:112

Definition at line 189 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:112

Definition at line 200 of file FadUnitTests.hpp.

Function Documentation

TYPED_TEST_SUITE_P ( FadOpsUnitTest  )
TYPED_TEST_P ( FadOpsUnitTest  ,
testMax   
)

Definition at line 258 of file FadUnitTests.hpp.

TYPED_TEST_P ( FadOpsUnitTest  ,
testMin   
)

Definition at line 329 of file FadUnitTests.hpp.

TYPED_TEST_P ( FadOpsUnitTest  ,
testComposite1   
)

Definition at line 386 of file FadUnitTests.hpp.

TYPED_TEST_P ( FadOpsUnitTest  ,
testPlusLR   
)

Definition at line 399 of file FadUnitTests.hpp.

TYPED_TEST_P ( FadOpsUnitTest  ,
testMinusLR   
)

Definition at line 417 of file FadUnitTests.hpp.

TYPED_TEST_P ( FadOpsUnitTest  ,
testTimesLR   
)

Definition at line 435 of file FadUnitTests.hpp.

TYPED_TEST_P ( FadOpsUnitTest  ,
testDivideLR   
)

Definition at line 453 of file FadUnitTests.hpp.

TYPED_TEST_P ( FadOpsUnitTest  ,
testPowConstB   
)

Definition at line 472 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   
)