Skip to content

Commit

Permalink
Cleanup testing of bml_add
Browse files Browse the repository at this point in the history
We should be testing all APIs of `bml_test`. This change adds the
missing API tests.
  • Loading branch information
nicolasbock committed Jul 31, 2017
1 parent 9f1d1cf commit ff19607
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include_directories(${CMAKE_SOURCE_DIR}/src/C-interface)

set(SOURCES_TYPED
add_matrix_typed.c
test_bml_add_typed.c
adjacency_matrix_typed.c
adjungate_triangle_matrix_typed.c
allocate_matrix_typed.c
Expand Down Expand Up @@ -39,7 +39,7 @@ set_target_properties(bmltests
POSITION_INDEPENDENT_CODE yes)

add_executable(bml-test
add_matrix.c
test_bml_add.c
adjacency_matrix.c
adjungate_triangle_matrix.c
allocate_matrix.c
Expand Down
2 changes: 1 addition & 1 deletion tests/bml_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const char *test_description[] = {
};

const test_function_t testers[] = {
test_add,
test_bml_add,
test_adjacency,
test_adjungate_triangle,
test_allocate,
Expand Down
2 changes: 1 addition & 1 deletion tests/bml_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ typedef int (
const bml_matrix_precision_t matrix_precision,
const int M);

#include "add_matrix.h"
#include "adjacency_matrix.h"
#include "adjungate_triangle_matrix.h"
#include "allocate_matrix.h"
Expand All @@ -27,6 +26,7 @@ typedef int (
#include "scale_matrix.h"
#include "set_row.h"
#include "submatrix_matrix.h"
#include "test_bml_add.h"
#include "test_bml_gemm.h"
#include "threshold_matrix.h"
#include "trace_matrix.h"
Expand Down
10 changes: 5 additions & 5 deletions tests/add_matrix.c → tests/test_bml_add.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <stdio.h>

int
test_add(
test_bml_add(
const int N,
const bml_matrix_type_t matrix_type,
const bml_matrix_precision_t matrix_precision,
Expand All @@ -13,17 +13,17 @@ test_add(
switch (matrix_precision)
{
case single_real:
return test_add_single_real(N, matrix_type, matrix_precision, M);
return test_bml_add_single_real(N, matrix_type, matrix_precision, M);
break;
case double_real:
return test_add_double_real(N, matrix_type, matrix_precision, M);
return test_bml_add_double_real(N, matrix_type, matrix_precision, M);
break;
case single_complex:
return test_add_single_complex(N, matrix_type, matrix_precision,
return test_bml_add_single_complex(N, matrix_type, matrix_precision,
M);
break;
case double_complex:
return test_add_double_complex(N, matrix_type, matrix_precision,
return test_bml_add_double_complex(N, matrix_type, matrix_precision,
M);
break;
default:
Expand Down
14 changes: 7 additions & 7 deletions tests/add_matrix.h → tests/test_bml_add.h
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
#ifndef __ADD_MATRIX_H
#define __ADD_MATRIX_H
#ifndef __TEST_BML_ADD_H
#define __TEST_BML_ADD_H

#include <bml.h>

int test_add(
int test_bml_add(
const int N,
const bml_matrix_type_t matrix_type,
const bml_matrix_precision_t matrix_precision,
const int M);

int test_add_single_real(
int test_bml_add_single_real(
const int N,
const bml_matrix_type_t matrix_type,
const bml_matrix_precision_t matrix_precision,
const int M);

int test_add_double_real(
int test_bml_add_double_real(
const int N,
const bml_matrix_type_t matrix_type,
const bml_matrix_precision_t matrix_precision,
const int M);

int test_add_single_complex(
int test_bml_add_single_complex(
const int N,
const bml_matrix_type_t matrix_type,
const bml_matrix_precision_t matrix_precision,
const int M);

int test_add_double_complex(
int test_bml_add_double_complex(
const int N,
const bml_matrix_type_t matrix_type,
const bml_matrix_precision_t matrix_precision,
Expand Down
2 changes: 1 addition & 1 deletion tests/add_matrix_typed.c → tests/test_bml_add_typed.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#endif

int TYPED_FUNC(
test_add) (
test_bml_add) (
const int N,
const bml_matrix_type_t matrix_type,
const bml_matrix_precision_t matrix_precision,
Expand Down

0 comments on commit ff19607

Please sign in to comment.