Skip to content

Commit 153eca9

Browse files
committed
HRI: update AIs to latest gs1-syntax-dictionary.txt
1 parent 7a806d3 commit 153eca9

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

core/src/HRI.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct AiInfo
3232
}
3333
};
3434

35-
// https://github.com/gs1/gs1-syntax-dictionary 2023-09-22
35+
// https://github.com/gs1/gs1-syntax-dictionary 2024-06-10
3636
static const AiInfo aiInfos[] = {
3737
//TWO_DIGIT_DATA_LENGTH
3838
{ "00", 18 },
@@ -220,6 +220,16 @@ static const AiInfo aiInfos[] = {
220220
{ "7240", -20 },
221221
{ "7241", 2 },
222222
{ "7242", -25 },
223+
{ "7250", 8 },
224+
{ "7251", 12 },
225+
{ "7252", 1 },
226+
{ "7253", -40 },
227+
{ "7254", -40 },
228+
{ "7255", -10 },
229+
{ "7256", -90 },
230+
{ "7257", -70 },
231+
{ "7258", 3 },
232+
{ "7259", -40 },
223233

224234
{ "8001", 14 },
225235
{ "8002", -20 },

test/unit/GS1Test.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,12 @@ TEST(HRIFromGS1, Single)
259259
// Too long
260260
EXPECT_EQ(HRIFromGS1("7240123456789012345678901"), "");
261261

262+
// Fixed length
263+
EXPECT_EQ(HRIFromGS1("72581/2"), "(7258)1/2");
264+
// Incorrect lengths
265+
EXPECT_EQ(HRIFromGS1("72581/10"), "");
266+
EXPECT_EQ(HRIFromGS1("725812"), "");
267+
262268
// Max length
263269
EXPECT_EQ(HRIFromGS1("80071234567890123456789012345678901234"), "(8007)1234567890123456789012345678901234");
264270
EXPECT_EQ(HRIFromGS1("8007123456789012345678901234567890123"), "(8007)123456789012345678901234567890123");

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy