Coverage Report

Created: 2017-11-12 13:27

/home/liu/buildslave/linux-x64-runtests/build/test/ccv_case.h
Line
Count
Source (jump to first uncovered line)
1
#ifndef _GUARD_ccv_case_h_
2
#define _GUARD_ccv_case_h_
3
4
#include <math.h>
5
#include <assert.h>
6
#include <string.h>
7
#include <sys/stat.h>
8
9
47
#define REQUIRE_MATRIX_EQ(a, b, err, ...) { \
10
47
if (
ccv_matrix_eq(a, b) != 047
)
\0
11
0
{ \
12
0
  if (isatty(fileno(stdout))) \
13
0
    printf("\n\t\033[0;31mREQUIRE_MATRIX_EQ\033[0;0m: %s:%d: %s != %s, " err, __FILE__, __LINE__, #a, #b, ##__VA_ARGS__); \
14
0
  else \
15
0
    printf("\n\tREQUIRE_MATRIX_EQ: %s:%d: %s != %s, " err, __FILE__, __LINE__, #a, #b, ##__VA_ARGS__); \
16
0
  
ABORT_CASE0
; \0
17
0
} }
18
19
25
#define REQUIRE_MATRIX_FILE_EQ(a, f, err, ...) { \
20
25
ccv_dense_matrix_t* __case_b__ = 0; \
21
25
ccv_read(f, &__case_b__, CCV_IO_ANY_FILE); \
22
25
if (
ccv_matrix_eq(a, __case_b__) != 025
)
\0
23
0
{ \
24
0
  if (isatty(fileno(stdout))) \
25
0
    printf("\n\t\033[0;31mREQUIRE_MATRIX_FILE_EQ\033[0;0m: %s:%d: %s != %s, " err, __FILE__, __LINE__, #a, #f, ##__VA_ARGS__); \
26
0
  else \
27
0
    printf("\n\tREQUIRE_MATRIX_FILE_EQ: %s:%d: %s != %s, " err, __FILE__, __LINE__, #a, #f, ##__VA_ARGS__); \
28
0
  ccv_matrix_free(__case_b__); \
29
0
  
ABORT_CASE0
; \0
30
25
} \
31
25
ccv_matrix_free(__case_b__); }
32
33
10
#define REQUIRE_ARRAY_EQ_WITHIN_ANGLE_AND_MAGNITUDE(type, a, b, len, angle, magnitude, err, ...) { \
34
10
int __case_i__; \
35
10
double __dot_prod__ = 0, __mag_a__ = 0, __mag_b__ = 0; \
36
1.44k
for (__case_i__ = 0; 
__case_i__ < (len)1.44k
;
__case_i__++1.43k
)
\1.43k
37
1.43k
{ \
38
1.43k
  __dot_prod__ += (double)(((type*)(a))[__case_i__] * ((type*)(b))[__case_i__]); \
39
1.43k
  __mag_a__ += (double)(((type*)(a))[__case_i__] * ((type*)(a))[__case_i__]); \
40
1.43k
  __mag_b__ += (double)(((type*)(b))[__case_i__] * ((type*)(b))[__case_i__]); \
41
1.43k
} \
42
10
__mag_a__ = sqrt(__mag_a__), __mag_b__ = sqrt(__mag_b__); \
43
10
if (
acos(__dot_prod__ / (__mag_a__ * __mag_b__)) * 180 / 3.141592653 > angle || 10
fabs(__mag_a__ - __mag_b__) / 10
ccv_max10
(ccv_max(__mag_a__, __mag_b__), 1) > magnitude)
\0
44
0
{ \
45
0
  if (isatty(fileno(stdout))) \
46
0
    printf("\n\t\033[0;31mREQUIRE_ARRAY_EQ_WITHIN_ANGLE_AND_MAGNITUDE\033[0;0m: %s:%d: angle: %lg | %lg, magnitude: %lg != %lg | +-%lg, " err, __FILE__, __LINE__, (double)(acos(__dot_prod__ / (__mag_a__ * __mag_b__)) * 180 / 3.141592653), (double)angle, __mag_a__, __mag_b__, (double)(magnitude), ##__VA_ARGS__); \
47
0
  else \
48
0
    printf("\n\tREQUIRE_ARRAY_EQ_WITHIN_ANGLE_AND_MAGNITUDE: %s:%d: angle: %lg | %lg, magnitude: %lg != %lg | +-%lg, " err, __FILE__, __LINE__, (double)(acos(__dot_prod__ / (__mag_a__ * __mag_b__)) * 180 / 3.141592653), (double)angle, __mag_a__, __mag_b__, (double)(magnitude), ##__VA_ARGS__); \
49
0
  
ABORT_CASE0
; \0
50
0
} }
51
52
inline static FILE* _ccv_nnc_symbolic_graph_gen(const char* test_case_name)
53
24
{
54
24
  mkdir("gen", S_IRWXU | S_IRGRP | S_IROTH);
55
24
  mkdir("gen/symbolic", S_IRWXU | S_IRGRP | S_IROTH);
56
24
  char sanitized_test_case_name[1024] = "gen/symbolic/";
57
24
  strncpy(sanitized_test_case_name + 13, test_case_name, 1024 - 13);
58
24
  int i;
59
1.65k
  for (i = 13; 
i < 1024 && 1.65k
sanitized_test_case_name[i]1.65k
;
i++1.63k
)
60
24
    // If not A-Za-z0-9, replace with _
61
1.63k
    
if (1.63k
!((sanitized_test_case_name[i] >= 'A' && 1.63k
sanitized_test_case_name[i] <= 'Z'1.07k
) ||
62
1.61k
       
(sanitized_test_case_name[i] >= 'a' && 1.61k
sanitized_test_case_name[i] <= 'z'1.00k
) ||
63
608
       
(sanitized_test_case_name[i] >= '0' && 608
sanitized_test_case_name[i] <= '9'166
)))
64
528
      sanitized_test_case_name[i] = '_';
65
24
  assert(i < 1024);
66
24
  sanitized_test_case_name[i] = '.';
67
24
  sanitized_test_case_name[i + 1] = 'd';
68
24
  sanitized_test_case_name[i + 2] = 'o';
69
24
  sanitized_test_case_name[i + 3] = 't';
70
24
  sanitized_test_case_name[i + 4] = 0;
71
24
  return fopen(sanitized_test_case_name, "w+");
72
24
}
Unexecuted instantiation: tfb.tests.c:_ccv_nnc_symbolic_graph_gen
Unexecuted instantiation: 3rdparty.tests.c:_ccv_nnc_symbolic_graph_gen
Unexecuted instantiation: io.tests.c:_ccv_nnc_symbolic_graph_gen
Unexecuted instantiation: convnet.tests.c:_ccv_nnc_symbolic_graph_gen
Unexecuted instantiation: transform.tests.c:_ccv_nnc_symbolic_graph_gen
Unexecuted instantiation: image_processing.tests.c:_ccv_nnc_symbolic_graph_gen
Unexecuted instantiation: output.tests.c:_ccv_nnc_symbolic_graph_gen
while.tests.c:_ccv_nnc_symbolic_graph_gen
Line
Count
Source
53
7
{
54
7
  mkdir("gen", S_IRWXU | S_IRGRP | S_IROTH);
55
7
  mkdir("gen/symbolic", S_IRWXU | S_IRGRP | S_IROTH);
56
7
  char sanitized_test_case_name[1024] = "gen/symbolic/";
57
7
  strncpy(sanitized_test_case_name + 13, test_case_name, 1024 - 13);
58
7
  int i;
59
573
  for (i = 13; 
i < 1024 && 573
sanitized_test_case_name[i]573
;
i++566
)
60
7
    // If not A-Za-z0-9, replace with _
61
566
    
if (566
!((sanitized_test_case_name[i] >= 'A' && 566
sanitized_test_case_name[i] <= 'Z'357
) ||
62
566
       
(sanitized_test_case_name[i] >= 'a' && 566
sanitized_test_case_name[i] <= 'z'355
) ||
63
211
       
(sanitized_test_case_name[i] >= '0' && 211
sanitized_test_case_name[i] <= '9'34
)))
64
191
      sanitized_test_case_name[i] = '_';
65
7
  assert(i < 1024);
66
7
  sanitized_test_case_name[i] = '.';
67
7
  sanitized_test_case_name[i + 1] = 'd';
68
7
  sanitized_test_case_name[i + 2] = 'o';
69
7
  sanitized_test_case_name[i + 3] = 't';
70
7
  sanitized_test_case_name[i + 4] = 0;
71
7
  return fopen(sanitized_test_case_name, "w+");
72
7
}
Unexecuted instantiation: backward.tests.c:_ccv_nnc_symbolic_graph_gen
Unexecuted instantiation: winograd.tests.c:_ccv_nnc_symbolic_graph_gen
tape.tests.c:_ccv_nnc_symbolic_graph_gen
Line
Count
Source
53
1
{
54
1
  mkdir("gen", S_IRWXU | S_IRGRP | S_IROTH);
55
1
  mkdir("gen/symbolic", S_IRWXU | S_IRGRP | S_IROTH);
56
1
  char sanitized_test_case_name[1024] = "gen/symbolic/";
57
1
  strncpy(sanitized_test_case_name + 13, test_case_name, 1024 - 13);
58
1
  int i;
59
22
  for (i = 13; 
i < 1024 && 22
sanitized_test_case_name[i]22
;
i++21
)
60
1
    // If not A-Za-z0-9, replace with _
61
21
    
if (21
!((sanitized_test_case_name[i] >= 'A' && 21
sanitized_test_case_name[i] <= 'Z'17
) ||
62
21
       
(sanitized_test_case_name[i] >= 'a' && 21
sanitized_test_case_name[i] <= 'z'17
) ||
63
4
       
(sanitized_test_case_name[i] >= '0' && 4
sanitized_test_case_name[i] <= '9'0
)))
64
4
      sanitized_test_case_name[i] = '_';
65
1
  assert(i < 1024);
66
1
  sanitized_test_case_name[i] = '.';
67
1
  sanitized_test_case_name[i + 1] = 'd';
68
1
  sanitized_test_case_name[i + 2] = 'o';
69
1
  sanitized_test_case_name[i + 3] = 't';
70
1
  sanitized_test_case_name[i + 4] = 0;
71
1
  return fopen(sanitized_test_case_name, "w+");
72
1
}
Unexecuted instantiation: tensor.tests.c:_ccv_nnc_symbolic_graph_gen
Unexecuted instantiation: forward.tests.c:_ccv_nnc_symbolic_graph_gen
autograd.tests.c:_ccv_nnc_symbolic_graph_gen
Line
Count
Source
53
3
{
54
3
  mkdir("gen", S_IRWXU | S_IRGRP | S_IROTH);
55
3
  mkdir("gen/symbolic", S_IRWXU | S_IRGRP | S_IROTH);
56
3
  char sanitized_test_case_name[1024] = "gen/symbolic/";
57
3
  strncpy(sanitized_test_case_name + 13, test_case_name, 1024 - 13);
58
3
  int i;
59
205
  for (i = 13; 
i < 1024 && 205
sanitized_test_case_name[i]205
;
i++202
)
60
3
    // If not A-Za-z0-9, replace with _
61
202
    
if (202
!((sanitized_test_case_name[i] >= 'A' && 202
sanitized_test_case_name[i] <= 'Z'106
) ||
62
197
       
(sanitized_test_case_name[i] >= 'a' && 197
sanitized_test_case_name[i] <= 'z'89
) ||
63
108
       
(sanitized_test_case_name[i] >= '0' && 108
sanitized_test_case_name[i] <= '9'36
)))
64
89
      sanitized_test_case_name[i] = '_';
65
3
  assert(i < 1024);
66
3
  sanitized_test_case_name[i] = '.';
67
3
  sanitized_test_case_name[i + 1] = 'd';
68
3
  sanitized_test_case_name[i + 2] = 'o';
69
3
  sanitized_test_case_name[i + 3] = 't';
70
3
  sanitized_test_case_name[i + 4] = 0;
71
3
  return fopen(sanitized_test_case_name, "w+");
72
3
}
Unexecuted instantiation: defects.l0.1.tests.c:_ccv_nnc_symbolic_graph_gen
Unexecuted instantiation: gradient.tests.c:_ccv_nnc_symbolic_graph_gen
while.backward.tests.c:_ccv_nnc_symbolic_graph_gen
Line
Count
Source
53
1
{
54
1
  mkdir("gen", S_IRWXU | S_IRGRP | S_IROTH);
55
1
  mkdir("gen/symbolic", S_IRWXU | S_IRGRP | S_IROTH);
56
1
  char sanitized_test_case_name[1024] = "gen/symbolic/";
57
1
  strncpy(sanitized_test_case_name + 13, test_case_name, 1024 - 13);
58
1
  int i;
59
81
  for (i = 13; 
i < 1024 && 81
sanitized_test_case_name[i]81
;
i++80
)
60
1
    // If not A-Za-z0-9, replace with _
61
80
    
if (80
!((sanitized_test_case_name[i] >= 'A' && 80
sanitized_test_case_name[i] <= 'Z'47
) ||
62
80
       
(sanitized_test_case_name[i] >= 'a' && 80
sanitized_test_case_name[i] <= 'z'47
) ||
63
33
       
(sanitized_test_case_name[i] >= '0' && 33
sanitized_test_case_name[i] <= '9'4
)))
64
32
      sanitized_test_case_name[i] = '_';
65
1
  assert(i < 1024);
66
1
  sanitized_test_case_name[i] = '.';
67
1
  sanitized_test_case_name[i + 1] = 'd';
68
1
  sanitized_test_case_name[i + 2] = 'o';
69
1
  sanitized_test_case_name[i + 3] = 't';
70
1
  sanitized_test_case_name[i + 4] = 0;
71
1
  return fopen(sanitized_test_case_name, "w+");
72
1
}
Unexecuted instantiation: graph.tests.c:_ccv_nnc_symbolic_graph_gen
autograd.vector.tests.c:_ccv_nnc_symbolic_graph_gen
Line
Count
Source
53
7
{
54
7
  mkdir("gen", S_IRWXU | S_IRGRP | S_IROTH);
55
7
  mkdir("gen/symbolic", S_IRWXU | S_IRGRP | S_IROTH);
56
7
  char sanitized_test_case_name[1024] = "gen/symbolic/";
57
7
  strncpy(sanitized_test_case_name + 13, test_case_name, 1024 - 13);
58
7
  int i;
59
570
  for (i = 13; 
i < 1024 && 570
sanitized_test_case_name[i]570
;
i++563
)
60
7
    // If not A-Za-z0-9, replace with _
61
563
    
if (563
!((sanitized_test_case_name[i] >= 'A' && 563
sanitized_test_case_name[i] <= 'Z'382
) ||
62
556
       
(sanitized_test_case_name[i] >= 'a' && 556
sanitized_test_case_name[i] <= 'z'336
) ||
63
220
       
(sanitized_test_case_name[i] >= '0' && 220
sanitized_test_case_name[i] <= '9'92
)))
64
180
      sanitized_test_case_name[i] = '_';
65
7
  assert(i < 1024);
66
7
  sanitized_test_case_name[i] = '.';
67
7
  sanitized_test_case_name[i + 1] = 'd';
68
7
  sanitized_test_case_name[i + 2] = 'o';
69
7
  sanitized_test_case_name[i + 3] = 't';
70
7
  sanitized_test_case_name[i + 4] = 0;
71
7
  return fopen(sanitized_test_case_name, "w+");
72
7
}
symbolic.graph.tests.c:_ccv_nnc_symbolic_graph_gen
Line
Count
Source
53
2
{
54
2
  mkdir("gen", S_IRWXU | S_IRGRP | S_IROTH);
55
2
  mkdir("gen/symbolic", S_IRWXU | S_IRGRP | S_IROTH);
56
2
  char sanitized_test_case_name[1024] = "gen/symbolic/";
57
2
  strncpy(sanitized_test_case_name + 13, test_case_name, 1024 - 13);
58
2
  int i;
59
80
  for (i = 13; 
i < 1024 && 80
sanitized_test_case_name[i]80
;
i++78
)
60
2
    // If not A-Za-z0-9, replace with _
61
78
    
if (78
!((sanitized_test_case_name[i] >= 'A' && 78
sanitized_test_case_name[i] <= 'Z'67
) ||
62
78
       
(sanitized_test_case_name[i] >= 'a' && 78
sanitized_test_case_name[i] <= 'z'67
) ||
63
11
       
(sanitized_test_case_name[i] >= '0' && 11
sanitized_test_case_name[i] <= '9'0
)))
64
11
      sanitized_test_case_name[i] = '_';
65
2
  assert(i < 1024);
66
2
  sanitized_test_case_name[i] = '.';
67
2
  sanitized_test_case_name[i + 1] = 'd';
68
2
  sanitized_test_case_name[i + 2] = 'o';
69
2
  sanitized_test_case_name[i + 3] = 't';
70
2
  sanitized_test_case_name[i + 4] = 0;
71
2
  return fopen(sanitized_test_case_name, "w+");
72
2
}
Unexecuted instantiation: util.tests.c:_ccv_nnc_symbolic_graph_gen
Unexecuted instantiation: basic.tests.c:_ccv_nnc_symbolic_graph_gen
Unexecuted instantiation: numeric.tests.c:_ccv_nnc_symbolic_graph_gen
Unexecuted instantiation: cudnn.tests.c:_ccv_nnc_symbolic_graph_gen
Unexecuted instantiation: graph.vgg.d.tests.c:_ccv_nnc_symbolic_graph_gen
symbolic.graph.vgg.d.tests.c:_ccv_nnc_symbolic_graph_gen
Line
Count
Source
53
1
{
54
1
  mkdir("gen", S_IRWXU | S_IRGRP | S_IROTH);
55
1
  mkdir("gen/symbolic", S_IRWXU | S_IRGRP | S_IROTH);
56
1
  char sanitized_test_case_name[1024] = "gen/symbolic/";
57
1
  strncpy(sanitized_test_case_name + 13, test_case_name, 1024 - 13);
58
1
  int i;
59
49
  for (i = 13; 
i < 1024 && 49
sanitized_test_case_name[i]49
;
i++48
)
60
1
    // If not A-Za-z0-9, replace with _
61
48
    
if (48
!((sanitized_test_case_name[i] >= 'A' && 48
sanitized_test_case_name[i] <= 'Z'41
) ||
62
48
       
(sanitized_test_case_name[i] >= 'a' && 48
sanitized_test_case_name[i] <= 'z'41
) ||
63
7
       
(sanitized_test_case_name[i] >= '0' && 7
sanitized_test_case_name[i] <= '9'0
)))
64
7
      sanitized_test_case_name[i] = '_';
65
1
  assert(i < 1024);
66
1
  sanitized_test_case_name[i] = '.';
67
1
  sanitized_test_case_name[i + 1] = 'd';
68
1
  sanitized_test_case_name[i + 2] = 'o';
69
1
  sanitized_test_case_name[i + 3] = 't';
70
1
  sanitized_test_case_name[i + 4] = 0;
71
1
  return fopen(sanitized_test_case_name, "w+");
72
1
}
dense.net.tests.c:_ccv_nnc_symbolic_graph_gen
Line
Count
Source
53
2
{
54
2
  mkdir("gen", S_IRWXU | S_IRGRP | S_IROTH);
55
2
  mkdir("gen/symbolic", S_IRWXU | S_IRGRP | S_IROTH);
56
2
  char sanitized_test_case_name[1024] = "gen/symbolic/";
57
2
  strncpy(sanitized_test_case_name + 13, test_case_name, 1024 - 13);
58
2
  int i;
59
77
  for (i = 13; 
i < 1024 && 77
sanitized_test_case_name[i]77
;
i++75
)
60
2
    // If not A-Za-z0-9, replace with _
61
75
    
if (75
!((sanitized_test_case_name[i] >= 'A' && 75
sanitized_test_case_name[i] <= 'Z'61
) ||
62
67
       
(sanitized_test_case_name[i] >= 'a' && 67
sanitized_test_case_name[i] <= 'z'53
) ||
63
14
       
(sanitized_test_case_name[i] >= '0' && 14
sanitized_test_case_name[i] <= '9'0
)))
64
14
      sanitized_test_case_name[i] = '_';
65
2
  assert(i < 1024);
66
2
  sanitized_test_case_name[i] = '.';
67
2
  sanitized_test_case_name[i + 1] = 'd';
68
2
  sanitized_test_case_name[i + 2] = 'o';
69
2
  sanitized_test_case_name[i + 3] = 't';
70
2
  sanitized_test_case_name[i + 4] = 0;
71
2
  return fopen(sanitized_test_case_name, "w+");
72
2
}
73
74
inline static FILE* _ccv_nnc_graph_gen(const char* test_case_name)
75
24
{
76
24
  mkdir("gen", S_IRWXU | S_IRGRP | S_IROTH);
77
24
  mkdir("gen/graph", S_IRWXU | S_IRGRP | S_IROTH);
78
24
  char sanitized_test_case_name[1024] = "gen/graph/";
79
24
  strncpy(sanitized_test_case_name + 10, test_case_name, 1024 - 10);
80
24
  int i;
81
1.58k
  for (i = 10; 
i < 1024 && 1.58k
sanitized_test_case_name[i]1.58k
;
i++1.56k
)
82
24
    // If not A-Za-z0-9, replace with _
83
1.56k
    
if (1.56k
!((sanitized_test_case_name[i] >= 'A' && 1.56k
sanitized_test_case_name[i] <= 'Z'966
) ||
84
1.55k
       
(sanitized_test_case_name[i] >= 'a' && 1.55k
sanitized_test_case_name[i] <= 'z'894
) ||
85
656
       
(sanitized_test_case_name[i] >= '0' && 656
sanitized_test_case_name[i] <= '9'196
)))
86
550
      sanitized_test_case_name[i] = '_';
87
24
  assert(i < 1024);
88
24
  sanitized_test_case_name[i] = '.';
89
24
  sanitized_test_case_name[i + 1] = 'd';
90
24
  sanitized_test_case_name[i + 2] = 'o';
91
24
  sanitized_test_case_name[i + 3] = 't';
92
24
  sanitized_test_case_name[i + 4] = 0;
93
24
  return fopen(sanitized_test_case_name, "w+");
94
24
}
Unexecuted instantiation: tfb.tests.c:_ccv_nnc_graph_gen
Unexecuted instantiation: 3rdparty.tests.c:_ccv_nnc_graph_gen
Unexecuted instantiation: io.tests.c:_ccv_nnc_graph_gen
Unexecuted instantiation: convnet.tests.c:_ccv_nnc_graph_gen
Unexecuted instantiation: transform.tests.c:_ccv_nnc_graph_gen
Unexecuted instantiation: image_processing.tests.c:_ccv_nnc_graph_gen
Unexecuted instantiation: output.tests.c:_ccv_nnc_graph_gen
while.tests.c:_ccv_nnc_graph_gen
Line
Count
Source
75
10
{
76
10
  mkdir("gen", S_IRWXU | S_IRGRP | S_IROTH);
77
10
  mkdir("gen/graph", S_IRWXU | S_IRGRP | S_IROTH);
78
10
  char sanitized_test_case_name[1024] = "gen/graph/";
79
10
  strncpy(sanitized_test_case_name + 10, test_case_name, 1024 - 10);
80
10
  int i;
81
764
  for (i = 10; 
i < 1024 && 764
sanitized_test_case_name[i]764
;
i++754
)
82
10
    // If not A-Za-z0-9, replace with _
83
754
    
if (754
!((sanitized_test_case_name[i] >= 'A' && 754
sanitized_test_case_name[i] <= 'Z'478
) ||
84
754
       
(sanitized_test_case_name[i] >= 'a' && 754
sanitized_test_case_name[i] <= 'z'473
) ||
85
281
       
(sanitized_test_case_name[i] >= '0' && 281
sanitized_test_case_name[i] <= '9'56
)))
86
242
      sanitized_test_case_name[i] = '_';
87
10
  assert(i < 1024);
88
10
  sanitized_test_case_name[i] = '.';
89
10
  sanitized_test_case_name[i + 1] = 'd';
90
10
  sanitized_test_case_name[i + 2] = 'o';
91
10
  sanitized_test_case_name[i + 3] = 't';
92
10
  sanitized_test_case_name[i + 4] = 0;
93
10
  return fopen(sanitized_test_case_name, "w+");
94
10
}
Unexecuted instantiation: backward.tests.c:_ccv_nnc_graph_gen
Unexecuted instantiation: winograd.tests.c:_ccv_nnc_graph_gen
tape.tests.c:_ccv_nnc_graph_gen
Line
Count
Source
75
1
{
76
1
  mkdir("gen", S_IRWXU | S_IRGRP | S_IROTH);
77
1
  mkdir("gen/graph", S_IRWXU | S_IRGRP | S_IROTH);
78
1
  char sanitized_test_case_name[1024] = "gen/graph/";
79
1
  strncpy(sanitized_test_case_name + 10, test_case_name, 1024 - 10);
80
1
  int i;
81
22
  for (i = 10; 
i < 1024 && 22
sanitized_test_case_name[i]22
;
i++21
)
82
1
    // If not A-Za-z0-9, replace with _
83
21
    
if (21
!((sanitized_test_case_name[i] >= 'A' && 21
sanitized_test_case_name[i] <= 'Z'17
) ||
84
21
       
(sanitized_test_case_name[i] >= 'a' && 21
sanitized_test_case_name[i] <= 'z'17
) ||
85
4
       
(sanitized_test_case_name[i] >= '0' && 4
sanitized_test_case_name[i] <= '9'0
)))
86
4
      sanitized_test_case_name[i] = '_';
87
1
  assert(i < 1024);
88
1
  sanitized_test_case_name[i] = '.';
89
1
  sanitized_test_case_name[i + 1] = 'd';
90
1
  sanitized_test_case_name[i + 2] = 'o';
91
1
  sanitized_test_case_name[i + 3] = 't';
92
1
  sanitized_test_case_name[i + 4] = 0;
93
1
  return fopen(sanitized_test_case_name, "w+");
94
1
}
Unexecuted instantiation: tensor.tests.c:_ccv_nnc_graph_gen
Unexecuted instantiation: forward.tests.c:_ccv_nnc_graph_gen
autograd.tests.c:_ccv_nnc_graph_gen
Line
Count
Source
75
3
{
76
3
  mkdir("gen", S_IRWXU | S_IRGRP | S_IROTH);
77
3
  mkdir("gen/graph", S_IRWXU | S_IRGRP | S_IROTH);
78
3
  char sanitized_test_case_name[1024] = "gen/graph/";
79
3
  strncpy(sanitized_test_case_name + 10, test_case_name, 1024 - 10);
80
3
  int i;
81
205
  for (i = 10; 
i < 1024 && 205
sanitized_test_case_name[i]205
;
i++202
)
82
3
    // If not A-Za-z0-9, replace with _
83
202
    
if (202
!((sanitized_test_case_name[i] >= 'A' && 202
sanitized_test_case_name[i] <= 'Z'106
) ||
84
197
       
(sanitized_test_case_name[i] >= 'a' && 197
sanitized_test_case_name[i] <= 'z'89
) ||
85
108
       
(sanitized_test_case_name[i] >= '0' && 108
sanitized_test_case_name[i] <= '9'36
)))
86
89
      sanitized_test_case_name[i] = '_';
87
3
  assert(i < 1024);
88
3
  sanitized_test_case_name[i] = '.';
89
3
  sanitized_test_case_name[i + 1] = 'd';
90
3
  sanitized_test_case_name[i + 2] = 'o';
91
3
  sanitized_test_case_name[i + 3] = 't';
92
3
  sanitized_test_case_name[i + 4] = 0;
93
3
  return fopen(sanitized_test_case_name, "w+");
94
3
}
Unexecuted instantiation: defects.l0.1.tests.c:_ccv_nnc_graph_gen
Unexecuted instantiation: gradient.tests.c:_ccv_nnc_graph_gen
while.backward.tests.c:_ccv_nnc_graph_gen
Line
Count
Source
75
2
{
76
2
  mkdir("gen", S_IRWXU | S_IRGRP | S_IROTH);
77
2
  mkdir("gen/graph", S_IRWXU | S_IRGRP | S_IROTH);
78
2
  char sanitized_test_case_name[1024] = "gen/graph/";
79
2
  strncpy(sanitized_test_case_name + 10, test_case_name, 1024 - 10);
80
2
  int i;
81
149
  for (i = 10; 
i < 1024 && 149
sanitized_test_case_name[i]149
;
i++147
)
82
2
    // If not A-Za-z0-9, replace with _
83
147
    
if (147
!((sanitized_test_case_name[i] >= 'A' && 147
sanitized_test_case_name[i] <= 'Z'91
) ||
84
147
       
(sanitized_test_case_name[i] >= 'a' && 147
sanitized_test_case_name[i] <= 'z'90
) ||
85
57
       
(sanitized_test_case_name[i] >= '0' && 57
sanitized_test_case_name[i] <= '9'12
)))
86
49
      sanitized_test_case_name[i] = '_';
87
2
  assert(i < 1024);
88
2
  sanitized_test_case_name[i] = '.';
89
2
  sanitized_test_case_name[i + 1] = 'd';
90
2
  sanitized_test_case_name[i + 2] = 'o';
91
2
  sanitized_test_case_name[i + 3] = 't';
92
2
  sanitized_test_case_name[i + 4] = 0;
93
2
  return fopen(sanitized_test_case_name, "w+");
94
2
}
Unexecuted instantiation: graph.tests.c:_ccv_nnc_graph_gen
autograd.vector.tests.c:_ccv_nnc_graph_gen
Line
Count
Source
75
3
{
76
3
  mkdir("gen", S_IRWXU | S_IRGRP | S_IROTH);
77
3
  mkdir("gen/graph", S_IRWXU | S_IRGRP | S_IROTH);
78
3
  char sanitized_test_case_name[1024] = "gen/graph/";
79
3
  strncpy(sanitized_test_case_name + 10, test_case_name, 1024 - 10);
80
3
  int i;
81
263
  for (i = 10; 
i < 1024 && 263
sanitized_test_case_name[i]263
;
i++260
)
82
3
    // If not A-Za-z0-9, replace with _
83
260
    
if (260
!((sanitized_test_case_name[i] >= 'A' && 260
sanitized_test_case_name[i] <= 'Z'122
) ||
84
254
       
(sanitized_test_case_name[i] >= 'a' && 254
sanitized_test_case_name[i] <= 'z'77
) ||
85
177
       
(sanitized_test_case_name[i] >= '0' && 177
sanitized_test_case_name[i] <= '9'92
)))
86
137
      sanitized_test_case_name[i] = '_';
87
3
  assert(i < 1024);
88
3
  sanitized_test_case_name[i] = '.';
89
3
  sanitized_test_case_name[i + 1] = 'd';
90
3
  sanitized_test_case_name[i + 2] = 'o';
91
3
  sanitized_test_case_name[i + 3] = 't';
92
3
  sanitized_test_case_name[i + 4] = 0;
93
3
  return fopen(sanitized_test_case_name, "w+");
94
3
}
symbolic.graph.tests.c:_ccv_nnc_graph_gen
Line
Count
Source
75
2
{
76
2
  mkdir("gen", S_IRWXU | S_IRGRP | S_IROTH);
77
2
  mkdir("gen/graph", S_IRWXU | S_IRGRP | S_IROTH);
78
2
  char sanitized_test_case_name[1024] = "gen/graph/";
79
2
  strncpy(sanitized_test_case_name + 10, test_case_name, 1024 - 10);
80
2
  int i;
81
80
  for (i = 10; 
i < 1024 && 80
sanitized_test_case_name[i]80
;
i++78
)
82
2
    // If not A-Za-z0-9, replace with _
83
78
    
if (78
!((sanitized_test_case_name[i] >= 'A' && 78
sanitized_test_case_name[i] <= 'Z'67
) ||
84
78
       
(sanitized_test_case_name[i] >= 'a' && 78
sanitized_test_case_name[i] <= 'z'67
) ||
85
11
       
(sanitized_test_case_name[i] >= '0' && 11
sanitized_test_case_name[i] <= '9'0
)))
86
11
      sanitized_test_case_name[i] = '_';
87
2
  assert(i < 1024);
88
2
  sanitized_test_case_name[i] = '.';
89
2
  sanitized_test_case_name[i + 1] = 'd';
90
2
  sanitized_test_case_name[i + 2] = 'o';
91
2
  sanitized_test_case_name[i + 3] = 't';
92
2
  sanitized_test_case_name[i + 4] = 0;
93
2
  return fopen(sanitized_test_case_name, "w+");
94
2
}
Unexecuted instantiation: util.tests.c:_ccv_nnc_graph_gen
Unexecuted instantiation: basic.tests.c:_ccv_nnc_graph_gen
Unexecuted instantiation: numeric.tests.c:_ccv_nnc_graph_gen
Unexecuted instantiation: cudnn.tests.c:_ccv_nnc_graph_gen
graph.vgg.d.tests.c:_ccv_nnc_graph_gen
Line
Count
Source
75
1
{
76
1
  mkdir("gen", S_IRWXU | S_IRGRP | S_IROTH);
77
1
  mkdir("gen/graph", S_IRWXU | S_IRGRP | S_IROTH);
78
1
  char sanitized_test_case_name[1024] = "gen/graph/";
79
1
  strncpy(sanitized_test_case_name + 10, test_case_name, 1024 - 10);
80
1
  int i;
81
25
  for (i = 10; 
i < 1024 && 25
sanitized_test_case_name[i]25
;
i++24
)
82
1
    // If not A-Za-z0-9, replace with _
83
24
    
if (24
!((sanitized_test_case_name[i] >= 'A' && 24
sanitized_test_case_name[i] <= 'Z'19
) ||
84
24
       
(sanitized_test_case_name[i] >= 'a' && 24
sanitized_test_case_name[i] <= 'z'19
) ||
85
5
       
(sanitized_test_case_name[i] >= '0' && 5
sanitized_test_case_name[i] <= '9'0
)))
86
5
      sanitized_test_case_name[i] = '_';
87
1
  assert(i < 1024);
88
1
  sanitized_test_case_name[i] = '.';
89
1
  sanitized_test_case_name[i + 1] = 'd';
90
1
  sanitized_test_case_name[i + 2] = 'o';
91
1
  sanitized_test_case_name[i + 3] = 't';
92
1
  sanitized_test_case_name[i + 4] = 0;
93
1
  return fopen(sanitized_test_case_name, "w+");
94
1
}
symbolic.graph.vgg.d.tests.c:_ccv_nnc_graph_gen
Line
Count
Source
75
1
{
76
1
  mkdir("gen", S_IRWXU | S_IRGRP | S_IROTH);
77
1
  mkdir("gen/graph", S_IRWXU | S_IRGRP | S_IROTH);
78
1
  char sanitized_test_case_name[1024] = "gen/graph/";
79
1
  strncpy(sanitized_test_case_name + 10, test_case_name, 1024 - 10);
80
1
  int i;
81
49
  for (i = 10; 
i < 1024 && 49
sanitized_test_case_name[i]49
;
i++48
)
82
1
    // If not A-Za-z0-9, replace with _
83
48
    
if (48
!((sanitized_test_case_name[i] >= 'A' && 48
sanitized_test_case_name[i] <= 'Z'41
) ||
84
48
       
(sanitized_test_case_name[i] >= 'a' && 48
sanitized_test_case_name[i] <= 'z'41
) ||
85
7
       
(sanitized_test_case_name[i] >= '0' && 7
sanitized_test_case_name[i] <= '9'0
)))
86
7
      sanitized_test_case_name[i] = '_';
87
1
  assert(i < 1024);
88
1
  sanitized_test_case_name[i] = '.';
89
1
  sanitized_test_case_name[i + 1] = 'd';
90
1
  sanitized_test_case_name[i + 2] = 'o';
91
1
  sanitized_test_case_name[i + 3] = 't';
92
1
  sanitized_test_case_name[i + 4] = 0;
93
1
  return fopen(sanitized_test_case_name, "w+");
94
1
}
dense.net.tests.c:_ccv_nnc_graph_gen
Line
Count
Source
75
1
{
76
1
  mkdir("gen", S_IRWXU | S_IRGRP | S_IROTH);
77
1
  mkdir("gen/graph", S_IRWXU | S_IRGRP | S_IROTH);
78
1
  char sanitized_test_case_name[1024] = "gen/graph/";
79
1
  strncpy(sanitized_test_case_name + 10, test_case_name, 1024 - 10);
80
1
  int i;
81
32
  for (i = 10; 
i < 1024 && 32
sanitized_test_case_name[i]32
;
i++31
)
82
1
    // If not A-Za-z0-9, replace with _
83
31
    
if (31
!((sanitized_test_case_name[i] >= 'A' && 31
sanitized_test_case_name[i] <= 'Z'25
) ||
84
27
       
(sanitized_test_case_name[i] >= 'a' && 27
sanitized_test_case_name[i] <= 'z'21
) ||
85
6
       
(sanitized_test_case_name[i] >= '0' && 6
sanitized_test_case_name[i] <= '9'0
)))
86
6
      sanitized_test_case_name[i] = '_';
87
1
  assert(i < 1024);
88
1
  sanitized_test_case_name[i] = '.';
89
1
  sanitized_test_case_name[i + 1] = 'd';
90
1
  sanitized_test_case_name[i + 2] = 'o';
91
1
  sanitized_test_case_name[i + 3] = 't';
92
1
  sanitized_test_case_name[i + 4] = 0;
93
1
  return fopen(sanitized_test_case_name, "w+");
94
1
}
95
96
// Generate dot graph into a designated directory.
97
24
#define SYMBOLIC_GRAPH_GEN(symbolic_graph, type) 
do 24
{ \24
98
24
  FILE* _w_ = _ccv_nnc_symbolic_graph_gen(__case_name__); \
99
24
  ccv_nnc_symbolic_graph_dot(symbolic_graph, type, _w_); \
100
24
  fclose(_w_); \
101
24
} while (0)
102
103
24
#define GRAPH_GEN(graph, type) 
do 24
{ \24
104
24
  FILE* _w_ = _ccv_nnc_graph_gen(__case_name__); \
105
24
  ccv_nnc_graph_dot(graph, type, _w_); \
106
24
  fclose(_w_); \
107
24
} while (0)
108
109
110
#endif