From 153eca91f6a027dcb113b9deb70cf235f60b32bc Mon Sep 17 00:00:00 2001 From: gitlost Date: Mon, 30 Dec 2024 18:21:02 +0000 Subject: [PATCH] HRI: update AIs to latest gs1-syntax-dictionary.txt --- core/src/HRI.cpp | 12 +++++++++++- test/unit/GS1Test.cpp | 6 ++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/core/src/HRI.cpp b/core/src/HRI.cpp index 9b32878ffe..f264b608f8 100644 --- a/core/src/HRI.cpp +++ b/core/src/HRI.cpp @@ -32,7 +32,7 @@ struct AiInfo } }; -// https://github.com/gs1/gs1-syntax-dictionary 2023-09-22 +// https://github.com/gs1/gs1-syntax-dictionary 2024-06-10 static const AiInfo aiInfos[] = { //TWO_DIGIT_DATA_LENGTH { "00", 18 }, @@ -220,6 +220,16 @@ static const AiInfo aiInfos[] = { { "7240", -20 }, { "7241", 2 }, { "7242", -25 }, + { "7250", 8 }, + { "7251", 12 }, + { "7252", 1 }, + { "7253", -40 }, + { "7254", -40 }, + { "7255", -10 }, + { "7256", -90 }, + { "7257", -70 }, + { "7258", 3 }, + { "7259", -40 }, { "8001", 14 }, { "8002", -20 }, diff --git a/test/unit/GS1Test.cpp b/test/unit/GS1Test.cpp index 063ee182ec..a3f4389324 100644 --- a/test/unit/GS1Test.cpp +++ b/test/unit/GS1Test.cpp @@ -259,6 +259,12 @@ TEST(HRIFromGS1, Single) // Too long EXPECT_EQ(HRIFromGS1("7240123456789012345678901"), ""); + // Fixed length + EXPECT_EQ(HRIFromGS1("72581/2"), "(7258)1/2"); + // Incorrect lengths + EXPECT_EQ(HRIFromGS1("72581/10"), ""); + EXPECT_EQ(HRIFromGS1("725812"), ""); + // Max length EXPECT_EQ(HRIFromGS1("80071234567890123456789012345678901234"), "(8007)1234567890123456789012345678901234"); EXPECT_EQ(HRIFromGS1("8007123456789012345678901234567890123"), "(8007)123456789012345678901234567890123"); 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