コード例 #1
0
TEST_F(CopyTestTimeout, CopyTimeout)
{
    GError* error = NULL;
    int ret = 0;

    ret = gfalt_set_timeout(params, 1, &error);
    ASSERT_PRED_FORMAT2(AssertGfalSuccess, ret, error);

    ret = gfalt_copy_file(handle, params, source, destination, &error);
    ASSERT_PRED_FORMAT3(AssertGfalErrno, ret, error, ETIMEDOUT);
}
コード例 #2
0
ファイル: test_tiff.cpp プロジェクト: AliMiraftab/opencv
TEST(Imgcodecs_Tiff, decode_tile_remainder)
{
    /* see issue #3472 - dealing with tiled images where the tile size is
     * not a multiple of image size.
     * The tiled images were created with 'convert' from ImageMagick,
     * using the command 'convert <input> -define tiff:tile-geometry=128x128 -depth [8|16] <output>
     * Note that the conversion to 16 bits expands the range from 0-255 to 0-255*255,
     * so the test converts back but rounding errors cause small differences.
     */
    const string root = cvtest::TS::ptr()->get_data_path();
    cv::Mat img = imread(root + "readwrite/non_tiled.tif",-1);
    ASSERT_FALSE(img.empty());
    ASSERT_TRUE(img.channels() == 3);
    cv::Mat tiled8 = imread(root + "readwrite/tiled_8.tif", -1);
    ASSERT_FALSE(tiled8.empty());
    ASSERT_PRED_FORMAT2(cvtest::MatComparator(0, 0), img, tiled8);
    cv::Mat tiled16 = imread(root + "readwrite/tiled_16.tif", -1);
    ASSERT_FALSE(tiled16.empty());
    ASSERT_TRUE(tiled16.elemSize() == 6);
    tiled16.convertTo(tiled8, CV_8UC3, 1./256.);
    ASSERT_PRED_FORMAT2(cvtest::MatComparator(2, 0), img, tiled8);
    // What about 32, 64 bit?
}
コード例 #3
0
TEST(Haar1DTransform,valid_inputs) {
  const int inputLength = 8;
  WaveletTransform* dwt = new Haar1DTransform();
  double inputData[inputLength] = { 4, 6, 10, 12, 8, 6, 5, 5 };
  std::vector<int> lengthOfDimensions;

  lengthOfDimensions.push_back(inputLength);

  std::vector<int> allowedMaxLevels = WaveletTransform::getMaxLevels(lengthOfDimensions);

  double* transformData = dwt->analyze(inputData, allowedMaxLevels.at(0), lengthOfDimensions);
  double* inverseTransformData = dwt->synthesize(transformData, allowedMaxLevels.at(0), lengthOfDimensions);

  for (int i = 0; i < lengthOfDimensions.at(0); i++) {
    ASSERT_PRED_FORMAT2(::testing::DoubleLE, std::abs(inverseTransformData[i] - inputData[i]), 1e-9);
  }

  delete [] transformData;
  delete [] inverseTransformData;
}
コード例 #4
0
TEST_F(CopyTest, SimpleFileCopy)
{
    GError* error = NULL;
    int ret = gfalt_copy_file(handle, NULL, source, destination, &error);
    ASSERT_PRED_FORMAT2(AssertGfalSuccess, ret, error);
}