added Unit Tests

This commit is contained in:
lechselle103415 committed 2026-11-09 09:11:31 +01:00
1 parent 647716ff66
commit 917ffd276c
1 file changed
+20
+20
View File
@@ -49,6 +49,23 @@ void test_readImagesReturnsCorrectNumberOfImages(void)
remove(path);
}
void test_mytest_clear_function_NULL(void)
{
clearSeries(NULL); //check if function works with NULL-pointer
}
void test_mytest_clear_function_series_without_images_or_labels(void)
{
GrayScaleImageSeries *series = malloc(sizeof(GrayScaleImageSeries));
TEST_ASSERT_NOT_NULL(series);
series->images = NULL;
series->labels = NULL;
series->count = 0;
clearSeries(series);
}
void test_readImagesReturnsCorrectImageWidth(void)
{
GrayScaleImageSeries *series = NULL;
@@ -139,5 +156,8 @@ int main()
RUN_TEST(test_readImagesReturnsNullOnNotExistingPath);
RUN_TEST(test_readImagesFailsOnWrongFileTag);
RUN_TEST(test_mytest_clear_function_NULL);
RUN_TEST(test_mytest_clear_function_series_without_images_or_labels);
return UNITY_END();
}