From ec54bdd9513f229a69244b3da43d80b0c0a5f535 Mon Sep 17 00:00:00 2001 From: Max-R Date: Tue, 11 Nov 2025 10:36:11 +0100 Subject: [PATCH] =?UTF-8?q?create=20Matrix=20gef=C3=BCllt,=20test=20unit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- imageInputTests.c | 4 ++-- matrix.c | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/imageInputTests.c b/imageInputTests.c index c704271..03240ab 100644 --- a/imageInputTests.c +++ b/imageInputTests.c @@ -54,7 +54,7 @@ void test_readImagesReturnsCorrectImageWidth(void) GrayScaleImageSeries *series = NULL; const unsigned short expectedWidth = 10; const char *path = "testFile.info2"; - prepareImageFile(path, 8, expectedWidth, 2, 1); + prepareImageFile(path, expectedWidth, 8, 2, 1); series = readImages(path); TEST_ASSERT_NOT_NULL(series); TEST_ASSERT_NOT_NULL(series->images); @@ -70,7 +70,7 @@ void test_readImagesReturnsCorrectImageHeight(void) GrayScaleImageSeries *series = NULL; const unsigned short expectedHeight = 10; const char *path = "testFile.info2"; - prepareImageFile(path, expectedHeight, 8, 2, 1); + prepareImageFile(path, 8, expectedHeight, 2, 1); series = readImages(path); TEST_ASSERT_NOT_NULL(series); TEST_ASSERT_NOT_NULL(series->images); diff --git a/matrix.c b/matrix.c index ad00628..66a3b4a 100644 --- a/matrix.c +++ b/matrix.c @@ -6,7 +6,9 @@ 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)