/*
  file2Line.h のテスト
  Satofumi KAMIMURA
  $Id: File2LineTest.cpp 286 2008-10-20 09:40:22Z satofumi $
*/

#include "File2LineTest.h"
#include "file2Line.h"

CPPUNIT_TEST_SUITE_REGISTRATION(File2LineTest);
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(File2LineTest, "File2LineTest");


void File2LineTest::readTest(void) {

  // 読み出し
  std::vector<std::vector<VXV::Grid> > inputs;
  File2Line(inputs, "line.dat");

  // 照合
  CPPUNIT_ASSERT_EQUAL(2, (int)inputs.size());

  CPPUNIT_ASSERT_EQUAL(0, inputs[0][0].x);
  CPPUNIT_ASSERT_EQUAL(0, inputs[0][0].y);
  CPPUNIT_ASSERT_EQUAL(10, inputs[0][1].x);
  CPPUNIT_ASSERT_EQUAL(20, inputs[0][1].y);

  CPPUNIT_ASSERT_EQUAL(10, inputs[1][0].x);
  CPPUNIT_ASSERT_EQUAL(10, inputs[1][0].y);
  CPPUNIT_ASSERT_EQUAL(20, inputs[1][1].x);
  CPPUNIT_ASSERT_EQUAL(10, inputs[1][1].y);
  CPPUNIT_ASSERT_EQUAL(20, inputs[1][2].x);
  CPPUNIT_ASSERT_EQUAL(20, inputs[1][2].y);
}
