notify gitter on travis build failures
[sddekit.git] / test / test_dat.c
blob481eea2fd28d6e8428603eca610af57eedefe424
1 /* copyright 2016 Apache 2 sddekit authors */
3 #include "sddekit.h"
4 #include "test.h"
6 static int sd_res_conn76_tl25[25] = {
7 2, 2, 0, 2, 0,
8 3, 2, 0, 0, 0,
9 0, 0, 2, 0, 0,
10 2, 0, 2, 2, 2,
11 2, 2, 0, 1, 2
14 TEST(dat, read_square_matrix) {
15 uint32_t i, n;
16 double *w;
17 sd_util_read_square_matrix("bench/conn76/weights.txt", &n, &w);
18 EXPECT_EQ(76, n);
19 for (i=0; i<25; i++)
20 EXPECT_EQ(sd_res_conn76_tl25[i], w[(i/5)*76 + (i%5)]);
21 sd_free(w);