Skip to content
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

switch case order and fallthrough. Fixes #211 and #661 #662

Conversation

kamphaus
Copy link
Contributor

@kamphaus kamphaus commented Apr 4, 2018

Fixes #661
Fixes #211


This change is Reviewable

@codecov
Copy link

codecov bot commented Apr 4, 2018

Codecov Report

Merging #662 into master will decrease coverage by 0.03%.
The diff coverage is 77.27%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #662      +/-   ##
==========================================
- Coverage    81.8%   81.77%   -0.04%     
==========================================
  Files         160      160              
  Lines        8503     8514      +11     
==========================================
+ Hits         6956     6962       +6     
- Misses       1153     1155       +2     
- Partials      394      397       +3
Impacted Files Coverage Δ
transpiler/switch.go 78.82% <77.27%> (-1.68%) ⬇️

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 39ff5f2...3dd5123. Read the comment docs.

@elliotchance
Copy link
Owner

Reviewed 6 of 6 files at r1.
Review status: all files reviewed at latest revision, all discussions resolved.


tests/code_quality/for.expected.c, line 10 at r1 (raw file):

package code_quality

// f1 - transpiled function from  /go/src/github.com/elliotchance/c2go/tests/code_quality/for.c:1

Why did you need to change these paths and version above for the four files? I thought @Konstantin8105 originally wrote the tests to be resilient against this...


Comments from Reviewable

@kamphaus
Copy link
Contributor Author

kamphaus commented Apr 5, 2018

tests/code_quality/for.expected.c, line 10 at r1 (raw file):

Previously, elliotchance (Elliot Chance) wrote…

Why did you need to change these paths and version above for the four files? I thought @Konstantin8105 originally wrote the tests to be resilient against this...

The tests/code_quality/*.expected.c files are the transpilation results for tests/code_quality/*.c and are generated by tests/code_quality/generate.sh.
I guess that the c2go version used to initially generate these (v0.21.0 Zinc 2018-01-11) output relative paths, while the newer version (v0.21.16 Zinc 2018-04-02) uses absolute paths.

Anyway the test for these files (main_test.go:TestCodeQuality()) strips all comments and whitespace before comparison, so it's fine.


Comments from Reviewable

@elliotchance
Copy link
Owner

Review status: all files reviewed at latest revision, 1 unresolved discussion.


tests/code_quality/for.expected.c, line 10 at r1 (raw file):

Previously, kamphaus wrote…

The tests/code_quality/*.expected.c files are the transpilation results for tests/code_quality/*.c and are generated by tests/code_quality/generate.sh.
I guess that the c2go version used to initially generate these (v0.21.0 Zinc 2018-01-11) output relative paths, while the newer version (v0.21.16 Zinc 2018-04-02) uses absolute paths.

Anyway the test for these files (main_test.go:TestCodeQuality()) strips all comments and whitespace before comparison, so it's fine.

If comments are stripped, can you please remove your changes so the next person doesn't get the idea that the changes are important for tests passing, or updates the comments again.


Comments from Reviewable

@elliotchance elliotchance changed the title Fix 661 switch case order and fallthrough switch case order and fallthrough. Fixes #661 Apr 5, 2018
@kamphaus
Copy link
Contributor Author

kamphaus commented Apr 5, 2018

tests/code_quality/for.expected.c, line 10 at r1 (raw file):

Previously, elliotchance (Elliot Chance) wrote…

If comments are stripped, can you please remove your changes so the next person doesn't get the idea that the changes are important for tests passing, or updates the comments again.

I have changed the generation script to normalized the comments to tests/code_quality/....


Comments from Reviewable

@elliotchance
Copy link
Owner

Reviewed 5 of 5 files at r2.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@elliotchance elliotchance merged commit 70ae712 into elliotchance:master Apr 5, 2018
@elliotchance elliotchance changed the title switch case order and fallthrough. Fixes #661 switch case order and fallthrough. Fixes #221 and #661 Apr 5, 2018
@kamphaus
Copy link
Contributor Author

kamphaus commented Apr 6, 2018

@elliotchance Did you make a typo when you renamed this PR?
It fixes #211, not #221.

@elliotchance
Copy link
Owner

Ah, yes sorry. I will fix that.

@elliotchance elliotchance changed the title switch case order and fallthrough. Fixes #221 and #661 switch case order and fallthrough. Fixes #211 and #661 Apr 7, 2018
@kamphaus kamphaus deleted the fix-661-switch-case-order-and-fallthrough branch April 20, 2018 06:40
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