@@ -363,6 +363,9 @@ static int testMapcodeFormats(void) {
363363 {"DDD.L " , ERR_INVALID_MAPCODE_FORMAT , ERR_OK }, // 7.0 : postfix too short
364364 {"DDDDDD xx.xx" , ERR_INVALID_MAPCODE_FORMAT , ERR_OK }, // 5/2 : 6char ter
365365 {"DDDDDD.xxx" , ERR_INVALID_MAPCODE_FORMAT , ERR_OK }, // 5/2 : 6char mc
366+ {"XXXX.XXXXX" , ERR_OK , ERR_MISSING_TERRITORY }, // 4/5
367+ {"XXXXX.XXXXX" , ERR_OK , ERR_MAPCODE_UNDECODABLE }, // 5/5
368+
366369 // errors because there are too many letters after a postfix vowel
367370 {"XXXX.AXXX" , ERR_INVALID_VOWEL , ERR_OK },
368371 {"nld XXXX.AXX" , ERR_INVALID_VOWEL , ERR_OK },
@@ -374,10 +377,13 @@ static int testMapcodeFormats(void) {
374377 // 5th letter
375378 {"nld DD.DDDDD " , ERR_OK , ERR_MAPCODE_UNDECODABLE },
376379 {"nld XXXX.XXXXX" , ERR_OK , ERR_MAPCODE_UNDECODABLE },
377- {" TAM XX.XXXXX-XX " , ERR_OK , ERR_MAPCODE_UNDECODABLE },
378- {" TAM XXX.XXXXX-XX " , ERR_OK , ERR_MAPCODE_UNDECODABLE },
379- {" TAM XXXX.XXXXX-X " , ERR_OK , ERR_MAPCODE_UNDECODABLE },
380- {" TAM XXXXX.XXXXX-X " , ERR_OK , ERR_MAPCODE_UNDECODABLE },
380+ {"TAM XX.XXXXX-XX" , ERR_OK , ERR_MAPCODE_UNDECODABLE },
381+ {"TAM XXX.XXXXX-XX" , ERR_OK , ERR_MAPCODE_UNDECODABLE },
382+ {"TAM XXXX.XXXXX-X" , ERR_OK , ERR_MAPCODE_UNDECODABLE },
383+ {"TAM XXXXX.XXXXX-X" , ERR_OK , ERR_MAPCODE_UNDECODABLE },
384+ {"40822.schol" , ERR_OK , ERR_MAPCODE_UNDECODABLE },
385+ {"AAA 40822.schol" , ERR_OK , ERR_MAPCODE_UNDECODABLE },
386+
381387 // errors because the postfix has a 6th letter
382388 {"DD.DDDDDD " , ERR_INVALID_MAPCODE_FORMAT , ERR_OK },
383389 {"nld XXXX.XXXXXX" , ERR_INVALID_MAPCODE_FORMAT , ERR_OK },
@@ -477,11 +483,11 @@ static int testAlphabetParser(void) {
477483 enum Alphabet alphabet ;
478484 const char * expected ;
479485 } convertTests [] = {
480- {"nld bc.XY-p2q" , ALPHABET_ROMAN , "nld BC.XY-P2Q" },
481- {"DNK PQ.XX" , ALPHABET_DEVANAGARI , "DNK नप.सस" },
482- {"GBR XX.XX" , ALPHABET_HEBREW , "GBR רר.56ר" },
483- {"BEL PQ.XP" , ALPHABET_ARABIC , "BEL طظ.56ط" },
484- {"nld 00.E0" , ALPHABET_GREEK , "nld \xCE\x91\x30.12" }
486+ {"nld bc.XY-p2q" , ALPHABET_ROMAN , "nld BC.XY-P2Q" },
487+ {"DNK PQ.XX" , ALPHABET_DEVANAGARI , "DNK नप.सस" },
488+ {"GBR XX.XX" , ALPHABET_HEBREW , "GBR רר.56ר" },
489+ {"BEL PQ.XP" , ALPHABET_ARABIC , "BEL طظ.56ط" },
490+ {"nld 00.E0" , ALPHABET_GREEK , "nld \xCE\x91\x30.12" }
485491 };
486492 int i ;
487493 for (i = 0 ; i < (int ) (sizeof (convertTests ) / sizeof (convertTests [0 ])); i ++ ) {
@@ -921,8 +927,8 @@ static int testTerritories() {
921927 ++ nrTests ;
922928 if (strcmp (getTerritoryIsoName (nam , TERRITORY_US_CA , 1 ), "CA" ) ||
923929 strcmp (getTerritoryIsoName (nam , TERRITORY_IN_DD , 1 ), "DD" ) ||
924- strcmp (getTerritoryIsoName (nam , TERRITORY_NLD , 1 ), "NLD" ) ||
925- strcmp (getTerritoryIsoName (nam , TERRITORY_USA , 1 ), "USA" )) {
930+ strcmp (getTerritoryIsoName (nam , TERRITORY_NLD , 1 ), "NLD" ) ||
931+ strcmp (getTerritoryIsoName (nam , TERRITORY_USA , 1 ), "USA" )) {
926932 foundError ();
927933 printf ("*** ERROR *** getTerritoryIsoName returned bad short versions\n" );
928934 }
@@ -1267,16 +1273,16 @@ static int testTerritoryCode(void) {
12671273 {TERRITORY_NONE , TERRITORY_NONE },
12681274 {_TERRITORY_MIN , TERRITORY_NONE },
12691275 {TERRITORY_VAT , TERRITORY_NONE },
1270- {TERRITORY_MX_DIF , TERRITORY_MEX },
1271- {TERRITORY_MX_CHH , TERRITORY_MEX },
1276+ {TERRITORY_MX_DIF , TERRITORY_MEX },
1277+ {TERRITORY_MX_CHH , TERRITORY_MEX },
12721278 {TERRITORY_GRL , TERRITORY_NONE },
1273- {TERRITORY_IN_DD , TERRITORY_IND },
1274- {TERRITORY_AU_VIC , TERRITORY_AUS },
1275- {TERRITORY_BR_DF , TERRITORY_BRA },
1276- {TERRITORY_US_AL , TERRITORY_USA },
1277- {TERRITORY_CA_NU , TERRITORY_CAN },
1278- {TERRITORY_RU_LIP , TERRITORY_RUS },
1279- {TERRITORY_CN_HA , TERRITORY_CHN },
1279+ {TERRITORY_IN_DD , TERRITORY_IND },
1280+ {TERRITORY_AU_VIC , TERRITORY_AUS },
1281+ {TERRITORY_BR_DF , TERRITORY_BRA },
1282+ {TERRITORY_US_AL , TERRITORY_USA },
1283+ {TERRITORY_CA_NU , TERRITORY_CAN },
1284+ {TERRITORY_RU_LIP , TERRITORY_RUS },
1285+ {TERRITORY_CN_HA , TERRITORY_CHN },
12801286 {TERRITORY_AAA , TERRITORY_NONE },
12811287 {_TERRITORY_MAX , TERRITORY_NONE },
12821288 {TERRITORY_UNKNOWN , TERRITORY_NONE }
@@ -1523,7 +1529,6 @@ static int testDecodeRobustness(void) {
15231529 nrTests += testCorrectDecode ("MEX 49.4V" , tc );
15241530 nrTests += testCorrectDecode ("NLD XX.XX" , TERRITORY_NONE );
15251531 nrTests += testCorrectDecode ("MX XX.XX" , TERRITORY_NONE );
1526- nrTests += testCorrectDecode ("AAA 40822.schol" , TERRITORY_NONE );
15271532
15281533 s1 [0 ] = 0 ;
15291534 nrTests += testIncorrectDecode (s1 , TERRITORY_NONE );
@@ -1788,7 +1793,7 @@ int testGetFullTerritoryName(void) {
17881793 const TerritoryAlphabets * territoryAlphabets ;
17891794 char territoryName [MAX_TERRITORY_FULLNAME_UTF8_LEN + 1024 ]; // large so we can test overflow
17901795 static const char * locales_to_test [] = {
1791- "AF" , "AR" , "BE" , "CN" , "CS" , "DA" , "DE" , "EN" , "FI" , "ES" , "FR" , "HE" , "HI" ,
1796+ "AF" , "AR" , "BE" , "CN" , "CS" , "DA" , "DE" , "EN" , "FI" , "ES" , "FR" , "HE" , "HI" ,
17921797 "HR" , "ID" , "IT" , "JA" , "KO" , "NL" , "NO" , "PL" , "PT" , "RU" , "SV" , "SW" , "TR" , "UK" };
17931798
17941799 nrTests += testGetFullTerritoryNameInLocale ("Sancta Sedes" , TERRITORY_VAT , 0 , NULL ); // Local name.
@@ -1839,7 +1844,7 @@ int testGetFullTerritoryName(void) {
18391844 for (i = 0 ; i < territoryAlphabets -> count ; i ++ ) {
18401845 nrTests ++ ;
18411846 if (!getFullTerritoryNameLocalInAlphabetUtf8 (territoryName , territory , 0 ,
1842- territoryAlphabets -> alphabet [i ])) {
1847+ territoryAlphabets -> alphabet [i ])) {
18431848 char s [MAX_ISOCODE_ASCII_LEN + 1 ];
18441849 foundError ();
18451850 printf ("*** ERROR *** getFullTerritoryNameLocal territory %s has NO name in common alphabet (%d)\n" ,
0 commit comments