forked from freudenreichan/info2Praktikum-NeuronalesNetz
create Matrix gefüllt, test unit
This commit is contained in:
parent
0e3f03a03d
commit
ec54bdd951
@ -54,7 +54,7 @@ void test_readImagesReturnsCorrectImageWidth(void)
|
|||||||
GrayScaleImageSeries *series = NULL;
|
GrayScaleImageSeries *series = NULL;
|
||||||
const unsigned short expectedWidth = 10;
|
const unsigned short expectedWidth = 10;
|
||||||
const char *path = "testFile.info2";
|
const char *path = "testFile.info2";
|
||||||
prepareImageFile(path, 8, expectedWidth, 2, 1);
|
prepareImageFile(path, expectedWidth, 8, 2, 1);
|
||||||
series = readImages(path);
|
series = readImages(path);
|
||||||
TEST_ASSERT_NOT_NULL(series);
|
TEST_ASSERT_NOT_NULL(series);
|
||||||
TEST_ASSERT_NOT_NULL(series->images);
|
TEST_ASSERT_NOT_NULL(series->images);
|
||||||
@ -70,7 +70,7 @@ void test_readImagesReturnsCorrectImageHeight(void)
|
|||||||
GrayScaleImageSeries *series = NULL;
|
GrayScaleImageSeries *series = NULL;
|
||||||
const unsigned short expectedHeight = 10;
|
const unsigned short expectedHeight = 10;
|
||||||
const char *path = "testFile.info2";
|
const char *path = "testFile.info2";
|
||||||
prepareImageFile(path, expectedHeight, 8, 2, 1);
|
prepareImageFile(path, 8, expectedHeight, 2, 1);
|
||||||
series = readImages(path);
|
series = readImages(path);
|
||||||
TEST_ASSERT_NOT_NULL(series);
|
TEST_ASSERT_NOT_NULL(series);
|
||||||
TEST_ASSERT_NOT_NULL(series->images);
|
TEST_ASSERT_NOT_NULL(series->images);
|
||||||
|
|||||||
4
matrix.c
4
matrix.c
@ -6,7 +6,9 @@
|
|||||||
|
|
||||||
Matrix createMatrix(unsigned int rows, unsigned int cols)
|
Matrix createMatrix(unsigned int rows, unsigned int cols)
|
||||||
{
|
{
|
||||||
|
MatrixType*data= malloc(rows*cols*sizeof(MatrixType));
|
||||||
|
Matrix newMatrix = {rows,cols,data};
|
||||||
|
return newMatrix;
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearMatrix(Matrix *matrix)
|
void clearMatrix(Matrix *matrix)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user