@@ -565,69 +565,15 @@ func getTestCases() []testCase {
565
565
},
566
566
},
567
567
{
568
- descr : "1st ml//maxlen gt 8192" , // maxlength greather than the buffer size
569
- input : fmt .Sprintf (
570
- "8193 <%d>%d %s %s %s %s %s - %s" ,
571
- syslogtesting .MaxPriority ,
572
- syslogtesting .MaxVersion ,
573
- syslogtesting .MaxRFC3339MicroTimestamp ,
574
- string (syslogtesting .MaxHostname ),
575
- string (syslogtesting .MaxAppname ),
576
- string (syslogtesting .MaxProcID ),
577
- string (syslogtesting .MaxMsgID ),
578
- string (syslogtesting .MaxMessage ),
579
- ),
580
- // results w/o best effort
568
+ descr : "MSGLEN gt max message length" ,
569
+ input : "16 <1>1 - - - - - -" ,
581
570
results : []syslog.Result {
582
- {
583
- Error : fmt .Errorf (
584
- "found %s after \" %s\" , expecting a %s containing %d octets" ,
585
- EOF ,
586
- fmt .Sprintf (
587
- "<%d>%d %s %s %s %s %s - %s" , syslogtesting .MaxPriority ,
588
- syslogtesting .MaxVersion ,
589
- syslogtesting .MaxRFC3339MicroTimestamp ,
590
- string (syslogtesting .MaxHostname ),
591
- string (syslogtesting .MaxAppname ),
592
- string (syslogtesting .MaxProcID ),
593
- string (syslogtesting .MaxMsgID ),
594
- string (syslogtesting .MaxMessage ),
595
- ),
596
- SYSLOGMSG ,
597
- 8193 ,
598
- ),
599
- },
571
+ {Error : fmt .Errorf ("message too long to parse. was size %d, max length %d" , 16 , 10 )},
600
572
},
601
- // results with best effort
602
573
bestEffortResults : []syslog.Result {
603
- {
604
- Message : (& rfc5424.SyslogMessage {}).
605
- SetPriority (syslogtesting .MaxPriority ).
606
- SetVersion (syslogtesting .MaxVersion ).
607
- SetTimestamp (syslogtesting .MaxRFC3339MicroTimestamp ).
608
- SetHostname (string (syslogtesting .MaxHostname )).
609
- SetAppname (string (syslogtesting .MaxAppname )).
610
- SetProcID (string (syslogtesting .MaxProcID )).
611
- SetMsgID (string (syslogtesting .MaxMsgID )).
612
- SetMessage (string (syslogtesting .MaxMessage )),
613
- Error : fmt .Errorf (
614
- "found %s after \" %s\" , expecting a %s containing %d octets" ,
615
- EOF ,
616
- fmt .Sprintf (
617
- "<%d>%d %s %s %s %s %s - %s" , syslogtesting .MaxPriority ,
618
- syslogtesting .MaxVersion ,
619
- syslogtesting .MaxRFC3339MicroTimestamp ,
620
- string (syslogtesting .MaxHostname ),
621
- string (syslogtesting .MaxAppname ),
622
- string (syslogtesting .MaxProcID ),
623
- string (syslogtesting .MaxMsgID ),
624
- string (syslogtesting .MaxMessage ),
625
- ),
626
- SYSLOGMSG ,
627
- 8193 ,
628
- ),
629
- },
574
+ {Error : fmt .Errorf ("message too long to parse. was size %d, max length %d" , 16 , 10 )},
630
575
},
576
+ maxMessageLength : 10 ,
631
577
},
632
578
{
633
579
descr : "1st uf/2nd ok//incomplete SYSLOGMSG/notdetectable" ,
0 commit comments