create Matrix gefüllt, test unit

This commit is contained in:
Max-R 2025-11-11 10:36:11 +01:00
parent 0e3f03a03d
commit ec54bdd951
2 changed files with 5 additions and 3 deletions

View File

@ -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);

View File

@ -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)