summaryrefslogtreecommitdiff
path: root/fxbarcode/oned
diff options
context:
space:
mode:
Diffstat (limited to 'fxbarcode/oned')
-rw-r--r--fxbarcode/oned/BC_OnedCode39Writer_unittest.cpp22
1 files changed, 10 insertions, 12 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);
}