forked from freudenreichan/info2Praktikum-NeuronalesNetz
added Unit Tests
This commit is contained in:
1 parent
647716ff66
commit
917ffd276c
1 file changed
+20
@@ -49,6 +49,23 @@ void test_readImagesReturnsCorrectNumberOfImages(void)
|
|||||||
remove(path);
|
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)
|
void test_readImagesReturnsCorrectImageWidth(void)
|
||||||
{
|
{
|
||||||
GrayScaleImageSeries *series = NULL;
|
GrayScaleImageSeries *series = NULL;
|
||||||
@@ -139,5 +156,8 @@ int main()
|
|||||||
RUN_TEST(test_readImagesReturnsNullOnNotExistingPath);
|
RUN_TEST(test_readImagesReturnsNullOnNotExistingPath);
|
||||||
RUN_TEST(test_readImagesFailsOnWrongFileTag);
|
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();
|
return UNITY_END();
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user