Conversation
src/sortedlist.c
Outdated
| #ifdef TESTS | ||
| #include "tests.h" | ||
| #endif |
There was a problem hiding this comment.
Сортированный список -- это по сути библиотека, и он не должен включать свои тесты. В Вашем случае надо вынести main в отдельный файл.
И в CMake это будет выглядеть так же: два add_library и один add_executable. Кстати, где CMake?
src/sortedlist.c
Outdated
|
|
||
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
Сомневаюсь, что по стайлгайду здесь должна быть такая дыра.
src/sortedlist.c
Outdated
| } | ||
| void destroy(List* l) { |
There was a problem hiding this comment.
А вот здесь как раз должен быть отступ.
src/sortedlist.c
Outdated
| int main(int argc, char* argv[]) { | ||
| for (int i = 1; i < argc; i++) { | ||
| if (strcmp(argv[i], "--test") == 0) { | ||
| #ifdef TESTS |
There was a problem hiding this comment.
Довольно устаревший подход с макросами. С CMake всё можно сделать гораздо проще.
|
|
||
| void deleting(List* l, int a); | ||
|
|
||
| void destroy(List* l); No newline at end of file |
There was a problem hiding this comment.
FYI: Возможно я это уже Вам говорил, но объекты уничтожают (destruct), а не разрушают (destroy).
| emptyList(); | ||
| sortedList(); | ||
| deletingList(); |
There was a problem hiding this comment.
Как-то мало тестов для задачи на 4 балла. Как минимум, ещё надо проверить, что все функции работают на пустом списке и на списке с дубликатами.
p-senichenkov
left a comment
There was a problem hiding this comment.
Одного теста недостаточно
No description provided.