test_vector_fixed_io.cxx

来自「DTMK软件开发包,此为开源软件,是一款很好的医学图像开发资源.」· CXX 代码 · 共 44 行

CXX
44
字号
// This is core/vnl/io/tests/test_vector_fixed_io.cxx
#include <vcl_iostream.h>
#include <vnl/vnl_vector_fixed.h>
#include <vnl/io/vnl_io_vector_fixed.h>
#include <vsl/vsl_binary_io.h>
#include <testlib/testlib_test.h>
#include <vpl/vpl.h>

void test_vector_fixed_double_3_io()
{
  vcl_cout << "*************************************\n"
           << "Testing vnl_vector_fixed<double,3> io\n"
           << "*************************************\n";
  //// test constructors, accessors

  vnl_vector_fixed<double,3> m_out(1.2,3.4,5.6), m_in;

  vsl_b_ofstream bfs_out("vnl_vector_fixed_io.bvl.tmp");
  TEST ("vnl_vector_fixed_io.bvl.tmp for writing", (!bfs_out), false);
  vsl_b_write(bfs_out, m_out);
  bfs_out.close();

  vsl_b_ifstream bfs_in("vnl_vector_fixed_io.bvl.tmp");
  TEST ("vnl_vector_fixed_io.bvl.tmp for reading", (!bfs_in), false);
  vsl_b_read(bfs_in, m_in);
  bfs_in.close();

  vpl_unlink ("vnl_vector_fixed_io.bvl.tmp");

  TEST ("m_out == m_in", m_out, m_in);

  vsl_print_summary(vcl_cout, m_out);
  vcl_cout << vcl_endl;
}


void test_vector_fixed_io()
{
  test_vector_fixed_double_3_io();
}


TESTMAIN(test_vector_fixed_io);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?