-
Notifications
You must be signed in to change notification settings - Fork 12
Коротин Егор #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Коротин Егор #3
Conversation
|
@ARBUZNIJ @SosnovskayaUlyana |
ARBUZNIJ
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| void resize() { | ||
| size *= 2; | ||
| T* tmp = new T[size]; | ||
| std::copy(mas, mas + size, tmp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Копируется size элементов, хотя значения лежат только в size/2 эл-тов
| throw std::out_of_range("There are no elements in this Stack"); | ||
| } | ||
| void clear() { | ||
| count = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не ошибка, но всё же: при очистке лучше откатить stack к заводским, т.е. снова сделать его размер маленьким и очистить лишнюю память
| TEST(TPostfix, count_is_correct) { | ||
| TPostfix str("3+10-2*6/(-3)+((5))-(-sin(1))+tan(3)-cos(2)*cot(1)+log(2)*exp(1)"); | ||
| EXPECT_EQ(true, str.count()-(3 + 10 - 2 * 6 / (-3) + 5 - (-sin(1)) + tan(3) - cos(2) * 1 / tan(1) + log(2) * exp(1))< pow(10,-8)); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
На переменные нет тестов...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Как это нет? есть
Или я тебя не понял
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Есть на проверку корректности ввода переменных, но на подсчёт выражения с переменными - нет
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Проблема в том, что: чтобы ввести переменные необходим их ввод пользователем, разве мы такое можем реализовать в тестах? + мы до этого так не делали, всё, что касается ввода пользователем не проверялось
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Тестируй для известного количества переменных, и тогда можно затолкнуть какие-нибудь значения в переменные при помощи специального метода, минуя ввод с консоли.
|
Обвинения в том, что программа не принимает слишком длинную строку, снимаю: ошибка не в твоей реализации |
include/arithmetic.h
Outdated
|
|
||
| int get_prior(const std::string& s) noexcept; //Method that return the priority of an operation. If it is not an operation returns 0 | ||
|
|
||
| int TPostfix::get_prior(char c) noexcept; //similar method for characters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Зачем здесь прямое указание поля имён TPostfix::? Аналогично ниже
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Мда, поправил
|
@ValentinV95 |
ValentinV95
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Лабораторная и отчет приняты.
В отчете неправильный теитульный лист
No description provided.