From 9611c7a892a9a94b5cb2f450cfa8fbce43f74e1a Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 28 Aug 2024 17:26:44 +0900 Subject: [PATCH 1/3] Bump clang-format to 18 --- .clang-format | 118 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 86 insertions(+), 32 deletions(-) diff --git a/.clang-format b/.clang-format index b4380bc..4c9b48e 100644 --- a/.clang-format +++ b/.clang-format @@ -3,21 +3,54 @@ Language: Cpp AccessModifierOffset: -2 AlignAfterOpenBracket: Align AlignArrayOfStructures: None -AlignConsecutiveMacros: None -AlignConsecutiveAssignments: None -AlignConsecutiveBitFields: None -AlignConsecutiveDeclarations: None +AlignConsecutiveAssignments: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: true +AlignConsecutiveBitFields: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: true +AlignConsecutiveDeclarations: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: true +AlignConsecutiveMacros: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: true +AlignConsecutiveShortCaseStatements: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCaseColons: false AlignEscapedNewlines: Right AlignOperands: Align -AlignTrailingComments: true +AlignTrailingComments: + Kind: Always + OverEmptyLines: 0 AllowAllArgumentsOnNextLine: true AllowAllParametersOfDeclarationOnNextLine: true -AllowShortEnumsOnASingleLine: true +AllowBreakBeforeNoexceptSpecifier: Never AllowShortBlocksOnASingleLine: Never AllowShortCaseLabelsOnASingleLine: false +AllowShortCompoundRequirementOnASingleLine: true +AllowShortEnumsOnASingleLine: true AllowShortFunctionsOnASingleLine: All -AllowShortLambdasOnASingleLine: All AllowShortIfStatementsOnASingleLine: Never +AllowShortLambdasOnASingleLine: All AllowShortLoopsOnASingleLine: false AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterReturnType: None @@ -27,17 +60,18 @@ AttributeMacros: - __capability BinPackArguments: true BinPackParameters: true +BitFieldColonSpacing: Both BraceWrapping: AfterCaseLabel: false AfterClass: false AfterControlStatement: Never AfterEnum: false + AfterExternBlock: false AfterFunction: false AfterNamespace: false AfterObjCDeclaration: false AfterStruct: false AfterUnion: false - AfterExternBlock: false BeforeCatch: false BeforeElse: false BeforeLambdaBody: false @@ -46,33 +80,29 @@ BraceWrapping: SplitEmptyFunction: true SplitEmptyRecord: true SplitEmptyNamespace: true +BreakAdjacentStringLiterals: true +BreakAfterAttributes: Leave +BreakAfterJavaFieldAnnotations: false +BreakArrays: true BreakBeforeBinaryOperators: None -BreakBeforeConceptDeclarations: true +BreakBeforeConceptDeclarations: Always BreakBeforeBraces: Attach -BreakBeforeInheritanceComma: false -BreakInheritanceList: BeforeColon +BreakBeforeInlineASMColon: OnlyMultiline BreakBeforeTernaryOperators: true -BreakConstructorInitializersBeforeComma: false BreakConstructorInitializers: BeforeColon -BreakAfterJavaFieldAnnotations: false +BreakInheritanceList: BeforeColon BreakStringLiterals: true ColumnLimit: 80 CommentPragmas: '^ IWYU pragma:' -QualifierAlignment: Leave CompactNamespaces: false ConstructorInitializerIndentWidth: 4 ContinuationIndentWidth: 4 Cpp11BracedListStyle: true -DeriveLineEnding: true DerivePointerAlignment: false DisableFormat: false EmptyLineAfterAccessModifier: Never EmptyLineBeforeAccessModifier: LogicalBlock ExperimentalAutoDetectBinPacking: false -PackConstructorInitializers: NextLine -BasedOnStyle: '' -ConstructorInitializerAllOnOneLineOrOnePerLine: false -AllowAllConstructorInitializersOnNextLine: true FixNamespaceComments: true ForEachMacros: - foreach @@ -97,19 +127,30 @@ IncludeCategories: IncludeIsMainRegex: '$' IncludeIsMainSourceRegex: '' IndentAccessModifiers: false -IndentCaseLabels: false IndentCaseBlocks: false +IndentCaseLabels: false +IndentExternBlock: AfterExternBlock IndentGotoLabels: true IndentPPDirectives: AfterHash -IndentExternBlock: AfterExternBlock -IndentRequires: false +IndentRequiresClause: false IndentWidth: 2 IndentWrappedFunctionNames: false +InsertBraces: false +InsertNewlineAtEOF: false InsertTrailingCommas: None +IntegerLiteralSeparator: + Binary: 0 + BinaryMinDigits: 0 + Decimal: 0 + DecimalMinDigits: 0 + Hex: 0 + HexMinDigits: 0 JavaScriptQuotes: Leave JavaScriptWrapImports: true KeepEmptyLinesAtTheStartOfBlocks: true +KeepEmptyLinesAtEOF: false LambdaBodyIndentation: Signature +LineEnding: DeriveLF MacroBlockBegin: '' MacroBlockEnd: '' MaxEmptyLinesToKeep: 1 @@ -119,34 +160,44 @@ ObjCBlockIndentWidth: 2 ObjCBreakBeforeNestedBlockParam: true ObjCSpaceAfterProperty: false ObjCSpaceBeforeProtocolList: true +PackConstructorInitializers: NextLine PenaltyBreakAssignment: 2 PenaltyBreakBeforeFirstCallParameter: 19 PenaltyBreakComment: 300 PenaltyBreakFirstLessLess: 120 PenaltyBreakOpenParenthesis: 0 +PenaltyBreakScopeResolution: 500 PenaltyBreakString: 1000 PenaltyBreakTemplateDeclaration: 10 PenaltyExcessCharacter: 1000000 -PenaltyReturnTypeOnItsOwnLine: 60 PenaltyIndentedWhitespace: 0 +PenaltyReturnTypeOnItsOwnLine: 60 PointerAlignment: Right PPIndentWidth: -1 +QualifierAlignment: Leave ReferenceAlignment: Pointer ReflowComments: true RemoveBracesLLVM: false +RemoveParentheses: Leave +RemoveSemicolon: false +RequiresClausePosition: OwnLine +RequiresExpressionIndentation: OuterScope SeparateDefinitionBlocks: Leave ShortNamespaceLines: 1 +SkipMacroDefinitionBody: false SortIncludes: Never SortJavaStaticImport: Before -SortUsingDeclarations: true +SortUsingDeclarations: LexicographicNumeric SpaceAfterCStyleCast: false SpaceAfterLogicalNot: false SpaceAfterTemplateKeyword: true +SpaceAroundPointerQualifiers: Default SpaceBeforeAssignmentOperators: true SpaceBeforeCaseColon: false SpaceBeforeCpp11BracedList: false SpaceBeforeCtorInitializerColon: true SpaceBeforeInheritanceColon: true +SpaceBeforeJsonColon: false SpaceBeforeParens: ControlStatements SpaceBeforeParensOptions: AfterControlStatements: true @@ -155,23 +206,26 @@ SpaceBeforeParensOptions: AfterFunctionDeclarationName: false AfterIfMacros: true AfterOverloadedOperator: false + AfterPlacementOperator: true + AfterRequiresInClause: false + AfterRequiresInExpression: false BeforeNonEmptyParentheses: false -SpaceAroundPointerQualifiers: Default SpaceBeforeRangeBasedForLoopColon: true +SpaceBeforeSquareBrackets: false SpaceInEmptyBlock: false -SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 1 SpacesInAngles: Never -SpacesInConditionalStatement: false SpacesInContainerLiterals: true -SpacesInCStyleCastParentheses: false SpacesInLineCommentPrefix: Minimum: 1 Maximum: -1 -SpacesInParentheses: false +SpacesInParens: Never +SpacesInParensOptions: + InCStyleCasts: false + InConditionalStatements: false + InEmptyParentheses: false + Other: false SpacesInSquareBrackets: false -SpaceBeforeSquareBrackets: false -BitFieldColonSpacing: Both Standard: Latest StatementAttributeLikeMacros: - Q_EMIT @@ -179,8 +233,8 @@ StatementMacros: - Q_UNUSED - QT_REQUIRE_VERSION TabWidth: 8 -UseCRLF: false UseTab: Never +VerilogBreakBetweenInstancePorts: true WhitespaceSensitiveMacros: - STRINGIZE - PP_STRINGIZE From 5c02a995d92f1f3293b5ed9ccf0c6c4fb5f2ccf3 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 28 Aug 2024 17:27:32 +0900 Subject: [PATCH 2/3] Change clang-format options --- .clang-format | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.clang-format b/.clang-format index 4c9b48e..0604933 100644 --- a/.clang-format +++ b/.clang-format @@ -95,8 +95,8 @@ BreakStringLiterals: true ColumnLimit: 80 CommentPragmas: '^ IWYU pragma:' CompactNamespaces: false -ConstructorInitializerIndentWidth: 4 -ContinuationIndentWidth: 4 +ConstructorInitializerIndentWidth: 2 +ContinuationIndentWidth: 2 Cpp11BracedListStyle: true DerivePointerAlignment: false DisableFormat: false @@ -147,7 +147,7 @@ IntegerLiteralSeparator: HexMinDigits: 0 JavaScriptQuotes: Leave JavaScriptWrapImports: true -KeepEmptyLinesAtTheStartOfBlocks: true +KeepEmptyLinesAtTheStartOfBlocks: false KeepEmptyLinesAtEOF: false LambdaBodyIndentation: Signature LineEnding: DeriveLF From 33294193e1c6537bb8c27091a8bb3355e0d4d016 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 28 Aug 2024 17:27:59 +0900 Subject: [PATCH 3/3] clang-format --- examples.c | 2 +- sfparse.c | 29 ++-- sfparse_test.c | 398 ++++++++++++++++++++++---------------------- sfparse_test_main.c | 6 +- 4 files changed, 216 insertions(+), 219 deletions(-) diff --git a/examples.c b/examples.c index ed8ac7e..1d8225c 100644 --- a/examples.c +++ b/examples.c @@ -464,7 +464,7 @@ static void example_item(void) { { static const uint8_t s[] = - "%\"This is intended for display to %C3%BCsers.\""; + "%\"This is intended for display to %C3%BCsers.\""; printf("## Read dispstring\n"); diff --git a/sfparse.c b/sfparse.c index d0328cf..12a3d3e 100644 --- a/sfparse.c +++ b/sfparse.c @@ -1383,21 +1383,20 @@ void sf_unescape(sf_vec *dest, const sf_vec *src) { void sf_base64decode(sf_vec *dest, const sf_vec *src) { static const int index_tbl[] = { - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1}; + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, + -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1}; uint8_t *o; const uint8_t *p, *end; uint32_t n; diff --git a/sfparse_test.c b/sfparse_test.c index e40da25..6e6b3fb 100644 --- a/sfparse_test.c +++ b/sfparse_test.c @@ -32,33 +32,33 @@ #include "sfparse.h" static const MunitTest tests[] = { - munit_void_test(test_sf_parser_item_skip), - munit_void_test(test_sf_parser_dict_skip), - munit_void_test(test_sf_parser_list_skip), - munit_void_test(test_sf_parser_byteseq), - munit_void_test(test_sf_parser_boolean), - munit_void_test(test_sf_parser_number), - munit_void_test(test_sf_parser_date), - munit_void_test(test_sf_parser_string), - munit_void_test(test_sf_parser_token), - munit_void_test(test_sf_parser_dispstring), - munit_void_test(test_sf_parser_dictionary), - munit_void_test(test_sf_parser_list), - munit_void_test(test_sf_parser_list_list), - munit_void_test(test_sf_parser_param_dict), - munit_void_test(test_sf_parser_param_list), - munit_void_test(test_sf_parser_param_list_list), - munit_void_test(test_sf_parser_number_generated), - munit_void_test(test_sf_parser_string_generated), - munit_void_test(test_sf_parser_token_generated), - munit_void_test(test_sf_parser_key_generated), - munit_void_test(test_sf_parser_large_generated), - munit_void_test(test_sf_parser_examples), - munit_test_end(), + munit_void_test(test_sf_parser_item_skip), + munit_void_test(test_sf_parser_dict_skip), + munit_void_test(test_sf_parser_list_skip), + munit_void_test(test_sf_parser_byteseq), + munit_void_test(test_sf_parser_boolean), + munit_void_test(test_sf_parser_number), + munit_void_test(test_sf_parser_date), + munit_void_test(test_sf_parser_string), + munit_void_test(test_sf_parser_token), + munit_void_test(test_sf_parser_dispstring), + munit_void_test(test_sf_parser_dictionary), + munit_void_test(test_sf_parser_list), + munit_void_test(test_sf_parser_list_list), + munit_void_test(test_sf_parser_param_dict), + munit_void_test(test_sf_parser_param_list), + munit_void_test(test_sf_parser_param_list_list), + munit_void_test(test_sf_parser_number_generated), + munit_void_test(test_sf_parser_string_generated), + munit_void_test(test_sf_parser_token_generated), + munit_void_test(test_sf_parser_key_generated), + munit_void_test(test_sf_parser_large_generated), + munit_void_test(test_sf_parser_examples), + munit_test_end(), }; const MunitSuite sfparse_suite = { - "/sfparse", tests, NULL, 1, MUNIT_SUITE_OPTION_NONE, + "/sfparse", tests, NULL, 1, MUNIT_SUITE_OPTION_NONE, }; #define sf_parser_bytes_init(SFP, S) \ @@ -1374,20 +1374,20 @@ void test_sf_parser_string(void) { { /* long string */ sf_parser_bytes_init( - &sfp, - "\"foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo " - "foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo " - "foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo " - "foo foo foo foo foo foo foo foo foo foo foo foo foo foo \""); + &sfp, + "\"foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo " + "foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo " + "foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo " + "foo foo foo foo foo foo foo foo foo foo foo foo foo foo \""); assert_int(0, ==, sf_parser_item(&sfp, &val)); assert_enum(sf_type, SF_TYPE_STRING, ==, val.type); assert_str_sf_vec_eq( - "foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo " - "foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo " - "foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo " - "foo foo foo foo foo foo foo foo foo foo foo foo foo foo ", - &val.vec); + "foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo " + "foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo " + "foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo " + "foo foo foo foo foo foo foo foo foo foo foo foo foo foo ", + &val.vec); assert_int(SF_ERR_EOF, ==, sf_parser_item(&sfp, NULL)); sf_parser_bytes_free(); @@ -1631,10 +1631,10 @@ void test_sf_parser_dispstring(void) { sf_pctdecode(&decoded, &val.vec); assert_true( - str_sf_vec_eq(" !\"#$%&'()*+,-./" - "0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`" - "abcdefghijklmnopqrstuvwxyz{|}~", - &decoded)); + str_sf_vec_eq(" !\"#$%&'()*+,-./" + "0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`" + "abcdefghijklmnopqrstuvwxyz{|}~", + &decoded)); assert_int(SF_ERR_EOF, ==, sf_parser_item(&sfp, NULL)); @@ -1817,14 +1817,14 @@ void test_sf_parser_dispstring(void) { { /* base UTF-8 string */ sf_parser_bytes_init( - &sfp, - "%\"%e3%81%93%e3%82%93%e3%81%ab%e3%81%a1%e3%81%af%e4%b8%96%e7%95%8c\""); + &sfp, + "%\"%e3%81%93%e3%82%93%e3%81%ab%e3%81%a1%e3%81%af%e4%b8%96%e7%95%8c\""); assert_int(0, ==, sf_parser_item(&sfp, &val)); assert_enum(sf_type, SF_TYPE_DISPSTRING, ==, val.type); assert_str_sf_vec_eq( - "%e3%81%93%e3%82%93%e3%81%ab%e3%81%a1%e3%81%af%e4%b8%96%e7%95%8c", - &val.vec); + "%e3%81%93%e3%82%93%e3%81%ab%e3%81%a1%e3%81%af%e4%b8%96%e7%95%8c", + &val.vec); decoded.base = buf; sf_pctdecode(&decoded, &val.vec); @@ -1887,8 +1887,8 @@ void test_sf_parser_dispstring(void) { { /* base UTF-8 string without closing DQUOTE */ sf_parser_bytes_init( - &sfp, - "%\"%e3%81%93%e3%82%93%e3%81%ab%e3%81%a1%e3%81%af%e4%b8%96%e7%95%8c"); + &sfp, + "%\"%e3%81%93%e3%82%93%e3%81%ab%e3%81%a1%e3%81%af%e4%b8%96%e7%95%8c"); assert_int(SF_ERR_PARSE_ERROR, ==, sf_parser_item(&sfp, &val)); @@ -1968,7 +1968,7 @@ void test_sf_parser_dispstring(void) { assert_int(0, ==, sf_parser_item(&sfp, &val)); assert_enum(sf_type, SF_TYPE_DISPSTRING, ==, val.type); assert_true( - str_sf_vec_eq("This is intended for display to %c3%bcsers.", &val.vec)); + str_sf_vec_eq("This is intended for display to %c3%bcsers.", &val.vec)); decoded.base = buf; sf_pctdecode(&decoded, &val.vec); @@ -4167,8 +4167,8 @@ void test_sf_parser_large_generated(void) { p = buf; for (i = 0; i < 1024; ++i) { - len = snprintf((char *)p, (size_t)(buf + sizeof(buf) - p), "a%d=1, ", - (int)i); + len = + snprintf((char *)p, (size_t)(buf + sizeof(buf) - p), "a%d=1, ", (int)i); p += len; } @@ -4195,13 +4195,12 @@ void test_sf_parser_large_generated(void) { { /* large dictionary key */ sf_parser_bytes_init( - &sfp, - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa=1"); + &sfp, + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa=1"); assert_int(0, ==, sf_parser_dict(&sfp, &key, &val)); assert_str_sf_vec_eq( - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - &key); + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", &key); assert_enum(sf_type, SF_TYPE_INTEGER, ==, val.type); assert_int64(1, ==, val.integer); assert_int(SF_ERR_EOF, ==, sf_parser_dict(&sfp, NULL, NULL)); @@ -4215,7 +4214,7 @@ void test_sf_parser_large_generated(void) { for (i = 0; i < 1024; ++i) { len = - snprintf((char *)p, (size_t)(buf + sizeof(buf) - p), "a%d, ", (int)i); + snprintf((char *)p, (size_t)(buf + sizeof(buf) - p), "a%d, ", (int)i); p += len; } @@ -4281,8 +4280,8 @@ void test_sf_parser_large_generated(void) { p += sizeof("foo") - 1; for (i = 0; i < 1024; ++i) { - len = snprintf((char *)p, (size_t)(buf + sizeof(buf) - p), ";a%d=1", - (int)i); + len = + snprintf((char *)p, (size_t)(buf + sizeof(buf) - p), ";a%d=1", (int)i); p += len; } @@ -4314,9 +4313,9 @@ void test_sf_parser_large_generated(void) { { /* large param key */ sf_parser_bytes_init( - &sfp, - "foo;aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa=" - "1"); + &sfp, + "foo;aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa=" + "1"); assert_int(0, ==, sf_parser_list(&sfp, &val)); assert_enum(sf_type, SF_TYPE_TOKEN, ==, val.type); @@ -4324,8 +4323,7 @@ void test_sf_parser_large_generated(void) { assert_int(0, ==, sf_parser_param(&sfp, &key, &val)); assert_str_sf_vec_eq( - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - &key); + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", &key); assert_enum(sf_type, SF_TYPE_INTEGER, ==, val.type); assert_int64(1, ==, val.integer); @@ -4339,42 +4337,42 @@ void test_sf_parser_large_generated(void) { { /* large string */ sf_parser_bytes_init( - &sfp, - "\"====================================================================" - "======================================================================" - "======================================================================" - "======================================================================" - "======================================================================" - "======================================================================" - "======================================================================" - "======================================================================" - "======================================================================" - "======================================================================" - "======================================================================" - "======================================================================" - "======================================================================" - "======================================================================" - "==============================================\""); + &sfp, + "\"====================================================================" + "======================================================================" + "======================================================================" + "======================================================================" + "======================================================================" + "======================================================================" + "======================================================================" + "======================================================================" + "======================================================================" + "======================================================================" + "======================================================================" + "======================================================================" + "======================================================================" + "======================================================================" + "==============================================\""); assert_int(0, ==, sf_parser_item(&sfp, &val)); assert_enum(sf_type, SF_TYPE_STRING, ==, val.type); assert_str_sf_vec_eq( - "======================================================================" - "======================================================================" - "======================================================================" - "======================================================================" - "======================================================================" - "======================================================================" - "======================================================================" - "======================================================================" - "======================================================================" - "======================================================================" - "======================================================================" - "======================================================================" - "======================================================================" - "======================================================================" - "============================================", - &val.vec); + "======================================================================" + "======================================================================" + "======================================================================" + "======================================================================" + "======================================================================" + "======================================================================" + "======================================================================" + "======================================================================" + "======================================================================" + "======================================================================" + "======================================================================" + "======================================================================" + "======================================================================" + "======================================================================" + "============================================", + &val.vec); assert_int(SF_ERR_EOF, ==, sf_parser_item(&sfp, NULL)); sf_parser_bytes_free(); @@ -4383,66 +4381,66 @@ void test_sf_parser_large_generated(void) { { /* large escaped string */ sf_parser_bytes_init( - &sfp, - "\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"" - "\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\" - "\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"" - "\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\" - "\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"" - "\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\" - "\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"" - "\\\"\\\"\\\"\\\"\\\"\\\"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\\\"\\\"" + "\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\" + "\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"" + "\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\" + "\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"" + "\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\" + "\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"" + "\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\" + "\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"" + "\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\" + "\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"" + "\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\" + "\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\""); assert_int(0, ==, sf_parser_item(&sfp, &val)); assert_enum(sf_type, SF_TYPE_STRING, ==, val.type); @@ -4452,37 +4450,37 @@ void test_sf_parser_large_generated(void) { sf_unescape(&unescaped, &val.vec); assert_str_sf_vec_eq( - "\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"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\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"" + "\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"" + "\"\"\"\"\"\"\"\"\"", + &unescaped); assert_int(SF_ERR_EOF, ==, sf_parser_item(&sfp, NULL)); sf_parser_bytes_free(); @@ -4491,28 +4489,28 @@ void test_sf_parser_large_generated(void) { { /* large token */ sf_parser_bytes_init( - &sfp, - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaa"); + &sfp, + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaa", + &val.vec); assert_int(SF_ERR_EOF, ==, sf_parser_item(&sfp, NULL)); sf_parser_bytes_free(); diff --git a/sfparse_test_main.c b/sfparse_test_main.c index fd4c555..742562d 100644 --- a/sfparse_test_main.c +++ b/sfparse_test_main.c @@ -36,11 +36,11 @@ int main(int argc, char *argv[]) { const MunitSuite suites[] = { - sfparse_suite, - {NULL, NULL, NULL, 0, MUNIT_SUITE_OPTION_NONE}, + sfparse_suite, + {NULL, NULL, NULL, 0, MUNIT_SUITE_OPTION_NONE}, }; const MunitSuite suite = { - "", NULL, suites, 1, MUNIT_SUITE_OPTION_NONE, + "", NULL, suites, 1, MUNIT_SUITE_OPTION_NONE, }; return munit_suite_main(&suite, NULL, argc, argv);