Open
Conversation
Krestol
reviewed
Oct 11, 2018
|
|
||
| TEST(TernaryNumber, ConvertValidTernaryNumberTest) | ||
| { | ||
| EXPECT_EQ(5, ConvertTernaryToDecimal("012")); |
Collaborator
There was a problem hiding this comment.
Можно было сначала добавить тест на невалидное значение.
Шаг выглядит великоватым.
Collaborator
There was a problem hiding this comment.
- перед этим тестом нужен был тест с пустой строкой
Krestol
reviewed
Oct 11, 2018
| for(int i = numberLen - 1; i >= 0; --i) | ||
| { | ||
| int currentSymbol = static_cast<int>(ternaryNumber[i]) - s_ascii_shift; | ||
| if(currentSymbol > 3 || currentSymbol < 0) |
Collaborator
There was a problem hiding this comment.
Не соответствует условию задачи:
Trinary numbers contain three symbols: 0, 1, and 2.
Krestol
reviewed
Oct 11, 2018
| if(ternaryNumber == "012") | ||
| int sum = 0; | ||
| long value = 1; | ||
| for(int i = ternaryNumber.length() - 1; i >= 0; --i) |
Collaborator
There was a problem hiding this comment.
нет теста на пустую строку - следовательно не покрыт тестом кейс, когда цикл не выполнится ни разу
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.