Append a unicode character to all test strings such that
unicode characters are tested.
Details
tests pass
Diff Detail
- Repository
- R286 KFileMetaData
- Branch
- taglib_write_unicode
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 3187 Build 3205: arc lint + arc unit
autotests/taglibwritertest.cpp | ||
---|---|---|
66 | I suggest checking that the last bytes of all these extracted things is the actual actual utf8 bytes, so that if someone compiles or saves this file in a broken encoding that the testing doesn't fail. | |
76 | Given stringSuffix is the same for all tests, is it needed to have as a test data thing ? |
autotests/taglibwritertest.cpp | ||
---|---|---|
66 | ? | |
76 | My idea here was to check each format twice, once with a simple latin1/ascii string (stringsuffix = "") and a second time with some unicode chars (e.g. "€", probably some more from other code blocks). This allows to differentiate if only unicode tags are broken. |
autotests/taglibwritertest.cpp | ||
---|---|---|
66 | yeah. given you write and read it, if somehow it gets encoded e.g. as iso-8859-15 rather than utf8, the euro sign would be encoded as 0xa4 rather than 0x20ac. As you write and read it in the same sequence, there is a possibiliyt for this to pass when it shouldn't. Unfortunately roundtripping the files with bad editors can make this happen. Especially on windows. |
autotests/taglibwritertest.cpp | ||
---|---|---|
66 | Something along those lines, yes please, to compare with. |
autotests/taglibwritertest.cpp | ||
---|---|---|
66 | This should be covered by the read tests. The read tests use binary artifacts. |
autotests/taglibwritertest.cpp | ||
---|---|---|
60–62 | Is wrapping in a QString necessary? |
autotests/taglibwritertest.cpp | ||
---|---|---|
60–62 | It does not compile otherwise. |
autotests/taglibwritertest.cpp | ||
---|---|---|
60 | I don't think it is a good idea to do a stringSuffix.toUtf8().fromUtf8() round trip here for each test case and for each tag. | |
73 | If safeguarding against bad editors is really necessary, better do it here. error: converting to execution character set: Invalid or incomplete multibyte or wide character QString a{u"�"}; |
autotests/taglibwritertest.cpp | ||
---|---|---|
73 | Yes, probably. // Add some unicode characters, use codepoints to avoid any issues with // source encoding: "€µ" static const QChar data[4] = { 0x20ac, 0xb5 }; QString unicodeTestStringSuffix(data, 2); |
autotests/taglibwritertest.cpp | ||
---|---|---|
145 | ^ unicodeTestStringSuffix ? |
Can you fix up the grammar in the Summary?
"Append some unicode characters to each test string such that unicode characters can be tested."
Otherwise good to go ...
autotests/taglibwritertest.cpp | ||
---|---|---|
75 | can you change this to data[2] ... |
autotests/taglibwritertest.cpp | ||
---|---|---|
75 | I should have spotted this myself :) |