Coverage Report

Created: 2019-07-03 22:50

/home/liu/buildslave/linux-x64-runtests/build/test/unit/transform.tests.c
Line
Count
Source
1
#include "ccv.h"
2
#include "case.h"
3
#include "ccv_case.h"
4
5
TEST_CASE("matrix decimal slice")
6
1
{
7
1
  ccv_dense_matrix_t* image = 0;
8
1
  ccv_read("../../samples/chessbox.png", &image, CCV_IO_ANY_FILE);
9
1
  ccv_dense_matrix_t* b = 0;
10
1
  ccv_decimal_slice(image, &b, 0, 33.5, 41.5, 111, 91);
11
1
  REQUIRE_MATRIX_FILE_EQ(b, "data/chessbox.decimal.slice.bin", "should have data/chessbox.png sliced at (33.5, 41.5) with 111 x 91");
12
1
  ccv_matrix_free(image);
13
1
  ccv_matrix_free(b);
14
1
}
15
16
TEST_CASE("matrix perspective transform")
17
1
{
18
1
  ccv_dense_matrix_t* image = 0;
19
1
  ccv_read("../../samples/chessbox.png", &image, CCV_IO_ANY_FILE);
20
1
  ccv_dense_matrix_t* b = 0;
21
1
  ccv_perspective_transform(image, &b, 0, cosf(CCV_PI / 6), 0, 0, 0, 1, 0, -sinf(CCV_PI / 6), 0, cosf(CCV_PI / 6));
22
1
  REQUIRE_MATRIX_FILE_EQ(b, "data/chessbox.perspective.transform.bin", "should have data/chessbox.png rotated along y-axis for 30");
23
1
  ccv_matrix_free(image);
24
1
  ccv_matrix_free(b);
25
1
}
26
27
#include "case_main.h"