v0.14.0
Functions
test_T3_iostream.cpp File Reference
#include "../../../src/FTensor.hpp"
#include "../test_for_zero.hpp"
#include "../test_ostream.hpp"

Go to the source code of this file.

Functions

void test_T3_iostream ()
 

Function Documentation

◆ test_T3_iostream()

void test_T3_iostream ( )

Definition at line 7 of file test_T3_iostream.cpp.

8 {
9  test_ostream(Tensor3<double, 2, 2, 2>(3., 4., 7., 8., 11., 12., 13., 14.),
10  "[[[3,4],[7,8]],[[11,12],[13,14]]]", "operator<<(T3<3,3,2>)");
11 
13  std::stringstream ss("[[[3,4],[7,8]],[[11,12],[13,14]]]");
14  ss >> t3_1;
15  test_for_zero(t3_1(0, 0, 0) - 3, "operator>>(T3)(0,0,0)");
16  test_for_zero(t3_1(0, 0, 1) - 4, "operator>>(T3)(0,0,1)");
17  test_for_zero(t3_1(0, 1, 0) - 7, "operator>>(T3)(0,1,0)");
18  test_for_zero(t3_1(0, 1, 1) - 8, "operator>>(T3)(0,1,1)");
19  test_for_zero(t3_1(1, 0, 0) - 11, "operator>>(T3)(1,0,0)");
20  test_for_zero(t3_1(1, 0, 1) - 12, "operator>>(T3)(1,0,1)");
21  test_for_zero(t3_1(1, 1, 0) - 13, "operator>>(T3)(1,1,0)");
22  test_for_zero(t3_1(1, 1, 1) - 14, "operator>>(T3)(1,1,1)");
23 }
test_ostream
void test_ostream(const T &t, const std::string &expected, const std::string &test_name)
Definition: test_ostream.hpp:7
FTensor::Tensor3
Definition: Tensor3_value.hpp:12
test_for_zero
void test_for_zero(const T &t, const std::string &s)
Definition: test_for_zero.hpp:7