Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Console][ProgressBar] redrawFrequency should never be 0#16742
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
TomasVotruba commentedNov 29, 2015
Nice PR! Maybe I would add explicit test to cover the change in behavior of |
Tobion commentedNov 29, 2015
👍 But please add a test
There cannot be a test for this. Otherwise it would fail. |
ecdcaab to368423bComparedritter commentedNov 30, 2015
Added tests and rebased against the newest 2.8 branch. |
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.
should be on one line to be consistent
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.
and$output is not used. please remove the var in testRedrawFrequency and testRedrawFrequencyIsAtLeastOneIfSmallerOneGiven as well
…se produce an error.
368423b to6a0a811Comparedritter commentedDec 1, 2015
@Tobion All done. :) |
Tobion commentedDec 1, 2015
👍 Should be merged in 2.7 Status: Reviewed |
stof commentedDec 5, 2015
Thank you@dritter. |
Set the redraw frequency at least to 1. Setting it to 0 would otherwise produce a "division by zero" error.
why?
I had a piece of code that used a ProgressBar and set the redraw frequency to a calculated value. In some cases this calculated value was 0 (or just smaller than 1, internally a cast to
intis made). In thesetProgressthe redraw frequency is used for a calculation of the period. There the error happens (and shows that redraw frequency should never be 0).Ticket
There is no ticket concerning this issue. I could do one, if you want.
Tests
This gets tested implicitly in
ProgressBarTest::testNonDecoratedOutputWithoutMax.