Пример #1
0
/// tests Matrix4 multiply method
TEST_F(Math_Matrix4Tests, Multiply)
{
    // Identity test
    matrixSet(i, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
    matrixSet(m, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
    Matrix4 i_check(i);
    Matrix4 m_check(m);
    actual.multiply(i, m);
    ASSERT_MATRIX_EQ(m, actual);

    // Identity test 2
    actual.multiply(m, i);
    ASSERT_MATRIX_EQ(m, actual);

    // setup matrices
    matrixSet(m1, 5,-71,-13,86,-86,-8,-62,8,-69,-106,81,125,-1,-52,84,47);
    Matrix4 m1_check(m1);
    matrixSet(m2, -92,-59,-55,-91,47,-86,-93,-32,19,126,44,92,32,112,119,-94);
    Matrix4 m2_check(m2);
    matrixSet(expected, 8500,17566,-7245,-19536,14080,8873,-5500,-9775,-13869,
              -11805,3233,12466,-17589,-10894,-5617,14105);
              
    // perform test
    actual.multiply(m1,m2);
    ASSERT_MATRIX_EQ(expected, actual);
    
    // perform tests to ensure read-only memory didn't fail
    ASSERT_MATRIX_EQ(m1_check, m1);
    ASSERT_MATRIX_EQ(m2_check, m2);
}
Пример #2
0
 bool SSHGetFile::apply_impl(const boost::shared_ptr<SSHConnection> &t_conn)
 {
   if ( !m_check || (m_check && !m_check(m_from, m_to)) )
   {
     //Create directory for receiving file
     boost::filesystem::create_directories(m_to.parent_path());
     t_conn->getFile(id(), m_from, m_to, 1000 * 60 * 10); // 10 minute timeout wait
     return true;
   } else {
     return false;
     // File does not need to be got
   }
 }
Пример #3
0
    bool SSHPutFile::apply_impl(const boost::shared_ptr<SSHConnection> &t_conn)
    {
      try {

        if ( !m_check || (m_check && !m_check(m_from, m_to)) )
        {
          t_conn->putFile(id(), m_from, m_to, 1000 * 60 * 10); // 10 minute timeout wait
          return true;
        } else {
          return false;
        }

      } catch (const std::exception &e) {
        throw std::runtime_error("Error applying SSHPutFile from: " + toString(m_from)
          + " to: " + toString(m_to) + " desc: " + e.what());
      }
    }
Пример #4
0
void
mpi_m_check( MPI a )
{
    m_check(a);
    m_check(a->d);
}