Skip to content

Conversation

ricab
Copy link
Collaborator

@ricab ricab commented Mar 1, 2019

Moved from #633 (after rebase and force-push).

@ricab ricab changed the title Mem value sanitizing Mem value sanitizing - take 2 Mar 1, 2019
@ricab
Copy link
Collaborator Author

ricab commented Mar 1, 2019

Commit to address last review issue in #633 coming shortly...

@ricab
Copy link
Collaborator Author

ricab commented Mar 1, 2019

@gerboland I just fixed the last issue you detected

Copy link
Contributor

@gerboland gerboland left a comment

Choose a reason for hiding this comment

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

lgtm!

Copy link
Contributor

@townsend2010 townsend2010 left a comment

Choose a reason for hiding this comment

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

I'm sure I'm missing something, but what in this PR is depending on switching to the C++17 standard?

@ricab
Copy link
Collaborator Author

ricab commented Mar 6, 2019

@townsend2010 only the [[fallthrough]] attribute remains I think.

@townsend2010
Copy link
Contributor

@ricab, Yeah, I saw that, but is it necessary? I'd really like to just get this merged and not be blocked on the move to the C++17 standard.

@ricab
Copy link
Collaborator Author

ricab commented Mar 6, 2019

@townsend2010 without further changes, compilation breaks if I remove it (because a warning is issued which is treated as an error)

@townsend2010
Copy link
Contributor

@ricab, Ok, I was afraid of that:/ Oh well...

@gerboland
Copy link
Contributor

Perhaps the previous "solution": a fallthrough comment, will avoid a warning and mean we can land this?
https://stackoverflow.com/questions/45129741/gcc-7-wimplicit-fallthrough-warnings-and-portable-way-to-clear-them

@ricab
Copy link
Collaborator Author

ricab commented Mar 7, 2019

@gerboland is that enough for clang and msvc too?

@gerboland
Copy link
Contributor

I've seen people say clang supports same thing, but I'll test it on Mac & Windows to be sure.

ricab added 15 commits March 7, 2019 19:59
Use a corrected regular expression to validate memory size values. Accept lowercase suffixes (k, m, g). Improve and extend corresponding tests. Fixes #470.
Test a new memory normalization interface, to simultaneously validate and convert memory values to the smallest unit (bytes).
Implement verification and normalization of memory values in a single step. Use that in the daemon, replacing mere validation. Update hostname validation for consistency. Update tests accordingly. Fixes #616.
Provide a first step to obtain the number of bytes (to compare with other numbers) and a second step to express the same thing as a string that is suitable for backend memory/disk arguments.
Make tests expect error messages in error stream instead.
Makes failing tests pass. Fixes #588.
This attempts to address a review concern.
Use Qt's API rather than the standard library to convert a QString to long long, thus avoiding the intermediate std::string step. This addresses a review concern.
Drop structured-bindings and access struct attributes by name. This addresses a review request.
Replace QString::front with QString::at. The former was only introduced in Qt 5.10 but we are using Qt 5.9.
C++17 is not supported quite yet and this needs to be merged.
@ricab ricab changed the base branch from move-to-cpp17-take2 to master March 8, 2019 11:39
@ricab ricab force-pushed the mem-value-sanitizing branch from 6376d2a to 5732fb9 Compare March 8, 2019 11:41
@ricab ricab changed the title Mem value sanitizing - take 2 Mem value sanitizing - take 3 Mar 8, 2019
@ricab
Copy link
Collaborator Author

ricab commented Mar 8, 2019

OK, just finished rebasing on master and resolving all conflicts. I hope everything is sane...

I had to make a few changes to integrate the new stream encapsulation. The most significant were in this commit, but there were others. Dropped [[fallthrough]] as requested to loose the dependency on C++17.

@ricab ricab requested a review from gerboland March 8, 2019 11:48
@codecov
Copy link

codecov bot commented Mar 8, 2019

Codecov Report

Merging #654 into master will increase coverage by 0.52%.
The diff coverage is 96.07%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #654      +/-   ##
==========================================
+ Coverage   65.86%   66.39%   +0.52%     
==========================================
  Files         165      165              
  Lines        5888     5912      +24     
==========================================
+ Hits         3878     3925      +47     
+ Misses       2010     1987      -23
Impacted Files Coverage Δ
include/multipass/utils.h 0% <ø> (ø) ⬆️
src/client/cmd/launch.cpp 69.76% <100%> (+9.92%) ⬆️
src/utils/utils.cpp 81.3% <95%> (+1.67%) ⬆️
src/daemon/daemon.cpp 20.93% <96.29%> (+0.8%) ⬆️
include/multipass/cli/command.h 62.85% <0%> (+5.71%) ⬆️
src/client/cmd/common_cli.cpp 94.44% <0%> (+19.44%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 47ceef4...5732fb9. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented Mar 8, 2019

Codecov Report

Merging #654 into master will increase coverage by 0.52%.
The diff coverage is 96.07%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #654      +/-   ##
==========================================
+ Coverage   65.86%   66.39%   +0.52%     
==========================================
  Files         165      165              
  Lines        5888     5912      +24     
==========================================
+ Hits         3878     3925      +47     
+ Misses       2010     1987      -23
Impacted Files Coverage Δ
include/multipass/utils.h 0% <ø> (ø) ⬆️
src/client/cmd/launch.cpp 69.76% <100%> (+9.92%) ⬆️
src/utils/utils.cpp 81.3% <95%> (+1.67%) ⬆️
src/daemon/daemon.cpp 20.93% <96.29%> (+0.8%) ⬆️
include/multipass/cli/command.h 62.85% <0%> (+5.71%) ⬆️
src/client/cmd/common_cli.cpp 94.44% <0%> (+19.44%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 47ceef4...5732fb9. Read the comment docs.

Copy link
Contributor

@gerboland gerboland left a comment

Choose a reason for hiding this comment

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

lgtm!
bors r+

bors bot added a commit that referenced this pull request Mar 8, 2019
654: Mem value sanitizing - take 3 r=gerboland a=ricab

Moved from #633 (after rebase and force-push).

Co-authored-by: Ricardo Abreu <[email protected]>
@bors
Copy link
Contributor

bors bot commented Mar 8, 2019

@bors bors bot merged commit 5732fb9 into master Mar 8, 2019
@bors bors bot deleted the mem-value-sanitizing branch March 8, 2019 18:47
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