summaryrefslogtreecommitdiff
path: root/fxbarcode
diff options
context:
space:
mode:
Diffstat (limited to 'fxbarcode')
-rw-r--r--fxbarcode/oned/BC_OnedCode39Writer_unittest.cpp22
-rw-r--r--fxbarcode/qrcode/BC_QRCoderEncoder.cpp1
2 files changed, 10 insertions, 13 deletions
diff --git a/fxbarcode/oned/BC_OnedCode39Writer_unittest.cpp b/fxbarcode/oned/BC_OnedCode39Writer_unittest.cpp
index 27a0410637..7a5f56998e 100644
--- a/fxbarcode/oned/BC_OnedCode39Writer_unittest.cpp
+++ b/fxbarcode/oned/BC_OnedCode39Writer_unittest.cpp
@@ -49,6 +49,8 @@ TEST(OnedCode39WriterTest, SetWideNarrowRatio) {
"### # # # ### " // U
"### ### # # # " // M
"# # ### ### #"; // * End
+ for (size_t i = 0; i < strlen(expected); i++)
+ EXPECT_EQ(expected[i] != ' ', !!encoded[i]) << i;
FX_Free(encoded);
writer.SetWideNarrowRatio(2);
@@ -63,6 +65,8 @@ TEST(OnedCode39WriterTest, SetWideNarrowRatio) {
"## # # # ## " // U
"## ## # # # " // M
"# # ## ## #"; // * End
+ for (size_t i = 0; i < strlen(expected); i++)
+ EXPECT_EQ(expected[i] != ' ', !!encoded[i]) << i;
FX_Free(encoded);
}
@@ -79,9 +83,8 @@ TEST(OnedCode39WriterTest, Encode) {
expected =
"# # ### ### # " // * Start
"# # ### ### #"; // * End
- for (size_t i = 0; i < strlen(expected); i++) {
+ for (size_t i = 0; i < strlen(expected); i++)
EXPECT_EQ(expected[i] != ' ', !!encoded[i]) << i;
- }
FX_Free(encoded);
encoded = writer.Encode("123", BCFORMAT_CODE_39, width, height);
@@ -93,9 +96,8 @@ TEST(OnedCode39WriterTest, Encode) {
"# ### # # ### " // 2
"### ### # # # " // 3
"# # ### ### #"; // * End
- for (size_t i = 0; i < strlen(expected); i++) {
+ for (size_t i = 0; i < strlen(expected); i++)
EXPECT_EQ(expected[i] != ' ', !!encoded[i]) << i;
- }
FX_Free(encoded);
encoded = writer.Encode("PDFIUM", BCFORMAT_CODE_39, width, height);
@@ -110,9 +112,8 @@ TEST(OnedCode39WriterTest, Encode) {
"### # # # ### " // U
"### ### # # # " // M
"# # ### ### #"; // * End
- for (size_t i = 0; i < strlen(expected); i++) {
+ for (size_t i = 0; i < strlen(expected); i++)
EXPECT_EQ(expected[i] != ' ', !!encoded[i]) << i;
- }
FX_Free(encoded);
encoded = writer.Encode("A -$%./+Z", BCFORMAT_CODE_39, width, height);
@@ -130,9 +131,8 @@ TEST(OnedCode39WriterTest, Encode) {
"# # # # # " // +
"# ### ### # # " // Z
"# # ### ### #"; // * End
- for (size_t i = 0; i < strlen(expected); i++) {
+ for (size_t i = 0; i < strlen(expected); i++)
EXPECT_EQ(expected[i] != ' ', !!encoded[i]) << i;
- }
FX_Free(encoded);
}
@@ -156,9 +156,8 @@ TEST(OnedCode39WriterTest, Checksum) {
"### ### # # # " // 3 (3)
"# ### ### # # " // 6 (6 = (1 + 2 + 3) % 43)
"# # ### ### #"; // * End
- for (size_t i = 0; i < strlen(expected); i++) {
+ for (size_t i = 0; i < strlen(expected); i++)
EXPECT_EQ(expected[i] != ' ', !!encoded[i]) << i;
- }
FX_Free(encoded);
encoded = writer.Encode("PDFIUM", BCFORMAT_CODE_39, width, height);
@@ -175,9 +174,8 @@ TEST(OnedCode39WriterTest, Checksum) {
"### ### # # # " // M (22)
"### # # ### # " // . (37 = (25 + 13 + 15 + 18 + 30 + 22) % 43)
"# # ### ### #"; // * End
- for (size_t i = 0; i < strlen(expected); i++) {
+ for (size_t i = 0; i < strlen(expected); i++)
EXPECT_EQ(expected[i] != ' ', !!encoded[i]) << i;
- }
FX_Free(encoded);
}
diff --git a/fxbarcode/qrcode/BC_QRCoderEncoder.cpp b/fxbarcode/qrcode/BC_QRCoderEncoder.cpp
index a44dfc39f6..8da2d48e34 100644
--- a/fxbarcode/qrcode/BC_QRCoderEncoder.cpp
+++ b/fxbarcode/qrcode/BC_QRCoderEncoder.cpp
@@ -479,7 +479,6 @@ void SplitString(const ByteString& content,
result->push_back(
{CBC_QRCoderMode::sALPHANUMERIC, content.Mid(flag, index - flag)});
}
- flag = index;
if (index < content.GetLength())
SplitString(content.Right(content.GetLength() - index), result);
}