Add regression test for #869.
This issue didn't actually affect current version,
but add the test in any case.
diff --git a/tests/regression/issue_869/SConscript b/tests/regression/issue_869/SConscript
new file mode 100644
index 0000000..4adda3b
--- /dev/null
+++ b/tests/regression/issue_869/SConscript
@@ -0,0 +1,7 @@
+# Regression test for #869:
+# Generation of PB_STATIC_ASSERT can lead to an identified that exceeds compiler maximum length
+
+Import("env")
+
+env.NanopbProto("bigfile.proto")
+env.Object("bigfile.pb.c")
diff --git a/tests/regression/issue_869/bigfile.proto b/tests/regression/issue_869/bigfile.proto
new file mode 100644
index 0000000..99a8761
--- /dev/null
+++ b/tests/regression/issue_869/bigfile.proto
@@ -0,0 +1,623 @@
+// Test generation and compilation with a file that contains a lot of messages.
+// This tests for symbol name size exceeding limits.
+
+syntax = "proto3";
+
+message LongMessage {
+ int32 field1 = 1;
+ int32 field2 = 2;
+ int32 field3 = 3;
+ int32 field4 = 4;
+ int32 field5 = 5;
+ int32 field6 = 6;
+ int32 field7 = 7;
+ int32 field8 = 8;
+ int32 field9 = 9;
+ int32 field10 = 10;
+ int32 field11 = 11;
+ int32 field12 = 12;
+ int32 field13 = 13;
+ int32 field14 = 14;
+ int32 field15 = 15;
+ int32 field16 = 16;
+ int32 field17 = 17;
+ int32 field18 = 18;
+ int32 field19 = 19;
+ int32 field20 = 20;
+ int32 field21 = 21;
+ int32 field22 = 22;
+ int32 field23 = 23;
+ int32 field24 = 24;
+ int32 field25 = 25;
+ int32 field26 = 26;
+ int32 field27 = 27;
+ int32 field28 = 28;
+ int32 field29 = 29;
+ int32 field30 = 30;
+ int32 field31 = 31;
+ int32 field32 = 32;
+ int32 field33 = 33;
+ int32 field34 = 34;
+ int32 field35 = 35;
+ int32 field36 = 36;
+ int32 field37 = 37;
+ int32 field38 = 38;
+ int32 field39 = 39;
+ int32 field40 = 40;
+ int32 field41 = 41;
+ int32 field42 = 42;
+ int32 field43 = 43;
+ int32 field44 = 44;
+ int32 field45 = 45;
+ int32 field46 = 46;
+ int32 field47 = 47;
+ int32 field48 = 48;
+ int32 field49 = 49;
+ int32 field50 = 50;
+ int32 field51 = 51;
+ int32 field52 = 52;
+ int32 field53 = 53;
+ int32 field54 = 54;
+ int32 field55 = 55;
+ int32 field56 = 56;
+ int32 field57 = 57;
+ int32 field58 = 58;
+ int32 field59 = 59;
+ int32 field60 = 60;
+ int32 field61 = 61;
+ int32 field62 = 62;
+ int32 field63 = 63;
+ int32 field64 = 64;
+ int32 field65 = 65;
+ int32 field66 = 66;
+ int32 field67 = 67;
+ int32 field68 = 68;
+ int32 field69 = 69;
+ int32 field70 = 70;
+ int32 field71 = 71;
+ int32 field72 = 72;
+ int32 field73 = 73;
+ int32 field74 = 74;
+ int32 field75 = 75;
+ int32 field76 = 76;
+ int32 field77 = 77;
+ int32 field78 = 78;
+ int32 field79 = 79;
+ int32 field80 = 80;
+ int32 field81 = 81;
+ int32 field82 = 82;
+ int32 field83 = 83;
+ int32 field84 = 84;
+ int32 field85 = 85;
+ int32 field86 = 86;
+ int32 field87 = 87;
+ int32 field88 = 88;
+ int32 field89 = 89;
+ int32 field90 = 90;
+ int32 field91 = 91;
+ int32 field92 = 92;
+ int32 field93 = 93;
+ int32 field94 = 94;
+ int32 field95 = 95;
+ int32 field96 = 96;
+ int32 field97 = 97;
+ int32 field98 = 98;
+ int32 field99 = 99;
+ int32 field100 = 100;
+ int32 field101 = 101;
+ int32 field102 = 102;
+ int32 field103 = 103;
+ int32 field104 = 104;
+ int32 field105 = 105;
+ int32 field106 = 106;
+ int32 field107 = 107;
+ int32 field108 = 108;
+ int32 field109 = 109;
+ int32 field110 = 110;
+ int32 field111 = 111;
+ int32 field112 = 112;
+ int32 field113 = 113;
+ int32 field114 = 114;
+ int32 field115 = 115;
+ int32 field116 = 116;
+ int32 field117 = 117;
+ int32 field118 = 118;
+ int32 field119 = 119;
+ int32 field120 = 120;
+ int32 field121 = 121;
+ int32 field122 = 122;
+ int32 field123 = 123;
+ int32 field124 = 124;
+ int32 field125 = 125;
+ int32 field126 = 126;
+ int32 field127 = 127;
+ int32 field128 = 128;
+ int32 field129 = 129;
+ int32 field130 = 130;
+ int32 field131 = 131;
+ int32 field132 = 132;
+ int32 field133 = 133;
+ int32 field134 = 134;
+ int32 field135 = 135;
+ int32 field136 = 136;
+ int32 field137 = 137;
+ int32 field138 = 138;
+ int32 field139 = 139;
+ int32 field140 = 140;
+ int32 field141 = 141;
+ int32 field142 = 142;
+ int32 field143 = 143;
+ int32 field144 = 144;
+ int32 field145 = 145;
+ int32 field146 = 146;
+ int32 field147 = 147;
+ int32 field148 = 148;
+ int32 field149 = 149;
+ int32 field150 = 150;
+ int32 field151 = 151;
+ int32 field152 = 152;
+ int32 field153 = 153;
+ int32 field154 = 154;
+ int32 field155 = 155;
+ int32 field156 = 156;
+ int32 field157 = 157;
+ int32 field158 = 158;
+ int32 field159 = 159;
+ int32 field160 = 160;
+ int32 field161 = 161;
+ int32 field162 = 162;
+ int32 field163 = 163;
+ int32 field164 = 164;
+ int32 field165 = 165;
+ int32 field166 = 166;
+ int32 field167 = 167;
+ int32 field168 = 168;
+ int32 field169 = 169;
+ int32 field170 = 170;
+ int32 field171 = 171;
+ int32 field172 = 172;
+ int32 field173 = 173;
+ int32 field174 = 174;
+ int32 field175 = 175;
+ int32 field176 = 176;
+ int32 field177 = 177;
+ int32 field178 = 178;
+ int32 field179 = 179;
+ int32 field180 = 180;
+ int32 field181 = 181;
+ int32 field182 = 182;
+ int32 field183 = 183;
+ int32 field184 = 184;
+ int32 field185 = 185;
+ int32 field186 = 186;
+ int32 field187 = 187;
+ int32 field188 = 188;
+ int32 field189 = 189;
+ int32 field190 = 190;
+ int32 field191 = 191;
+ int32 field192 = 192;
+ int32 field193 = 193;
+ int32 field194 = 194;
+ int32 field195 = 195;
+ int32 field196 = 196;
+ int32 field197 = 197;
+ int32 field198 = 198;
+ int32 field199 = 199;
+ int32 field200 = 200;
+ int32 field201 = 201;
+ int32 field202 = 202;
+ int32 field203 = 203;
+ int32 field204 = 204;
+ int32 field205 = 205;
+ int32 field206 = 206;
+ int32 field207 = 207;
+ int32 field208 = 208;
+ int32 field209 = 209;
+ int32 field210 = 210;
+ int32 field211 = 211;
+ int32 field212 = 212;
+ int32 field213 = 213;
+ int32 field214 = 214;
+ int32 field215 = 215;
+ int32 field216 = 216;
+ int32 field217 = 217;
+ int32 field218 = 218;
+ int32 field219 = 219;
+ int32 field220 = 220;
+ int32 field221 = 221;
+ int32 field222 = 222;
+ int32 field223 = 223;
+ int32 field224 = 224;
+ int32 field225 = 225;
+ int32 field226 = 226;
+ int32 field227 = 227;
+ int32 field228 = 228;
+ int32 field229 = 229;
+ int32 field230 = 230;
+ int32 field231 = 231;
+ int32 field232 = 232;
+ int32 field233 = 233;
+ int32 field234 = 234;
+ int32 field235 = 235;
+ int32 field236 = 236;
+ int32 field237 = 237;
+ int32 field238 = 238;
+ int32 field239 = 239;
+ int32 field240 = 240;
+ int32 field241 = 241;
+ int32 field242 = 242;
+ int32 field243 = 243;
+ int32 field244 = 244;
+ int32 field245 = 245;
+ int32 field246 = 246;
+ int32 field247 = 247;
+ int32 field248 = 248;
+ int32 field249 = 249;
+ int32 field250 = 250;
+ int32 field251 = 251;
+ int32 field252 = 252;
+ int32 field253 = 253;
+ int32 field254 = 254;
+ int32 field255 = 255;
+ int32 field256 = 256;
+ int32 field257 = 257;
+ int32 field258 = 258;
+ int32 field259 = 259;
+ int32 field260 = 260;
+ int32 field261 = 261;
+ int32 field262 = 262;
+ int32 field263 = 263;
+ int32 field264 = 264;
+ int32 field265 = 265;
+ int32 field266 = 266;
+ int32 field267 = 267;
+ int32 field268 = 268;
+ int32 field269 = 269;
+ int32 field270 = 270;
+ int32 field271 = 271;
+ int32 field272 = 272;
+ int32 field273 = 273;
+ int32 field274 = 274;
+ int32 field275 = 275;
+ int32 field276 = 276;
+ int32 field277 = 277;
+ int32 field278 = 278;
+ int32 field279 = 279;
+ int32 field280 = 280;
+ int32 field281 = 281;
+ int32 field282 = 282;
+ int32 field283 = 283;
+ int32 field284 = 284;
+ int32 field285 = 285;
+ int32 field286 = 286;
+ int32 field287 = 287;
+ int32 field288 = 288;
+ int32 field289 = 289;
+ int32 field290 = 290;
+ int32 field291 = 291;
+ int32 field292 = 292;
+ int32 field293 = 293;
+ int32 field294 = 294;
+ int32 field295 = 295;
+ int32 field296 = 296;
+ int32 field297 = 297;
+ int32 field298 = 298;
+ int32 field299 = 299;
+ int32 field300 = 300;
+ int32 field301 = 301;
+ int32 field302 = 302;
+ int32 field303 = 303;
+ int32 field304 = 304;
+ int32 field305 = 305;
+ int32 field306 = 306;
+ int32 field307 = 307;
+ int32 field308 = 308;
+ int32 field309 = 309;
+ int32 field310 = 310;
+ int32 field311 = 311;
+ int32 field312 = 312;
+ int32 field313 = 313;
+ int32 field314 = 314;
+ int32 field315 = 315;
+ int32 field316 = 316;
+ int32 field317 = 317;
+ int32 field318 = 318;
+ int32 field319 = 319;
+ int32 field320 = 320;
+ int32 field321 = 321;
+ int32 field322 = 322;
+ int32 field323 = 323;
+ int32 field324 = 324;
+ int32 field325 = 325;
+ int32 field326 = 326;
+ int32 field327 = 327;
+ int32 field328 = 328;
+ int32 field329 = 329;
+ int32 field330 = 330;
+ int32 field331 = 331;
+ int32 field332 = 332;
+ int32 field333 = 333;
+ int32 field334 = 334;
+ int32 field335 = 335;
+ int32 field336 = 336;
+ int32 field337 = 337;
+ int32 field338 = 338;
+ int32 field339 = 339;
+ int32 field340 = 340;
+ int32 field341 = 341;
+ int32 field342 = 342;
+ int32 field343 = 343;
+ int32 field344 = 344;
+ int32 field345 = 345;
+ int32 field346 = 346;
+ int32 field347 = 347;
+ int32 field348 = 348;
+ int32 field349 = 349;
+ int32 field350 = 350;
+ int32 field351 = 351;
+ int32 field352 = 352;
+ int32 field353 = 353;
+ int32 field354 = 354;
+ int32 field355 = 355;
+ int32 field356 = 356;
+ int32 field357 = 357;
+ int32 field358 = 358;
+ int32 field359 = 359;
+ int32 field360 = 360;
+ int32 field361 = 361;
+ int32 field362 = 362;
+ int32 field363 = 363;
+ int32 field364 = 364;
+ int32 field365 = 365;
+ int32 field366 = 366;
+ int32 field367 = 367;
+ int32 field368 = 368;
+ int32 field369 = 369;
+ int32 field370 = 370;
+ int32 field371 = 371;
+ int32 field372 = 372;
+ int32 field373 = 373;
+ int32 field374 = 374;
+ int32 field375 = 375;
+ int32 field376 = 376;
+ int32 field377 = 377;
+ int32 field378 = 378;
+ int32 field379 = 379;
+ int32 field380 = 380;
+ int32 field381 = 381;
+ int32 field382 = 382;
+ int32 field383 = 383;
+ int32 field384 = 384;
+ int32 field385 = 385;
+ int32 field386 = 386;
+ int32 field387 = 387;
+ int32 field388 = 388;
+ int32 field389 = 389;
+ int32 field390 = 390;
+ int32 field391 = 391;
+ int32 field392 = 392;
+ int32 field393 = 393;
+ int32 field394 = 394;
+ int32 field395 = 395;
+ int32 field396 = 396;
+ int32 field397 = 397;
+ int32 field398 = 398;
+ int32 field399 = 399;
+ int32 field400 = 400;
+ int32 field401 = 401;
+ int32 field402 = 402;
+ int32 field403 = 403;
+ int32 field404 = 404;
+ int32 field405 = 405;
+ int32 field406 = 406;
+ int32 field407 = 407;
+ int32 field408 = 408;
+ int32 field409 = 409;
+ int32 field410 = 410;
+ int32 field411 = 411;
+ int32 field412 = 412;
+ int32 field413 = 413;
+ int32 field414 = 414;
+ int32 field415 = 415;
+ int32 field416 = 416;
+ int32 field417 = 417;
+ int32 field418 = 418;
+ int32 field419 = 419;
+ int32 field420 = 420;
+ int32 field421 = 421;
+ int32 field422 = 422;
+ int32 field423 = 423;
+ int32 field424 = 424;
+ int32 field425 = 425;
+ int32 field426 = 426;
+ int32 field427 = 427;
+ int32 field428 = 428;
+ int32 field429 = 429;
+ int32 field430 = 430;
+ int32 field431 = 431;
+ int32 field432 = 432;
+ int32 field433 = 433;
+ int32 field434 = 434;
+ int32 field435 = 435;
+ int32 field436 = 436;
+ int32 field437 = 437;
+ int32 field438 = 438;
+ int32 field439 = 439;
+ int32 field440 = 440;
+ int32 field441 = 441;
+ int32 field442 = 442;
+ int32 field443 = 443;
+ int32 field444 = 444;
+ int32 field445 = 445;
+ int32 field446 = 446;
+ int32 field447 = 447;
+ int32 field448 = 448;
+ int32 field449 = 449;
+ int32 field450 = 450;
+ int32 field451 = 451;
+ int32 field452 = 452;
+ int32 field453 = 453;
+ int32 field454 = 454;
+ int32 field455 = 455;
+ int32 field456 = 456;
+ int32 field457 = 457;
+ int32 field458 = 458;
+ int32 field459 = 459;
+ int32 field460 = 460;
+ int32 field461 = 461;
+ int32 field462 = 462;
+ int32 field463 = 463;
+ int32 field464 = 464;
+ int32 field465 = 465;
+ int32 field466 = 466;
+ int32 field467 = 467;
+ int32 field468 = 468;
+ int32 field469 = 469;
+ int32 field470 = 470;
+ int32 field471 = 471;
+ int32 field472 = 472;
+ int32 field473 = 473;
+ int32 field474 = 474;
+ int32 field475 = 475;
+ int32 field476 = 476;
+ int32 field477 = 477;
+ int32 field478 = 478;
+ int32 field479 = 479;
+ int32 field480 = 480;
+ int32 field481 = 481;
+ int32 field482 = 482;
+ int32 field483 = 483;
+ int32 field484 = 484;
+ int32 field485 = 485;
+ int32 field486 = 486;
+ int32 field487 = 487;
+ int32 field488 = 488;
+ int32 field489 = 489;
+ int32 field490 = 490;
+ int32 field491 = 491;
+ int32 field492 = 492;
+ int32 field493 = 493;
+ int32 field494 = 494;
+ int32 field495 = 495;
+ int32 field496 = 496;
+ int32 field497 = 497;
+ int32 field498 = 498;
+ int32 field499 = 499;
+ int32 field500 = 500;
+ int32 field501 = 501;
+ int32 field502 = 502;
+ int32 field503 = 503;
+ int32 field504 = 504;
+ int32 field505 = 505;
+ int32 field506 = 506;
+ int32 field507 = 507;
+ int32 field508 = 508;
+ int32 field509 = 509;
+ int32 field510 = 510;
+ int32 field511 = 511;
+ int32 field512 = 512;
+}
+
+message Message0 { LongMessage field1 = 1; }
+message Message1 { Message0 submsg = 1; }
+message Message2 { Message1 submsg = 2; }
+message Message3 { Message2 submsg = 3; }
+message Message4 { Message3 submsg = 4; }
+message Message5 { Message4 submsg = 5; }
+message Message6 { Message5 submsg = 6; }
+message Message7 { Message6 submsg = 7; }
+message Message8 { Message7 submsg = 8; }
+message Message9 { Message8 submsg = 9; }
+message Message10 { Message9 submsg = 10; }
+message Message11 { Message10 submsg = 11; }
+message Message12 { Message11 submsg = 12; }
+message Message13 { Message12 submsg = 13; }
+message Message14 { Message13 submsg = 14; }
+message Message15 { Message14 submsg = 15; }
+message Message16 { Message15 submsg = 16; }
+
+// Avoid excessive recursion
+
+message Message17 { Message16 submsg = 17; }
+message Message18 { Message16 submsg = 18; }
+message Message19 { Message16 submsg = 19; }
+message Message20 { Message16 submsg = 20; }
+message Message21 { Message16 submsg = 21; }
+message Message22 { Message16 submsg = 22; }
+message Message23 { Message16 submsg = 23; }
+message Message24 { Message16 submsg = 24; }
+message Message25 { Message16 submsg = 25; }
+message Message26 { Message16 submsg = 26; }
+message Message27 { Message16 submsg = 27; }
+message Message28 { Message16 submsg = 28; }
+message Message29 { Message16 submsg = 29; }
+message Message30 { Message16 submsg = 30; }
+message Message31 { Message16 submsg = 31; }
+message Message32 { Message16 submsg = 32; }
+message Message33 { Message16 submsg = 33; }
+message Message34 { Message16 submsg = 34; }
+message Message35 { Message16 submsg = 35; }
+message Message36 { Message16 submsg = 36; }
+message Message37 { Message16 submsg = 37; }
+message Message38 { Message16 submsg = 38; }
+message Message39 { Message16 submsg = 39; }
+message Message40 { Message16 submsg = 40; }
+message Message41 { Message16 submsg = 41; }
+message Message42 { Message16 submsg = 42; }
+message Message43 { Message16 submsg = 43; }
+message Message44 { Message16 submsg = 44; }
+message Message45 { Message16 submsg = 45; }
+message Message46 { Message16 submsg = 46; }
+message Message47 { Message16 submsg = 47; }
+message Message48 { Message16 submsg = 48; }
+message Message49 { Message16 submsg = 49; }
+message Message50 { Message16 submsg = 50; }
+message Message51 { Message16 submsg = 51; }
+message Message52 { Message16 submsg = 52; }
+message Message53 { Message16 submsg = 53; }
+message Message54 { Message16 submsg = 54; }
+message Message55 { Message16 submsg = 55; }
+message Message56 { Message16 submsg = 56; }
+message Message57 { Message16 submsg = 57; }
+message Message58 { Message16 submsg = 58; }
+message Message59 { Message16 submsg = 59; }
+message Message60 { Message16 submsg = 60; }
+message Message61 { Message16 submsg = 61; }
+message Message62 { Message16 submsg = 62; }
+message Message63 { Message16 submsg = 63; }
+message Message64 { Message16 submsg = 64; }
+message Message65 { Message16 submsg = 65; }
+message Message66 { Message16 submsg = 66; }
+message Message67 { Message16 submsg = 67; }
+message Message68 { Message16 submsg = 68; }
+message Message69 { Message16 submsg = 69; }
+message Message70 { Message16 submsg = 70; }
+message Message71 { Message16 submsg = 71; }
+message Message72 { Message16 submsg = 72; }
+message Message73 { Message16 submsg = 73; }
+message Message74 { Message16 submsg = 74; }
+message Message75 { Message16 submsg = 75; }
+message Message76 { Message16 submsg = 76; }
+message Message77 { Message16 submsg = 77; }
+message Message78 { Message16 submsg = 78; }
+message Message79 { Message16 submsg = 79; }
+message Message80 { Message16 submsg = 80; }
+message Message81 { Message16 submsg = 81; }
+message Message82 { Message16 submsg = 82; }
+message Message83 { Message16 submsg = 83; }
+message Message84 { Message16 submsg = 84; }
+message Message85 { Message16 submsg = 85; }
+message Message86 { Message16 submsg = 86; }
+message Message87 { Message16 submsg = 87; }
+message Message88 { Message16 submsg = 88; }
+message Message89 { Message16 submsg = 89; }
+message Message90 { Message16 submsg = 90; }
+message Message91 { Message16 submsg = 91; }
+message Message92 { Message16 submsg = 92; }
+message Message93 { Message16 submsg = 93; }
+message Message94 { Message16 submsg = 94; }
+message Message95 { Message16 submsg = 95; }
+message Message96 { Message16 submsg = 96; }
+message Message97 { Message16 submsg = 97; }
+message Message98 { Message16 submsg = 98; }
+message Message99 { Message16 submsg = 99; }