Skip to content

Conversation

@KorotinEgor
Copy link

No description provided.

@KorotinEgor
Copy link
Author

@ARBUZNIJ @SosnovskayaUlyana
Приступайте к проверке

Copy link

@ARBUZNIJ ARBUZNIJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Разве мы можем выставлять ограничение "унарный минус должен быть отделён скобками от другой операции"?

Длинную строку не принимает
Ошибка 1

void resize() {
size *= 2;
T* tmp = new T[size];
std::copy(mas, mas + size, tmp);

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;

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));
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

На переменные нет тестов...

Copy link
Author

@KorotinEgor KorotinEgor Dec 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Как это нет? есть
Или я тебя не понял

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Есть на проверку корректности ввода переменных, но на подсчёт выражения с переменными - нет

Copy link
Author

@KorotinEgor KorotinEgor Dec 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Проблема в том, что: чтобы ввести переменные необходим их ввод пользователем, разве мы такое можем реализовать в тестах? + мы до этого так не делали, всё, что касается ввода пользователем не проверялось

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тестируй для известного количества переменных, и тогда можно затолкнуть какие-нибудь значения в переменные при помощи специального метода, минуя ввод с консоли.

@ARBUZNIJ
Copy link

Обвинения в том, что программа не принимает слишком длинную строку, снимаю: ошибка не в твоей реализации


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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Зачем здесь прямое указание поля имён TPostfix::? Аналогично ниже

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Мда, поправил

@KorotinEgor
Copy link
Author

@ValentinV95
Здравствуйте, код готов к проверке

Copy link
Owner

@ValentinV95 ValentinV95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Лабораторная и отчет приняты.
В отчете неправильный теитульный лист

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants