You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "szaszm (via GitHub)" <gi...@apache.org> on 2023/02/28 13:20:54 UTC
[GitHub] [nifi-minifi-cpp] szaszm commented on a diff in pull request #1517: MINIFICPP-2048 ARM64 support part 1
szaszm commented on code in PR #1517:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1517#discussion_r1120055690
##########
libminifi/test/unit/StringUtilsTests.cpp:
##########
@@ -388,30 +390,22 @@ TEST_CASE("TestStringUtils::testBase64Decode", "[test base64 decode]") {
REQUIRE("oooooo" == StringUtils::from_base64("b29vb29v", as_string));
REQUIRE("\xfb\xff\xbf" == StringUtils::from_base64("-_-_", as_string));
REQUIRE("\xfb\xff\xbf" == StringUtils::from_base64("+/+/", as_string));
- REQUIRE(std::string({ 0, 16, -125, 16,
- 81, -121, 32, -110,
- -117, 48, -45, -113,
- 65, 20, -109, 81,
- 85, -105, 97, -106,
- -101, 113, -41, -97,
- -126, 24, -93, -110,
- 89, -89, -94, -102,
- -85, -78, -37, -81,
- -61, 28, -77, -45,
- 93, -73, -29, -98,
- -69, -13, -33, -65}) == StringUtils::from_base64("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", as_string));
- REQUIRE(std::string({ 0, 16, -125, 16,
- 81, -121, 32, -110,
- -117, 48, -45, -113,
- 65, 20, -109, 81,
- 85, -105, 97, -106,
- -101, 113, -41, -97,
- -126, 24, -93, -110,
- 89, -89, -94, -102,
- -85, -78, -37, -81,
- -61, 28, -77, -45,
- 93, -73, -29, -98,
- -69, -13, -33, -65}) == StringUtils::from_base64("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_", as_string));
+ std::string expected{
+ static_cast<char>(0), static_cast<char>(16), static_cast<char>(-125), static_cast<char>(16),
+ static_cast<char>(81), static_cast<char>(-121), static_cast<char>(32), static_cast<char>(-110),
+ static_cast<char>(-117), static_cast<char>(48), static_cast<char>(-45), static_cast<char>(-113),
+ static_cast<char>(65), static_cast<char>(20), static_cast<char>(-109), static_cast<char>(81),
+ static_cast<char>(85), static_cast<char>(-105), static_cast<char>(97), static_cast<char>(-106),
+ static_cast<char>(-101), static_cast<char>(113), static_cast<char>(-41), static_cast<char>(-97),
+ static_cast<char>(-126), static_cast<char>(24), static_cast<char>(-93), static_cast<char>(-110),
+ static_cast<char>(89), static_cast<char>(-89), static_cast<char>(-94), static_cast<char>(-102),
+ static_cast<char>(-85), static_cast<char>(-78), static_cast<char>(-37), static_cast<char>(-81),
+ static_cast<char>(-61), static_cast<char>(28), static_cast<char>(-77), static_cast<char>(-45),
+ static_cast<char>(93), static_cast<char>(-73), static_cast<char>(-29), static_cast<char>(-98),
+ static_cast<char>(-69), static_cast<char>(-13), static_cast<char>(-33), static_cast<char>(-65)};
Review Comment:
Can we represent the same in a more compact way, like this?
```suggestion
std::string expected =
"\x00\x10\x83\x10"
"\x51\x87\x20\x92"
"\x8b\x30\xd3\x8f"
"\x41\x14\x93\x51"
"\x55\x97\x61\x96"
"\x9b\x71\xd7\x9f"
"\x82\x18\xa3\x92"
"\x59\xa7\xa2\x9a"
"\xab\xb2\xdb\xaf"
"\xc3\x1c\xb3\xd3"
"\x5d\xb7\xe3\x9e"
"\xbb\xf3\xdf\xbf";
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org