@@ -612,63 +612,63 @@ TEST(Utility, Base64DecodeErrors)
612612 {
613613 SCOPED_TRACE (" invalid char in std" );
614614 const char * invalid_std = " SGVs#G8=" ; // '#' is invalid
615- auto written = decode_base64 (output, sizeof (output), invalid_std, 8 , false , true );
615+ auto written = decode_base64 (output, sizeof (output), invalid_std, 8 , false , true );
616616 EXPECT_EQ (written, 0u );
617617 }
618618
619619 // URL-safe chars in standard mode should fail
620620 {
621621 SCOPED_TRACE (" url char in std mode" );
622622 const char * url_in_std = " 3q2-7w==" ; // '-' is URL-safe, not standard
623- auto written = decode_base64 (output, sizeof (output), url_in_std, 8 , false , true );
623+ auto written = decode_base64 (output, sizeof (output), url_in_std, 8 , false , true );
624624 EXPECT_EQ (written, 0u );
625625 }
626626
627627 // Standard chars in URL mode should fail
628628 {
629629 SCOPED_TRACE (" std char in url mode" );
630630 const char * std_in_url = " 3q2+7w==" ; // '+' is standard, not URL-safe
631- auto written = decode_base64 (output, sizeof (output), std_in_url, 8 , true , true );
631+ auto written = decode_base64 (output, sizeof (output), std_in_url, 8 , true , true );
632632 EXPECT_EQ (written, 0u );
633633 }
634634
635635 // Padding when padding=false should fail
636636 {
637637 SCOPED_TRACE (" padding when disabled" );
638638 const char * with_padding = " AA==" ;
639- auto written = decode_base64 (output, sizeof (output), with_padding, 4 , false , false );
639+ auto written = decode_base64 (output, sizeof (output), with_padding, 4 , false , false );
640640 EXPECT_EQ (written, 0u );
641641 }
642642
643643 // Incomplete group with padding=true should fail (expects '=' in input)
644644 {
645645 SCOPED_TRACE (" incomplete group with padding=true" );
646646 const char * incomplete = " AAA" ; // 3 chars, needs '=' padding char when padding=true
647- auto written = decode_base64 (output, sizeof (output), incomplete, 3 , false , true );
647+ auto written = decode_base64 (output, sizeof (output), incomplete, 3 , false , true );
648648 EXPECT_EQ (written, 0u );
649649 }
650650
651651 // Incomplete group with padding=false should succeed (auto-pad)
652652 {
653653 SCOPED_TRACE (" incomplete group with padding=false" );
654654 const char * incomplete = " AAA" ; // 3 chars, will be auto-padded
655- auto written = decode_base64 (output, sizeof (output), incomplete, 3 , false , false );
655+ auto written = decode_base64 (output, sizeof (output), incomplete, 3 , false , false );
656656 EXPECT_EQ (written, 2u );
657657 }
658658
659659 // NULL output buffer
660660 {
661661 SCOPED_TRACE (" null output" );
662662 const char * valid = " SGVsbG8=" ;
663- auto written = decode_base64 (nullptr , 128 , valid, 8 , false , true );
663+ auto written = decode_base64 (nullptr , 128 , valid, 8 , false , true );
664664 EXPECT_EQ (written, 0u );
665665 }
666666
667667 // Zero output length
668668 {
669669 SCOPED_TRACE (" zero output length" );
670670 const char * valid = " SGVsbG8=" ;
671- auto written = decode_base64 (output, 0 , valid, 8 , false , true );
671+ auto written = decode_base64 (output, 0 , valid, 8 , false , true );
672672 EXPECT_EQ (written, 0u );
673673 }
674674
@@ -683,15 +683,15 @@ TEST(Utility, Base64DecodeErrors)
683683 {
684684 SCOPED_TRACE (" zero input length" );
685685 const char * valid = " SGVsbG8=" ;
686- auto written = decode_base64 (output, sizeof (output), valid, 0 , false , true );
686+ auto written = decode_base64 (output, sizeof (output), valid, 0 , false , true );
687687 EXPECT_EQ (written, 0u );
688688 }
689689
690690 // Output buffer too small
691691 {
692692 SCOPED_TRACE (" output buffer too small" );
693693 const char * valid = " SGVsbG8=" ; // decodes to "Hello" (5 bytes)
694- auto written = decode_base64 (output, 3 , valid, 8 , false , true );
694+ auto written = decode_base64 (output, 3 , valid, 8 , false , true );
695695 EXPECT_EQ (written, 0u );
696696 }
697697}
@@ -701,7 +701,8 @@ TEST(Utility, Base64Roundtrip)
701701 SCOPED_TRACE (" Base64Roundtrip" );
702702
703703 // Test roundtrip: encode then decode should return original
704- const uint8_t original[] = {0x00 , 0x11 , 0x22 , 0x33 , 0x44 , 0x55 , 0x66 , 0x77 , 0x88 , 0x99 , 0xAA , 0xBB , 0xCC , 0xDD , 0xEE , 0xFF };
704+ const uint8_t original[] = {0x00 , 0x11 , 0x22 , 0x33 , 0x44 , 0x55 , 0x66 , 0x77 ,
705+ 0x88 , 0x99 , 0xAA , 0xBB , 0xCC , 0xDD , 0xEE , 0xFF };
705706 char encoded[64 ]{};
706707 uint8_t decoded[64 ]{};
707708
@@ -786,9 +787,8 @@ TEST(Utility, Base64LineBreakPositions)
786787 for (uint32_t i = 0 ; i < len; ++i) {
787788 if (encoded[i] == ' \n ' ) {
788789 // Line break should occur exactly at line_len
789- EXPECT_EQ (char_count, line_len)
790- << " Line break at wrong position. Expected after " << (int )line_len
791- << " chars, got after " << char_count << " at index " << i;
790+ EXPECT_EQ (char_count, line_len) << " Line break at wrong position. Expected after " << (int )line_len
791+ << " chars, got after " << char_count << " at index " << i;
792792 char_count = 0 ;
793793 ++line_count;
794794 } else {
@@ -812,7 +812,7 @@ TEST(Utility, Base64LineBreakPositions)
812812 SCOPED_TRACE (" line_len=4" );
813813 // 12 bytes input -> 16 base64 chars -> 4 lines of 4 chars with 3 newlines
814814 const uint8_t input[] = {0x00 , 0x01 , 0x02 , 0x03 , 0x04 , 0x05 , 0x06 , 0x07 , 0x08 , 0x09 , 0x0A , 0x0B };
815- auto written = encode_base64 (output, sizeof (output), input, sizeof (input), 4 , false , true );
815+ auto written = encode_base64 (output, sizeof (output), input, sizeof (input), 4 , false , true );
816816 EXPECT_GT (written, 0u );
817817
818818 // Expected: "AAEC\nAwQF\nBgcI\nCQoL" (16 chars + 3 newlines = 19)
@@ -831,7 +831,7 @@ TEST(Utility, Base64LineBreakPositions)
831831 SCOPED_TRACE (" line_len=8" );
832832 // 12 bytes input -> 16 base64 chars -> 2 lines of 8 chars with 1 newline
833833 const uint8_t input[] = {0x00 , 0x01 , 0x02 , 0x03 , 0x04 , 0x05 , 0x06 , 0x07 , 0x08 , 0x09 , 0x0A , 0x0B };
834- auto written = encode_base64 (output, sizeof (output), input, sizeof (input), 8 , false , true );
834+ auto written = encode_base64 (output, sizeof (output), input, sizeof (input), 8 , false , true );
835835 EXPECT_GT (written, 0u );
836836
837837 verify_linebreaks (output, written, 8 );
@@ -848,7 +848,7 @@ TEST(Utility, Base64LineBreakPositions)
848848 SCOPED_TRACE (" line_len=64 (PEM)" );
849849 // 48 bytes input -> 64 base64 chars -> exactly 1 line, no newlines
850850 const uint8_t input[48 ] = {0 };
851- auto written = encode_base64 (output, sizeof (output), input, sizeof (input), 64 , false , true );
851+ auto written = encode_base64 (output, sizeof (output), input, sizeof (input), 64 , false , true );
852852 EXPECT_GT (written, 0u );
853853 EXPECT_EQ (written, 64u ); // exactly 64 chars, no newline
854854
@@ -864,7 +864,7 @@ TEST(Utility, Base64LineBreakPositions)
864864 SCOPED_TRACE (" line_len=64, overflow" );
865865 // 49 bytes input -> 68 base64 chars (with padding) -> 1 line of 64 + 1 line of 4
866866 const uint8_t input[49 ] = {0 };
867- auto written = encode_base64 (output, sizeof (output), input, sizeof (input), 64 , false , true );
867+ auto written = encode_base64 (output, sizeof (output), input, sizeof (input), 64 , false , true );
868868 EXPECT_GT (written, 0u );
869869
870870 verify_linebreaks (output, written, 64 );
@@ -881,7 +881,7 @@ TEST(Utility, Base64LineBreakPositions)
881881 SCOPED_TRACE (" short input" );
882882 // 3 bytes input -> 4 base64 chars -> no newlines needed
883883 const uint8_t input[] = {0x01 , 0x02 , 0x03 };
884- auto written = encode_base64 (output, sizeof (output), input, sizeof (input), 64 , false , true );
884+ auto written = encode_base64 (output, sizeof (output), input, sizeof (input), 64 , false , true );
885885 EXPECT_EQ (written, 4u );
886886
887887 uint32_t newline_count = 0 ;
@@ -896,7 +896,7 @@ TEST(Utility, Base64LineBreakPositions)
896896 SCOPED_TRACE (" padding with linebreak" );
897897 // 5 bytes -> 8 chars (with ==) -> with line_len=4: "AQID\nBAU=" (4+1+4=9)
898898 const uint8_t input[] = {0x01 , 0x02 , 0x03 , 0x04 , 0x05 };
899- auto written = encode_base64 (output, sizeof (output), input, sizeof (input), 4 , false , true );
899+ auto written = encode_base64 (output, sizeof (output), input, sizeof (input), 4 , false , true );
900900 EXPECT_GT (written, 0u );
901901
902902 verify_linebreaks (output, written, 4 );
@@ -916,15 +916,15 @@ TEST(Utility, Base64EncodeErrors)
916916 {
917917 SCOPED_TRACE (" null output" );
918918 const uint8_t input[] = {0x01 , 0x02 , 0x03 };
919- auto written = encode_base64 (nullptr , 128 , input, sizeof (input), 0 , false , true );
919+ auto written = encode_base64 (nullptr , 128 , input, sizeof (input), 0 , false , true );
920920 EXPECT_EQ (written, 0u );
921921 }
922922
923923 // Zero output length
924924 {
925925 SCOPED_TRACE (" zero output length" );
926926 const uint8_t input[] = {0x01 , 0x02 , 0x03 };
927- auto written = encode_base64 (output, 0 , input, sizeof (input), 0 , false , true );
927+ auto written = encode_base64 (output, 0 , input, sizeof (input), 0 , false , true );
928928 EXPECT_EQ (written, 0u );
929929 }
930930
@@ -939,7 +939,7 @@ TEST(Utility, Base64EncodeErrors)
939939 {
940940 SCOPED_TRACE (" zero input length" );
941941 const uint8_t input[] = {0x01 , 0x02 , 0x03 };
942- auto written = encode_base64 (output, sizeof (output), input, 0 , 0 , false , true );
942+ auto written = encode_base64 (output, sizeof (output), input, 0 , 0 , false , true );
943943 EXPECT_EQ (written, 0u );
944944 }
945945
@@ -1009,15 +1009,15 @@ TEST(Utility, Base64EncodeErrors)
10091009 {
10101010 SCOPED_TRACE (" buffer too small for padding" );
10111011 const uint8_t input[] = {0x01 , 0x02 }; // 2 bytes -> "AQI=" (4 chars with padding)
1012- auto written = encode_base64 (output, 4 , input, sizeof (input), 0 , false , true );
1012+ auto written = encode_base64 (output, 4 , input, sizeof (input), 0 , false , true );
10131013 EXPECT_EQ (written, 0u ); // needs 5 for null
10141014 }
10151015
10161016 // Without padding, shorter output
10171017 {
10181018 SCOPED_TRACE (" without padding shorter" );
10191019 const uint8_t input[] = {0x01 , 0x02 }; // 2 bytes -> "AQI" (3 chars without padding)
1020- auto written = encode_base64 (output, 4 , input, sizeof (input), 0 , false , false );
1020+ auto written = encode_base64 (output, 4 , input, sizeof (input), 0 , false , false );
10211021 EXPECT_EQ (written, 3u );
10221022 EXPECT_STREQ (output, " AQI" );
10231023 }
@@ -1026,7 +1026,7 @@ TEST(Utility, Base64EncodeErrors)
10261026 {
10271027 SCOPED_TRACE (" large input buffer boundary" );
10281028 const uint8_t input[48 ] = {0 }; // 48 bytes -> 64 chars + null = 65 bytes needed
1029- auto written = encode_base64 (output, 64 , input, sizeof (input), 0 , false , true );
1029+ auto written = encode_base64 (output, 64 , input, sizeof (input), 0 , false , true );
10301030 EXPECT_EQ (written, 0u ); // needs 65
10311031
10321032 written = encode_base64 (output, 65 , input, sizeof (input), 0 , false , true );
0 commit comments