This is an archive of the discontinued LLVM Phabricator instance.

[llvm-rc] Add missing inputs for tag-icon-cursor.test.
ClosedPublic

Authored by mstorsjo on May 13 2018, 1:11 PM.

Details

Summary

This adds the missing input files used for this test, except for the separate input files for specific error cases; matching test input files were provided by Nico Weber. (I found test input files at https://github.com/nico/hack/tree/master/res/test that seem to match most of the missing ones for the existing icon/cursor test.)

The extra copying of files into the %t directory doesn't seem to be necessary since that directory only ever is used for output here, not for inputs.

Diff Detail

Repository
rL LLVM

Event Timeline

mstorsjo created this revision.May 13 2018, 1:11 PM
mstorsjo added inline comments.May 13 2018, 2:04 PM
test/tools/llvm-rc/tag-icon-cursor.test
159 ↗(On Diff #146528)

FWIW, the previous value here seems to be what rc.exe produces, so something is wrong in the current codebase. But improving the test coverage for the current code as it stands probably also is worthwhile, even if there are known issues?

amccarth added inline comments.May 14 2018, 8:28 AM
test/tools/llvm-rc/tag-icon-cursor.test
159 ↗(On Diff #146528)

From the Wikipedia info on the ICO format, this appears to be the bits-per-pixel field (assuming it's an icon and not a cursor). There's a note that says the field may be 0 (in most cases) because the bits-per-pixel can (usually) be inferred.

My guess is the source file has 0 and llvm-rc copies it verbatim while rc.exe infers the BPP and sets it explicitly. In theory, it should work either way.

Maybe add a comment here so that if we ever do match rc.exe, nobody has to sweat the details to make the test pass.

amccarth accepted this revision.May 14 2018, 8:35 AM

Ah, I see you figured out the discrepancy in a follow-on patch (46816), so this LGTM.

This revision is now accepted and ready to land.May 14 2018, 8:35 AM
This revision was automatically updated to reflect the committed changes.