File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -466,7 +466,8 @@ const std::string &Target::bubbleText() const
466466 */
467467void Target::setBubbleText (const std::string &text)
468468{
469- impl->bubbleText = text;
469+ size_t limit = 330 ;
470+ impl->bubbleText = text.substr (0 , limit);
470471}
471472
472473/* ! Returns the engine. */
Original file line number Diff line number Diff line change @@ -603,6 +603,25 @@ TEST(TargetTest, BubbleText)
603603
604604 target.setBubbleText (" world" );
605605 ASSERT_EQ (target.bubbleText (), " world" );
606+
607+ // longstr.length = 384, should be limited to 330 in bubble text
608+ std::string longstr =
609+ " EY8OUNzAqwgh7NRGk5TzCP3dkAhJy9TX"
610+ " Y9mqKElPjdQpKddYqjyCwUk2hx6YgVZV"
611+ " 6BOdmZGxDMs8Hjv8W9G6j4gTxAWdOkzs"
612+ " 8Ih80xzEDbvLilWsDwoB6FxH2kVVI4xs"
613+ " IXOETNQ6QMsCKLWc5XjHk2BS9nYvDGpJ"
614+ " uEmp9zIzFGT1kRSrOlU3ZwnN1YtvqFx"
615+ " 3hkWVNtJ71dQ0PJHhOVQPUy19V01SPu3"
616+ " KIIS2wdSUVAc4RYMzepSveghzWbdcizy"
617+ " Tm1KKAj4svu9YoL8b9vsolG8gKunvKO7"
618+ " MurRKSeUbECELnJEKV6683xCq7RvmjAu"
619+ " 2djZ54apiQc1lTixWns5GoG0SVNuFzHl"
620+ " q97qUiqiMecjVFM51YVif7c1Stip52Hl" ;
621+
622+ target.setBubbleText (longstr);
623+ ASSERT_EQ (target.bubbleText ().length (), 330 );
624+ ASSERT_EQ (target.bubbleText (), longstr.substr (0 , 330 ));
606625}
607626
608627TEST (TargetTest, Engine)
You can’t perform that action at this time.
0 commit comments