fixed writing huge matrices (ticket #1439)

pull/13383/head
Vadim Pisarevsky 13 years ago
parent 6848c6d69a
commit 24bc0db1b0
  1. 2
      modules/core/src/persistence.cpp
  2. 29
      modules/core/test/test_io.cpp

@ -3410,7 +3410,7 @@ icvWriteMat( CvFileStorage* fs, const char* name,
}
for( y = 0; y < size.height; y++ )
cvWriteRawData( fs, mat->data.ptr + y*mat->step, size.width, dt );
cvWriteRawData( fs, mat->data.ptr + (size_t)y*mat->step, size.width, dt );
}
cvEndWriteStruct( fs );
cvEndWriteStruct( fs );

@ -376,3 +376,32 @@ protected:
};
TEST(Core_InputOutput, write_read_consistency) { Core_IOTest test; test.safe_run(); }
/*class CV_BigMatrixIOTest : public cvtest::BaseTest
{
public:
CV_BigMatrixIOTest() {}
~CV_BigMatrixIOTest() {}
protected:
void run(int)
{
try
{
RNG& rng = theRNG();
int N = 1000, M = 1200000;
Mat mat(M, N, CV_32F);
rng.fill(mat, RNG::UNIFORM, 0, 1);
FileStorage fs("test.xml", FileStorage::WRITE);
fs << "mat" << mat;
fs.release();
}
catch(...)
{
ts->set_failed_test_info(cvtest::TS::FAIL_MISMATCH);
}
}
};
TEST(Core_InputOutput, huge) { CV_BigMatrixIOTest test; test.safe_run(); }
*/

Loading…
Cancel
Save