diff --git a/.dorpsgek.yml b/.dorpsgek.yml index 7ce84af72f..2a1dc5f0f5 100644 --- a/.dorpsgek.yml +++ b/.dorpsgek.yml @@ -8,9 +8,13 @@ notifications: only: - master only-by: - - DorpsGek + - eints-sync\[bot\] commit-comment: discussion: pull-request: issue: tag-created: + workflow-run: + only: + - .github/workflows/release.yml + - .github/workflows/ci-nightly.yml diff --git a/.editorconfig b/.editorconfig index 787a1c76c1..7b001a859e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,3 +7,471 @@ trim_trailing_whitespace = true [*.{c,cpp,h,hpp}] indent_style = tab charset = utf-8 +#indent_size = +#tab_width = +#end_of_line = + +### C++ specific editor config rules ### +## Visual Studio ## https://learn.microsoft.com/en-us/visualstudio/ide/cpp-editorconfig-properties?view=vs-2019 ## +# Indentation # +# Do not indent braces +cpp_indent_braces = false +# When a new line is typed, it's indented relatively to the innermost open parenthesis +cpp_indent_multi_line_relative_to = innermost_parenthesis +# Indent new lines within parenthesis +cpp_indent_within_parentheses = indent +# In existing code, do not use the setting for alignment of new lines within parentheses +cpp_indent_preserve_within_parentheses = true +# Indent case contents +cpp_indent_case_contents = true +# Indent case labels +cpp_indent_case_labels = true +# Do not indent braces following a case statement +cpp_indent_case_contents_when_block = false +# Do not indent braces of lambdas used as parameters +cpp_indent_lambda_braces_when_parameter = false +# No override for "Position of goto labels" (Unspecified) +#cpp_indent_goto_labels +# Move preprocessor directives to the leftmost column +cpp_indent_preprocessor = leftmost_column +# Do not indent access specifiers +cpp_indent_access_specifiers = false +# Indent namespace contents +cpp_indent_namespace_contents = true +# Preserve indentation of comments +cpp_indent_preserve_comments = true + +# Newline # +# Keep open braces for namespaces on the same line, but add a space before the brace +cpp_new_line_before_open_brace_namespace = same_line +# Keep open braces for types/classes on the same line, but add a space before the brace +cpp_new_line_before_open_brace_type = same_line +# Move open braces for functions to a new line +cpp_new_line_before_open_brace_function = new_line +# Keep open braces for control blocks on the same line, but add a space before the brace +cpp_new_line_before_open_brace_block = same_line +# Keep open braces for lambdas on the same line, but add a space before the brace +cpp_new_line_before_open_brace_lambda = same_line +# Place scope braces on separate lines +cpp_new_line_scope_braces_on_separate_lines = true +# Do not move closing braces to the same line as opening braces for empty types +cpp_new_line_close_brace_same_line_empty_type = false +# Do not move closing braces to the same line as opening braces for empty function bodies +cpp_new_line_close_brace_same_line_empty_function = false +# Do not place 'catch' and similar keywords on a new line +cpp_new_line_before_catch = false +# Do not place 'else' on a new line +cpp_new_line_before_else = false +# Do not place 'while' in a do-while loop on a new line +cpp_new_line_before_while_in_do_while = false + +# Spacing # +# Remove spaces between function names and opening parentheses of argument lists +cpp_space_before_function_open_parenthesis = remove +# Do not insert a space within parentheses of an argument list +cpp_space_within_parameter_list_parentheses = false +# Do not insert a space between parentheses when argument list is empty +cpp_space_between_empty_parameter_list_parentheses = false +# Insert space between keyword and opening parenthesis in control flow statements +cpp_space_after_keywords_in_control_flow_statements = true +# Do not insert a space within parentheses of a control statement +cpp_space_within_control_flow_statement_parentheses = false +# Do not insert a space before opening parenthesis of lambda argument lists +cpp_space_before_lambda_open_parenthesis = false +# Do not insert a space within parentheses of a C-style cast +cpp_space_within_cast_parentheses = false +# Do not insert a space after closing parenthesis of C-style cast +cpp_space_after_cast_close_parenthesis = false +# Do not insert a space within parentheses of a parenthesized expression +cpp_space_within_expression_parentheses = false +# Insert space before opening brace of blocks +cpp_space_before_block_open_brace = true +# Do not insert a space between empty braces +cpp_space_between_empty_braces = false +# Do not insert a space before opening brace of uniform initialization and initializer lists +cpp_space_before_initializer_list_open_brace = false +# No override for "Insert space within braces of uniform initialization and initializer lists" (Spacing for this varies) +#cpp_space_within_initializer_list_braces +# Preserve spaces inside uniform initialization and initializer lists +cpp_space_preserve_in_initializer_list = true +# Do not insert space before opening square brackets +cpp_space_before_open_square_bracket = false +# Do not insert space within square bracket +cpp_space_within_square_brackets = false +# Do not insert space before empty square brackets +cpp_space_before_empty_square_brackets = false +# Do not insert space between empty square brackets +cpp_space_between_empty_square_brackets = false +# Group square brackets for multi-dimensional arrays together +cpp_space_group_square_brackets = true +# Do not insert space within square brackets for lambdas +cpp_space_within_lambda_brackets = false +# Do not insert space between empty lambda brackets +cpp_space_between_empty_lambda_brackets = false +# Do not insert space before commas +cpp_space_before_comma = false +# Insert space after commas +cpp_space_after_comma = true +# Remove spaces before and after member operators +cpp_space_remove_around_member_operators = true +# Insert space before colon for base in type declarations +cpp_space_before_inheritance_colon = true +# Insert space before colon for constructors +cpp_space_before_constructor_colon = true +# Remove space before semicolons +cpp_space_remove_before_semicolon = true +# No override for "Insert space after semicolons" (Depends on if loop is unconditional) +#cpp_space_after_semicolon +# Remove spaces between unary operators and their operands +cpp_space_remove_around_unary_operator = true +# Insert spaces before and after binary operators +cpp_space_around_binary_operator = insert +# Insert spaces around assignment operators +cpp_space_around_assignment_operator = insert +# Align pointer/reference symbol to the right +cpp_space_pointer_reference_alignment = right +# Insert spaces around conditional operators +cpp_space_around_ternary_operator = insert + +# Wrapping # +# Always apply New Lines settings for blocks +cpp_wrap_preserve_blocks = never + + + +## Rider & ReSharper ## https://www.jetbrains.com/help/resharper/EditorConfig_CPP_CppBlankLinesPageScheme.html ## +# Blank Lines # +# No override for "Max blank lines in declarations" (Unspecified; Not consistent across source code) +#cpp_keep_blank_lines_in_declarations +# No override for "Max blank lines in rest of source code" (Unspecified; Not consistent across source code) +#cpp_keep_blank_lines_in_code +# No override for "Number of blank lines around class/struct/enum definition" (Unspecified; Not consistent across source code) +#cpp_blank_lines_around_class_definition +# No override for "Number of blank lines around function declarations" (Unspecified; Not consistent across source code) +#cpp_blank_lines_around_function_declaration +# No override for "Number of blank lines around function definitions" (Unspecified; Not consistent across source code) +#cpp_blank_lines_around_function_definition +# No override for "Number of blank lines around single line function definitions" (Unspecified; Not consistent across source code) +#cpp_blank_lines_around_single_line_function_definition +# No override for "Number of blank lines around namespaces" (Unspecified; Not consistent across source code) +#cpp_blank_lines_around_namespace +# No override for "Number of blank lines around other definitions and declarations" (Unspecified; Not consistent across source code) +#cpp_blank_lines_around_other_declaration + +# Braces Layout # +# Keep open braces for namespace declarations on the same line, but add a space before the brace +cpp_namespace_declaration_braces = end_of_line +# Keep open braces for linkage declarations on the same line, but add a space before the brace +cpp_linkage_specification_braces = end_of_line +# Keep open braces for types/classes on the same line, but add a space before the brace +cpp_type_declaration_braces = end_of_line +# Keep open braces for namespace definitions on the same line (does not modify spacing before the brace) +cpp_place_namespace_definitions_on_same_line = true +# Move open braces for functions to a new line +cpp_invocable_declaration_braces = next_line +# Keep open braces for lambdas on the same line, but add a space before the brace +cpp_anonymous_method_declaration_braces = end_of_line +# Keep open braces for case blocks on the same line, but add a space before the brace +cpp_case_block_braces = end_of_line +# No override for "Requires expression braces" style (requires expressions are a C++20 feature) +#cpp_requires_expression_braces +# Keep open braces for all other blocks on the same line, but add a space before the brace +cpp_other_braces = end_of_line +# Only indent the insides of multi-line expression braces +cpp_expression_braces = inside +# Place the braces of empty blocks together and on the same line +cpp_empty_block_style = together_same_line +# Force line breaks within simple compound statements +cpp_simple_block_style = line_break +# No override for "Regular expression for macros starting a block" (Marco blocks aren't used) +#cpp_macro_block_begin +# No override for "Regular expression for macros ending a block" (Marco blocks aren't used) +#cpp_macro_block_end + +# Tabs and indents # +# Redundant override (Already overriden globally by 'indent_style') +#cpp_indent_style +# Redundant override (Already overriden globally by 'indent_size') +#cpp_indent_size +# Redundant override (Already overriden globally by 'tab_width') +#cpp_tab_width +# Use spaces instead of tabs as indentation for precise alignment +cpp_alignment_tab_fill_style = use_spaces +# Allow alignment even if construct is located too far to the right, more than 2/3 of 'Hard wrap at' limit +cpp_allow_far_alignment = true + +# Indentation and Alignment # +# No override for "Continuous line indent" (Varies throughout source code) +#cpp_continuous_line_indent +# Do not use continuous line indent in function declaration and invocation parentheses +cpp_use_continuous_line_indent_in_method_pars = false +# Do not use continuous line indent in initializer lists +cpp_use_continuous_line_indent_in_expression_braces = false +# Indent namespace members (including nested ones) +cpp_namespace_indentation = all +# No override for "Indent linkage specification block members" (Unspecified) +#cpp_linkage_specification_indentation +# Do not indent access specifier from class +cpp_indent_access_specifiers_from_class = false +# Indent class member from access specifier +cpp_indent_class_members_from_access_specifiers = true +# Do not indent if a function definition or declaration is wrapped after the type +cpp_indent_wrapped_function_names = false +# Indent 'case' labels from 'switch' +cpp_indent_switch_labels = true +# No override for "Indent function declarations' parentheses" (Varies throughout source code) +#cpp_indent_method_decl_pars +# No override for "Indent method calls' parentheses" (Varies throughout source code) +#cpp_indent_invocation_pars +# No override for "Indent statement (if, while, for, etc) parentheses" (Varies throughout source code) +#cpp_indent_statement_pars +# Do not change preprocessor directives indenting +cpp_indent_preprocessor_directives = do_not_change +# No override for "Indent C++/CLI generic constraints" (C++/CLI is not used) +#cpp_indent_type_constraints +# Align/indent comments started at the first column +cpp_indent_comment = true +# Comments that comment out code will use the indentation level of the commented code. +cpp_place_comments_at_first_column = false +# Align multiline declarators in declaration +cpp_align_multiple_declaration = true +# Align multiline function parameters +cpp_align_multiline_parameter = true +# Align multiline call arguments +cpp_align_multiline_argument = true +# Do not align first of multiline call arguments with the opening parentheses +cpp_align_first_arg_by_paren = false +# Align multiline initializer list arguments +cpp_align_multiline_expression_brace = true +# No override for "Align multiline template parameters in template declaration" (Unspecified) +#cpp_align_multiline_type_parameter +# No override for "Align multiline template arguments" (Unspecified) +#cpp_align_multiline_type_argument +# Align multiline base classes in class base clause +cpp_align_multiline_extends_list = true +# Align multiline member initializers in member initializer lists +cpp_align_multiline_ctor_init = true +# Outdent commas placed on new line +cpp_outdent_commas = true +# Do not align multiline ?: operator with first line (since alignment is incorrect) +cpp_align_ternary = none +# Do not indent aligned ?: operator (since indentation varies) +cpp_indent_aligned_ternary = false +# No override for "Align multiline chained method calls" (Unspecified) +#cpp_align_multiline_calls_chain +# No override for "Outdent '.' and '->' in chained method calls on new lines" (Unspecified) +#cpp_outdent_dots +# Do not align multiline chained binary expressions +cpp_align_multiline_binary_expressions_chain = false +# Fix column alignment in adjacent lines +cpp_int_align_fix_in_adjacent = true +# Align assignments with adjacent assignments +cpp_int_align_eq = true +# Do not align declaration names with adjacent declaration names +cpp_int_align_declaration_names = false +# Align end-of-line comments with adjacent end-of-line comments +cpp_int_align_comments = true + +# Spaces # +# Do not put space before ANY commas +cpp_space_before_comma = false +# Put space after ALL commas +cpp_space_after_comma = true +# Put space before ptr in declaration of variable +cpp_space_before_ptr_in_data_member = true +# Do not put space after ptr in declaration of variable +cpp_space_after_ptr_in_data_member = false +# Put space before ptr in declaration of multiple variables +cpp_space_before_ptr_in_data_members = true +# Do not put space after ptr in declaration of multiple variables +cpp_space_after_ptr_in_data_members = false +# Put space before ptr in return type of function +cpp_space_before_ptr_in_method = true +# Do not put space after ptr in return type of function +cpp_space_after_ptr_in_method = false +# Do not put space before ptr in abstract declaration +cpp_space_before_ptr_in_abstract_decl = false +# Put space before ref in declaration of variable +cpp_space_before_ref_in_data_member = true +# Do not put space after ref in declaration of variable +cpp_space_after_ref_in_data_member = false +# Put space before ref in declaration of multiple variables +cpp_space_before_ref_in_data_members = true +# Do not put space after ref in declaration of multiple variables +cpp_space_after_ref_in_data_members = false +# Do not put space before ref in return type of function +cpp_space_before_ref_in_method = false +# Put space after ref in return type of function +cpp_space_after_ref_in_method = true +# Do not put space before ref in abstract declaration +cpp_space_before_ref_in_abstract_decl = false +# Do not put space before parentheses in function parameters +cpp_space_between_method_declaration_name_and_open_parenthesis = false +# Do not put space before parentheses in lambda parameters +cpp_space_before_lambda_parentheses = false +# Do not put space within parentheses in function parameters +cpp_space_between_method_declaration_parameter_list_parentheses = false +# Do not put space within empty parentheses in function parameters +cpp_space_between_method_declaration_empty_parameter_list_parentheses = false +# Do not put space before angle brackets in template parameters +cpp_space_before_template_params = false +# Do not put space within angle brackets in template parameters +cpp_space_within_template_params = false +# Do not put space within empty angle brackets in template parameters +cpp_space_within_empty_template_params = false +# Do not put space before angle brackets in template arguments +cpp_space_before_template_args = false +# Do not put space within angle brackets in template arguments +cpp_space_within_template_args = false +# Do not put space between closing angle brackets in template arguments +cpp_space_between_closing_angle_brackets_in_template_args = false +# Put space around '=' in alias declaration and namespace alias +cpp_space_around_alias_eq = true +# Do not put space around '->' in trailing return types +cpp_space_around_deref_in_trailing_return_type = false +# Put space before base types list colon +cpp_space_before_colon_in_inheritance_clause = true +# Put space after base types list colon +cpp_space_after_colon_in_inheritance_clause = true +# No override for "Before C++/CLI generic constraint colon" (Unspecified) +#cpp_space_before_type_parameter_constraint_colon +# No override for "After C++/CLI generic constraint colon" (Unspecified) +#cpp_space_after_type_parameter_constraint_colon +# Put space before parentheses of control statements +cpp_space_after_keywords_in_control_flow_statements = true +# Do not put space within parentheses of control statements +cpp_space_between_parentheses_of_control_flow_statements = false +# Do not put space before semicolon in 'for' statements +cpp_space_before_semicolon_in_for_statement = false +# Put space after semicolon in 'for' statements +cpp_space_after_semicolon_in_for_statement = true +# Put space before ':' in range-based for loop +cpp_space_before_for_colon = true +# Put space after ':' in range-based for loop +cpp_space_after_for_colon = true +# Do not put space before colon in switch case or label statement +cpp_space_before_colon_in_case = false +# Put space after colon in switch case or label statement +cpp_space_after_colon_in_case = true +# Put space around binary operator +cpp_space_around_binary_operator = true +# Put space around assignment operator +cpp_space_around_assignment_operator = true +# Do not put space around dot, '->', '.*' and '->.' +cpp_space_around_member_access_operator = false +# Do not put space within any parentheses +cpp_space_within_parentheses = false +# Do not put space before array subscript brackets +cpp_space_before_open_square_brackets = false +# Do not put space within array subscript brackets +cpp_space_between_square_brackets = false +# Do not put space before empty parentheses in function call and initialization +cpp_space_between_method_call_name_and_opening_parenthesis = false +# Do not put space within parentheses in cast expressions +cpp_space_between_typecast_parentheses = false +# Do not put space after parentheses in cast expressions +cpp_space_after_cast = false +# Do not put space within parentheses in function call and initialization +cpp_space_between_method_call_parameter_list_parentheses = false +# Do not put space within empty parentheses in function call and initialization +cpp_space_between_method_call_empty_parameter_list_parentheses = false +# Put space in ternary operator '? :' before '?' +cpp_space_before_ternary_quest = true +# Put space in ternary operator '? :' after '?' +cpp_space_after_ternary_quest = true +# Put space in ternary operator '? :' before ':' +cpp_space_before_ternary_colon = true +# Put space in ternary operator '? :' after ':' +cpp_space_after_ternary_colon = true +# Do not put space before uniform initialization braces +cpp_space_before_initializer_braces = false +# Do not put space within uniform initialization braces +cpp_space_within_initializer_braces = false +# Do not put space within empty uniform initialization braces +cpp_space_within_empty_initializer_braces = false +# Put space before end of line comment +cpp_space_before_trailing_comment = true +# Preserve spaces before end of line comment +cpp_disable_space_changes_before_trailing_comment = true + +# Line breaks and Wrapping # +# Redundant override (Already overriden globally by 'insert_final_newline') +#cpp_insert_final_newline +# Redundant override (Already overriden earlier in Visual Studio section) +#cpp_new_line_before_else +# Do not place 'while' in a do-while loop on a new line +cpp_new_line_before_while = false +# Redundant override (Already overriden earlier in Visual Studio section) +#cpp_new_line_before_catch +# Do not change the line breaks of single embedded statements +cpp_simple_embedded_statement_style = do_not_change +# Do not change the line breaks of simple 'case' statement +cpp_simple_case_statement_style = do_not_change +# Put member function definition return type on same line +cpp_function_definition_return_type_style = on_single_line +# Put top-level function definition return type on same line +cpp_toplevel_function_definition_return_type_style = on_single_line +# Put member function declaration return type on same line +cpp_function_declaration_return_type_style = on_single_line +# Put top-level function declaration return type on same line +cpp_toplevel_function_declaration_return_type_style = on_single_line +# Force template<...> of a template declaration on new line +cpp_break_template_declaration = line_break +# No override for "Break line before the requires-clause" (requires-clause is a C++20 feature) +#cpp_line_break_before_requires_clause +# Do not change the line break before the colon in member initializer lists +cpp_member_initializer_list_style = do_not_change +# Do not change the line break after the colon in member initializer lists +cpp_line_break_after_colon_in_member_initializer_lists = do_not_change +# No override for "Break line before comma in member initializer lists" (Varies throughout source code) +#cpp_line_break_before_comma_in_member_initializer_lists +# No override for "Break line after comma in member initializer lists" (Varies throughout source code) +#cpp_line_break_after_comma_in_member_initializer_lists +# No override for "Allow C++/CLI generic constraints on the same line" (C++/CLI is not used) +#cpp_place_type_constraints_on_same_line +# No override for "Keep existing line breaks" (Varies throughout source code; depends on developer preference) +#cpp_keep_user_linebreaks +# No override for "Hard wrap at _ characters" (Unspecified) +#cpp_max_line_length +# Do not prefer wrap before ',' +cpp_wrap_before_comma = false +# Do not prefer wrap before ',' in base clause +cpp_wrap_before_comma_in_base_clause = false +# No override for "Wrap ternary expression" (Varies throughout source code) +#cpp_wrap_ternary_expr_style +# No override for "Prefer wrap before '?' and ':' in ternary expressions" (Varies throughout source code) +#cpp_wrap_before_ternary_opsigns +# No override for "Prefer wrap before ':'" (Varies throughout source code) +#cpp_wrap_before_colon +# No override for "Prefer wrap before first C++/CLI generic constraint" (C++/CLI is not used) +#cpp_wrap_before_first_type_parameter_constraint +# No override for "Wrap multiple C++/CLI generic constraints" (C++/CLI is not used) +#cpp_wrap_multiple_type_parameter_constraints_style +# No override for "Wrap enum definition" (Varies throughout source code) +#cpp_wrap_enumeration_style +# No override for "Wrap braced initializer list" (Varies throughout source code) +#cpp_wrap_braced_init_list_style +# No override for "Wrap base classes list" (Varies throughout source code) +#cpp_wrap_base_clause_style +# No override for "Wrap constructor initializer" (Varies throughout source code) +#cpp_wrap_ctor_initializer_style +# No override for "Wrap formal parameters" (Varies throughout source code) +#cpp_wrap_parameters_style +# Do not prefer wrap before '(' in declaration +cpp_wrap_before_declaration_lpar = false +# Prefer wrap after '(' in declaration +cpp_wrap_after_declaration_lpar = true +# Do not prefer wrap before ')' in declaration +cpp_wrap_before_declaration_rpar = false +# No override for "Wrap invocation arguments" (Varies throughout source code) +#cpp_wrap_arguments_style +# Do not prefer wrap before '(' in invocation +cpp_wrap_before_invocation_lpar = false +# Prefer wrap after '(' in invocation +cpp_wrap_after_invocation_lpar = true +# Do not prefer wrap before ')' in invocation +cpp_wrap_before_invocation_rpar = false +# Prefer wrap after '{' in initializer lists +cpp_wrap_after_expression_lbrace = true +# Do not prefer wrap before '}' in initializer lists +cpp_wrap_before_expression_rbrace = false diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index aec09828f7..c4bf40139b 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,3 +1,13 @@ + + ## Motivation / Problem - -OpenTTD is an open source transport simulation game - -Tools required for downloading the OpenGFX/SFX packs - -Downloads the OpenGFX graphics pack for OpenTTD - -Downloads the OpenSFX sound effects pack for OpenTTD - -Downloads the NoSound pack for OpenTTD, to disable sound effects - - - - - - -~Next -README.md -Welcome to the OpenTTD installer. This program will install OpenTTD 1.0 on your system. Before we begin the installation process, please take a moment to read the following document. - -Select "Next" to continue, or "Cancel" to abort installation. - - - - -~Next -COPYING.md -OpenTTD is licenced under the GNU General Public License. The text of the licence is below. - -Select "Next" if you agree to this licence. -Select "Cancel" to abort installation. - - - - -~Next -On this page, you may choose which components to install. If you don't own Transport Tycoon Deluxe, you will need to download OpenGFX (3MiB) and OpenSFX (10MiB). - - - - - -I~nstall - -Press "Install" to begin installing OpenTTD. - - - diff --git a/os/os2/installer/remove_nosound.cmd b/os/os2/installer/remove_nosound.cmd deleted file mode 100644 index 21c11e80d9..0000000000 --- a/os/os2/installer/remove_nosound.cmd +++ /dev/null @@ -1,15 +0,0 @@ -@echo off -if "%1" == "" goto err - -echo Removing NoSound... - -del %1\baseset\nosound\*.* /n -rmdir %1\baseset\nosound - -echo NoSound has been removed. -goto end - -:err -echo This batch file is only intended for use by the OpenTTD installer. - -:end diff --git a/os/os2/installer/remove_opengfx.cmd b/os/os2/installer/remove_opengfx.cmd deleted file mode 100644 index 71465d1677..0000000000 --- a/os/os2/installer/remove_opengfx.cmd +++ /dev/null @@ -1,15 +0,0 @@ -@echo off -if "%1" == "" goto err - -echo Removing OpenGFX... - -del %1\baseset\opengfx\*.* /n -rmdir %1\baseset\opengfx - -echo OpenGFX has been removed. -goto end - -:err -echo This batch file is only intended for use by the OpenTTD installer. - -:end diff --git a/os/os2/installer/remove_opensfx.cmd b/os/os2/installer/remove_opensfx.cmd deleted file mode 100644 index 361a870e33..0000000000 --- a/os/os2/installer/remove_opensfx.cmd +++ /dev/null @@ -1,15 +0,0 @@ -@echo off -if "%1" == "" goto err - -echo Removing OpenSFX... - -del %1\baseset\opensfx\*.* /n -rmdir %1\baseset\opensfx - -echo OpenSFX has been removed. -goto end - -:err -echo This batch file is only intended for use by the OpenTTD installer. - -:end diff --git a/os/os2/openttd.wpj b/os/os2/openttd.wpj deleted file mode 100644 index 61b2caa553..0000000000 --- a/os/os2/openttd.wpj +++ /dev/null @@ -1,64 +0,0 @@ -40 -projectIdent -0 -VpeMain -1 -WRect -0 -0 -10304 -10020 -2 -MProject -3 -MCommand -15 -svn_version.cmd -4 -MCommand -0 -2 -5 -WFileName -17 -..\..\openttd.tgt -6 -WFileName -23 -..\..\strgen\strgen.tgt -7 -WVList -2 -8 -VComponent -9 -WRect -0 -0 -5696 -4240 -0 -0 -10 -WFileName -17 -..\..\openttd.tgt -0 -0 -11 -VComponent -12 -WRect -688 -680 -5696 -4240 -0 -0 -13 -WFileName -23 -..\..\strgen\strgen.tgt -0 -1 -8 diff --git a/os/os2/svn_version.cmd b/os/os2/svn_version.cmd deleted file mode 100644 index cc8836fc0b..0000000000 --- a/os/os2/svn_version.cmd +++ /dev/null @@ -1,30 +0,0 @@ -@echo off -echo Running SVN version detection script... -rem -rem Requires subversion (`svnversion') to be installed -rem -cd ..\.. -if not "%RELEASE%"=="" goto forcerelease -if not exist .svn goto nosvn -svnversion -n . > os\os2\svnver.tmp -if not "%ERRORLEVEL%"=="0" goto nosvn - -copy os\os2\svnver1.c+os\os2\svnver.tmp+os\os2\svnver2.c rev.c /a /y > nul 2> nul -goto end - -:forcerelease -echo Forcing release string "%RELEASE%"... -echo const char _openttd_revision[] = "%RELEASE%"; > rev.c -echo const int _revision_number = 0; >> rev.c -goto end - -:nosvn -echo Error executing `svnversion' or no SVN data detected -echo const char _openttd_revision[] = "norev000"; > rev.c -echo const int _revision_number = 0; >> rev.c -goto end - -:end -cd os\os2 -del svnver.tmp > nul 2> nul -rem end diff --git a/os/os2/svnver1.c b/os/os2/svnver1.c deleted file mode 100644 index 56d3572c50..0000000000 --- a/os/os2/svnver1.c +++ /dev/null @@ -1,3 +0,0 @@ -/* rev.c part #1 for OS/2 - ensure no newline at end of file! */ - -const char _openttd_revision[] = "r \ No newline at end of file diff --git a/os/os2/svnver2.c b/os/os2/svnver2.c deleted file mode 100644 index 02d87603c5..0000000000 --- a/os/os2/svnver2.c +++ /dev/null @@ -1,4 +0,0 @@ -"; -const int _revision_number = 0; - -/* rev.c part 2 for OS/2 - ensure no newline at start of file! */ \ No newline at end of file diff --git a/os/windows/openttd.manifest b/os/windows/openttd.manifest index cb536a819d..21fee42174 100644 --- a/os/windows/openttd.manifest +++ b/os/windows/openttd.manifest @@ -15,8 +15,6 @@ - - diff --git a/os/windows/sign.bat b/os/windows/sign.bat index 3954d4618c..b438127ae8 100644 --- a/os/windows/sign.bat +++ b/os/windows/sign.bat @@ -1,18 +1,2 @@ @echo off -REM Signing script -REM Arguments: sign.bat exe_to_sign certificate_subject_name - -REM This is a loose wrapper around the Microsoft signtool application (included in the Windows SDK). -REM See https://docs.microsoft.com/en-us/dotnet/framework/tools/signtool-exe for more details. - -REM Path to signtool.exe -IF NOT DEFINED SIGNTOOL_PATH (SET SIGNTOOL_PATH=signtool) - -REM URL of the timestamp server -IF NOT DEFINED SIGNTOOL_TIMESTAMP_URL (SET SIGNTOOL_TIMESTAMP_URL=http://timestamp.digicert.com) - -REM Sign with SHA-1 for Windows 7 and below -"%SIGNTOOL_PATH%" sign -v -n %2 -t %SIGNTOOL_TIMESTAMP_URL% -fd sha1 %1 - -REM Sign with SHA-256 for Windows 8 and above -"%SIGNTOOL_PATH%" sign -v -n %2 -tr %SIGNTOOL_TIMESTAMP_URL% -fd sha256 -td sha256 -as %1 +pwsh -File "%~dp0sign_azure.ps1" %1 diff --git a/os/windows/sign_azure.ps1 b/os/windows/sign_azure.ps1 new file mode 100644 index 0000000000..e19476fa6d --- /dev/null +++ b/os/windows/sign_azure.ps1 @@ -0,0 +1,40 @@ +# Signing script for Azure Code Signing +# Arguments: sign_azure.ps1 path_to_sign +# +# Environment variables must be set up before use: +# +# AZURE_TENANT_ID +# AZURE_CLIENT_ID +# AZURE_CLIENT_SECRET +# AZURE_CODESIGN_ACCOUNT_NAME +# AZURE_CODESIGN_ENDPOINT +# AZURE_CODESIGN_PROFILE_NAME + +Param +( + # Files folder + [Parameter(Mandatory=$true, Position=0)] + $FilesFolder +) + +if (!$Env:AZURE_CODESIGN_ENDPOINT -or !$Env:AZURE_CODESIGN_ACCOUNT_NAME -or !$Env:AZURE_CODESIGN_PROFILE_NAME -or + !$Env:AZURE_TENANT_ID -or !$Env:AZURE_CLIENT_ID -or !$Env:AZURE_CLIENT_SECRET) +{ + "Code signing variables not found; most likely running in a fork. Skipping signing." + exit +} + +Install-Module -Name AzureCodeSigning -Scope CurrentUser -RequiredVersion 0.3.0 -Force -Repository PSGallery + +$params = @{} + +$params["Endpoint"] = $Env:AZURE_CODESIGN_ENDPOINT +$params["CodeSigningAccountName"] = $Env:AZURE_CODESIGN_ACCOUNT_NAME +$params["CertificateProfileName"] = $Env:AZURE_CODESIGN_PROFILE_NAME +$params["FilesFolder"] = $FilesFolder +$params["FilesFolderFilter"] = "exe" +$params["FileDigest"] = "SHA256" +$params["TimestampRfc3161"] = "http://timestamp.acs.microsoft.com" +$params["TimestampDigest"] = "SHA256" + +Invoke-AzureCodeSigning @params diff --git a/regression/CMakeLists.txt b/regression/CMakeLists.txt new file mode 100644 index 0000000000..340e29c2d9 --- /dev/null +++ b/regression/CMakeLists.txt @@ -0,0 +1,24 @@ + # Copy the regression configuration in a special folder, so all autogenerated + # folders end up in the same place after running regression. + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/regression.cfg + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/regression.cfg + ${CMAKE_CURRENT_BINARY_DIR}/regression.cfg + MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/regression.cfg + COMMENT "Copying regression.cfg regression file" + ) + + # Create a new target which copies all regression files + # Subdirectory targets will add themselves as dependencies + add_custom_target(regression_files + ALL # this is needed because 'make test' doesn't resolve dependencies, and otherwise this is never executed + DEPENDS + ${CMAKE_BINARY_DIR}/regression/regression.cfg + ) + + # Create a new target which runs the regression + # Subdirectory targets will add themselves as dependencies + add_custom_target(regression) + + add_subdirectory(regression) + add_subdirectory(stationlist) diff --git a/regression/regression/CMakeLists.txt b/regression/regression/CMakeLists.txt new file mode 100644 index 0000000000..9aab44efe4 --- /dev/null +++ b/regression/regression/CMakeLists.txt @@ -0,0 +1,8 @@ +include(CreateRegression) +create_regression( + ${CMAKE_CURRENT_SOURCE_DIR}/info.nut + ${CMAKE_CURRENT_SOURCE_DIR}/main.nut + ${CMAKE_CURRENT_SOURCE_DIR}/require.nut + ${CMAKE_CURRENT_SOURCE_DIR}/result.txt + ${CMAKE_CURRENT_SOURCE_DIR}/test.sav +) diff --git a/regression/regression/info.nut b/regression/regression/info.nut index 9c775eede5..383f219cd7 100644 --- a/regression/regression/info.nut +++ b/regression/regression/info.nut @@ -4,7 +4,7 @@ class Regression extends AIInfo { function GetShortName() { return "REGR"; } function GetDescription() { return "This runs regression-tests on some commands. On the same map the result should always be the same."; } function GetVersion() { return 1; } - function GetAPIVersion() { return "14"; } + function GetAPIVersion() { return "15"; } function GetDate() { return "2007-03-18"; } function CreateInstance() { return "Regression"; } function UseAsRandomAI() { return false; } diff --git a/regression/regression/main.nut b/regression/regression/main.nut index 7621c49c6f..fce258a739 100644 --- a/regression/regression/main.nut +++ b/regression/regression/main.nut @@ -220,6 +220,7 @@ function Regression::Airport() print(" GetAirportWidth(" + i + "): " + AIAirport.GetAirportWidth(i)); print(" GetAirportHeight(" + i + "): " + AIAirport.GetAirportHeight(i)); print(" GetAirportCoverageRadius(" + i + "): " + AIAirport.GetAirportCoverageRadius(i)); + print(" GetAirportNumHelipads(" + i + "): " + AIAirport.GetAirportNumHelipads(i)); } print(" GetBankBalance(): " + AICompany.GetBankBalance(AICompany.COMPANY_SELF)); @@ -1107,6 +1108,7 @@ function Regression::Rail() print(" IsRailTile(): " + AIRail.IsRailTile(33411)); print(" BuildRailDepot(): " + AIRail.BuildRailDepot(0, 1)); print(" BuildRailDepot(): " + AIRail.BuildRailDepot(33411, 33411)); + print(" BuildRailDepot(): " + AIRail.BuildRailDepot(33411, 33410)); print(" BuildRailDepot(): " + AIRail.BuildRailDepot(33411, 33414)); print(" BuildRailDepot(): " + AIRail.BuildRailDepot(33411, 33412)); print(" GetRailDepotFrontTile(): " + AIRail.GetRailDepotFrontTile(33411)); @@ -1203,6 +1205,7 @@ function Regression::Road() print(" IsRoadTile(): " + AIRoad.IsRoadTile(33411)); print(" BuildRoadDepot(): " + AIRoad.BuildRoadDepot(0, 1)); print(" BuildRoadDepot(): " + AIRoad.BuildRoadDepot(33411, 33411)); + print(" BuildRoadDepot(): " + AIRoad.BuildRoadDepot(33411, 33410)); print(" BuildRoadDepot(): " + AIRoad.BuildRoadDepot(33411, 33414)); print(" BuildRoadDepot(): " + AIRoad.BuildRoadDepot(33411, 33412)); print(" HasRoadType(Road): " + AIRoad.HasRoadType(33411, AIRoad.ROADTYPE_ROAD)); @@ -1356,6 +1359,21 @@ function Regression::Station() } } +function Regression::StationList() +{ + print(""); + print("--StationList--"); + local road_stations = AIStationList(AIStation.STATION_TRUCK_STOP); + for (local st = road_stations.Begin(); !road_stations.IsEnd(); st = road_stations.Next()) { + print(" GetName(): " + AIStation.GetName(st)); + print(" TileList_StationCoverage:"); + local coverage = AITileList_StationCoverage(st); + for (local i = coverage.Begin(); !coverage.IsEnd(); i = coverage.Next()) { + print(" " + i); + } + } +} + function Regression::Tile() { print(""); @@ -1812,10 +1830,17 @@ function Regression::Vehicle() print(" GetLastErrorString(): " + AIError.GetLastErrorString()); local list = AIVehicleList(); + local in_depot = AIVehicleList(AIVehicle.IsInDepot); + local IsType = function(vehicle_id, type) { + return AIVehicle.GetVehicleType(vehicle_id) == type; + } + local rv_list = AIVehicleList(IsType, AIVehicle.VT_ROAD); print(""); print("--VehicleList--"); print(" Count(): " + list.Count()); + print(" InDepot Count(): " + in_depot.Count()); + print(" RoadVehicle Count(): " + rv_list.Count()); list.Valuate(AIVehicle.GetLocation); print(" Location ListDump:"); for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) { @@ -1980,6 +2005,7 @@ function Regression::Start() this.Road(); this.Sign(); this.Station(); + this.StationList(); this.Tile(); this.TileList(); this.Town(); @@ -2017,5 +2043,12 @@ function Regression::Start() print(" IsEventWaiting: false"); this.Math(); + + /* Check Valuate() is actually limited, MUST BE THE LAST TEST. */ + print("--Valuate() with excessive CPU usage--") + local list = AIList(); + list.AddItem(0, 0); + local Infinite = function(id) { while(true); } + list.Valuate(Infinite); } diff --git a/regression/regression/result.txt b/regression/regression/result.txt index 9942857cfb..27a81675a9 100644 --- a/regression/regression/result.txt +++ b/regression/regression/result.txt @@ -88,9 +88,9 @@ abs( 21): 21 --AIBase-- - Rand(): 2232656694 - Rand(): 2514636170 - Rand(): 3897038727 + Rand(): 2113409458 + Rand(): 2000129769 + Rand(): 1788051963 RandRange(0): 0 RandRange(0): 0 RandRange(0): 0 @@ -99,13 +99,13 @@ RandRange(1): 0 RandRange(2): 0 RandRange(2): 0 - RandRange(2): 0 - RandRange(1000000): 666804 - RandRange(1000000): 624059 - RandRange(1000000): 697029 - Chance(1, 2): true + RandRange(2): 1 + RandRange(1000000): 338687 + RandRange(1000000): 274895 + RandRange(1000000): 217539 Chance(1, 2): false Chance(1, 2): true + Chance(1, 2): false --List-- IsEmpty(): true @@ -420,144 +420,144 @@ 1098 => 46116 1099 => 46158 Randomize ListDump: - 1 => 688298322 - 2 => 2585420314 - 1000 => 1701392078 - 1001 => 2664118875 - 1002 => 3408466361 - 1003 => 4098642324 - 1004 => 3858929894 - 1005 => 3774625512 - 1006 => 2809742492 - 1007 => 3983931060 - 1008 => 2791524857 - 1009 => 4184021601 - 1010 => 4212142121 - 1011 => 46859773 - 1012 => 3095744278 - 1013 => 3104411371 - 1014 => 326384434 - 1015 => 1486817960 - 1016 => 2883541699 - 1017 => 3786540442 - 1018 => 820019294 - 1019 => 710762995 - 1020 => 3534100264 - 1021 => 3585356150 - 1022 => 732190215 - 1023 => 236336673 - 1024 => 740596257 - 1025 => 1135321785 - 1026 => 2067474156 - 1027 => 2899283689 - 1028 => 4054438597 - 1029 => 928616892 - 1030 => 1712486685 - 1031 => 1994118287 - 1032 => 1333321243 - 1033 => 194124284 - 1034 => 615083294 - 1035 => 628086450 - 1036 => 498957825 - 1037 => 1359697121 - 1038 => 1888433963 - 1039 => 941623020 - 1040 => 2369304004 - 1041 => 3523427032 - 1042 => 3236625937 - 1043 => 182127597 - 1044 => 646955927 - 1045 => 2870345582 - 1046 => 623062612 - 1047 => 2308011710 - 1048 => 3026140316 - 1049 => 3838191076 - 1051 => 3182411967 - 1052 => 2762833244 - 1053 => 1960404034 - 1054 => 1573325453 - 1055 => 3978347993 - 1056 => 699712177 - 1057 => 863274966 - 1058 => 1728276475 - 1059 => 4048271407 - 1060 => 1919485436 - 1061 => 111273464 - 1062 => 125435213 - 1063 => 155132602 - 1064 => 4123293220 - 1065 => 655046914 - 1066 => 1577399562 - 1067 => 1028818150 - 1068 => 447058239 - 1069 => 3237047027 - 1070 => 2968751973 - 1071 => 4096278708 - 1072 => 1523643051 - 1073 => 231373233 - 1074 => 1121759962 - 1075 => 1449439846 - 1076 => 2679696543 - 1077 => 2785673432 - 1078 => 2116903943 - 1079 => 672822173 - 1080 => 3325393385 - 1081 => 1589904755 - 1082 => 1148782015 - 1083 => 663503316 - 1084 => 933352745 - 1085 => 577717039 - 1086 => 402172048 - 1087 => 1812250453 - 1088 => 667300501 - 1089 => 2456141519 - 1090 => 3438492520 - 1091 => 420696035 - 1092 => 2131427774 - 1093 => 3859663748 - 1094 => 4134083418 - 1095 => 1969629634 - 1096 => 3739173141 - 1097 => 3459847605 - 1098 => 2834059387 - 1099 => 3148043212 + 1 => 1667006376 + 2 => 814756458 + 1000 => 2792131700 + 1001 => 3417650573 + 1002 => 1856129988 + 1003 => 1800973341 + 1004 => 4197962148 + 1005 => 2463509731 + 1006 => 2312121797 + 1007 => 1357932132 + 1008 => 1603755907 + 1009 => 1718096015 + 1010 => 3850074449 + 1011 => 2711130211 + 1012 => 2371249199 + 1013 => 881020769 + 1014 => 3366660077 + 1015 => 808768948 + 1016 => 3035331984 + 1017 => 2813590961 + 1018 => 2745021820 + 1019 => 3075151719 + 1020 => 2553774560 + 1021 => 4267762096 + 1022 => 3863175846 + 1023 => 4198397908 + 1024 => 817599906 + 1025 => 3149240362 + 1026 => 3003005979 + 1027 => 1214815375 + 1028 => 3784363817 + 1029 => 3181864540 + 1030 => 325341059 + 1031 => 1011889231 + 1032 => 3142617173 + 1033 => 1197220206 + 1034 => 4060510885 + 1035 => 3596342467 + 1036 => 219406671 + 1037 => 3695508783 + 1038 => 2823603997 + 1039 => 2625659720 + 1040 => 4113498476 + 1041 => 1125297786 + 1042 => 671905104 + 1043 => 1231077134 + 1044 => 892292375 + 1045 => 2441486929 + 1046 => 1804593432 + 1047 => 2536560053 + 1048 => 1896826021 + 1049 => 1672512966 + 1051 => 977884299 + 1052 => 681948608 + 1053 => 3853505792 + 1054 => 4118706553 + 1055 => 3581698138 + 1056 => 3073782502 + 1057 => 1084753140 + 1058 => 2266056077 + 1059 => 1239805090 + 1060 => 1183528423 + 1061 => 501361238 + 1062 => 66542127 + 1063 => 775638990 + 1064 => 1111474321 + 1065 => 3465462871 + 1066 => 2317535037 + 1067 => 878310882 + 1068 => 2231368582 + 1069 => 2353633007 + 1070 => 179259867 + 1071 => 1322707275 + 1072 => 1474105363 + 1073 => 619989187 + 1074 => 3221603092 + 1075 => 2400416540 + 1076 => 3926392705 + 1077 => 1122978123 + 1078 => 3266139701 + 1079 => 2948697341 + 1080 => 3262493501 + 1081 => 2200252596 + 1082 => 4091101485 + 1083 => 2797438343 + 1084 => 2608201933 + 1085 => 2577605442 + 1086 => 1178956760 + 1087 => 3047709109 + 1088 => 1065186815 + 1089 => 841440515 + 1090 => 842182476 + 1091 => 289059855 + 1092 => 2114106829 + 1093 => 436435334 + 1094 => 111052607 + 1095 => 81827083 + 1096 => 1961213887 + 1097 => 1374385392 + 1098 => 3255118186 + 1099 => 2245402931 KeepTop(10): - 1 => 688298322 - 2 => 2585420314 - 1000 => 1701392078 - 1001 => 2664118875 - 1002 => 3408466361 - 1003 => 4098642324 - 1004 => 3858929894 - 1005 => 3774625512 - 1006 => 2809742492 - 1007 => 3983931060 + 1 => 1667006376 + 2 => 814756458 + 1000 => 2792131700 + 1001 => 3417650573 + 1002 => 1856129988 + 1003 => 1800973341 + 1004 => 4197962148 + 1005 => 2463509731 + 1006 => 2312121797 + 1007 => 1357932132 KeepBottom(8): - 1000 => 1701392078 - 1001 => 2664118875 - 1002 => 3408466361 - 1003 => 4098642324 - 1004 => 3858929894 - 1005 => 3774625512 - 1006 => 2809742492 - 1007 => 3983931060 + 1000 => 2792131700 + 1001 => 3417650573 + 1002 => 1856129988 + 1003 => 1800973341 + 1004 => 4197962148 + 1005 => 2463509731 + 1006 => 2312121797 + 1007 => 1357932132 RemoveBottom(2): - 1000 => 1701392078 - 1001 => 2664118875 - 1002 => 3408466361 - 1003 => 4098642324 - 1004 => 3858929894 - 1005 => 3774625512 + 1000 => 2792131700 + 1001 => 3417650573 + 1002 => 1856129988 + 1003 => 1800973341 + 1004 => 4197962148 + 1005 => 2463509731 RemoveTop(2): - 1002 => 3408466361 - 1003 => 4098642324 - 1004 => 3858929894 - 1005 => 3774625512 + 1002 => 1856129988 + 1003 => 1800973341 + 1004 => 4197962148 + 1005 => 2463509731 RemoveList({1003, 1004}): - 1002 => 3408466361 - 1005 => 3774625512 + 1002 => 1856129988 + 1005 => 2463509731 KeepList({1003, 1004, 1005}): - 1005 => 3774625512 + 1005 => 2463509731 AddList({1005, 4000, 4001, 4002}): 1005 => 1005 4000 => 8000 @@ -588,7 +588,7 @@ ERROR: IsEnd() is invalid as Begin() is never called SetName(): false GetLastErrorString(): ERR_NAME_IS_NOT_UNIQUE GetName(): Regression - GetPresidentName(): J. Green + GetPresidentName(): F. Gribble SetPresidentName(): true GetPresidentName(): Regression AI GetBankBalance(): 100000 @@ -805,56 +805,67 @@ ERROR: IsEnd() is invalid as Begin() is never called GetAirportWidth(-1): -1 GetAirportHeight(-1): -1 GetAirportCoverageRadius(-1): -1 + GetAirportNumHelipads(-1): -1 IsAirportInformationAvailable(0): true IsValidAirportType(0): true GetAirportWidth(0): 4 GetAirportHeight(0): 3 GetAirportCoverageRadius(0): 4 + GetAirportNumHelipads(0): 0 IsAirportInformationAvailable(1): true IsValidAirportType(1): false GetAirportWidth(1): 6 GetAirportHeight(1): 6 GetAirportCoverageRadius(1): 5 + GetAirportNumHelipads(1): 0 IsAirportInformationAvailable(2): true IsValidAirportType(2): false GetAirportWidth(2): 1 GetAirportHeight(2): 1 GetAirportCoverageRadius(2): 4 + GetAirportNumHelipads(2): 1 IsAirportInformationAvailable(3): true IsValidAirportType(3): false GetAirportWidth(3): 6 GetAirportHeight(3): 6 GetAirportCoverageRadius(3): 6 + GetAirportNumHelipads(3): 0 IsAirportInformationAvailable(4): true IsValidAirportType(4): false GetAirportWidth(4): 7 GetAirportHeight(4): 7 GetAirportCoverageRadius(4): 8 + GetAirportNumHelipads(4): 2 IsAirportInformationAvailable(5): true IsValidAirportType(5): false GetAirportWidth(5): 5 GetAirportHeight(5): 4 GetAirportCoverageRadius(5): 4 + GetAirportNumHelipads(5): 2 IsAirportInformationAvailable(6): true IsValidAirportType(6): false GetAirportWidth(6): 2 GetAirportHeight(6): 2 GetAirportCoverageRadius(6): 4 + GetAirportNumHelipads(6): 1 IsAirportInformationAvailable(7): true IsValidAirportType(7): false GetAirportWidth(7): 9 GetAirportHeight(7): 11 GetAirportCoverageRadius(7): 10 + GetAirportNumHelipads(7): 2 IsAirportInformationAvailable(8): true IsValidAirportType(8): false GetAirportWidth(8): 4 GetAirportHeight(8): 2 GetAirportCoverageRadius(8): 4 + GetAirportNumHelipads(8): 3 IsAirportInformationAvailable(9): false IsValidAirportType(9): false GetAirportWidth(9): -1 GetAirportHeight(9): -1 GetAirportCoverageRadius(9): -1 + GetAirportNumHelipads(9): -1 GetBankBalance(): 1999999790 GetPrice(): 5400 BuildAirport(): true @@ -6082,7 +6093,7 @@ ERROR: IsEnd() is invalid as Begin() is never called GetNumEngines(): 1 GetNumEngines(): 1 GetNumEngines(): 0 - GetName(): Group 0 + GetName(): Group 1 GetName(): (null : 0x00000000) AIVehicle.SellVehicle(): true AITile.DemolishTile(): true @@ -7498,7 +7509,8 @@ ERROR: IsEnd() is invalid as Begin() is never called BuildRailDepot(): false BuildRailDepot(): false BuildRailDepot(): true - BuildRailDepot(): false + BuildRailDepot(): true + BuildRailDepot(): true GetRailDepotFrontTile(): 33412 IsBuildable(): false DepotList @@ -7591,12 +7603,13 @@ ERROR: IsEnd() is invalid as Begin() is never called BuildRoadDepot(): false BuildRoadDepot(): false BuildRoadDepot(): true - BuildRoadDepot(): false + BuildRoadDepot(): true + BuildRoadDepot(): true HasRoadType(Road): true HasRoadType(Tram): false - GetLastError(): 260 - GetLastErrorString(): ERR_AREA_NOT_CLEAR - GetErrorCategory(): 1 + GetLastError(): 0 + GetLastErrorString(): ERR_NONE + GetErrorCategory(): 0 IsRoadTile(): false GetRoadDepotFrontTile(): 33412 IsRoadDepotTile(): true @@ -7760,6 +7773,153 @@ ERROR: IsEnd() is invalid as Begin() is never called GetCargoPlannedFromVia(1000, 1000, 0, 1000): -1 GetCargoPlannedFromVia(1000, 1000, 1000, 1000): -1 +--StationList-- + GetName(): Little Frutford Valley + TileList_StationCoverage: + 34192 + 34191 + 34190 + 34189 + 34188 + 34187 + 34186 + 33936 + 33935 + 33934 + 33933 + 33932 + 33931 + 33930 + 33680 + 33679 + 33678 + 33677 + 33676 + 33675 + 33674 + 33424 + 33423 + 33422 + 33421 + 33420 + 33419 + 33418 + 33168 + 33167 + 33166 + 33165 + 33164 + 33163 + 33162 + 32912 + 32911 + 32910 + 32909 + 32908 + 32907 + 32906 + 32656 + 32655 + 32654 + 32653 + 32652 + 32651 + 32650 + GetName(): Little Frutford Woods + TileList_StationCoverage: + 34439 + 34438 + 34437 + 34436 + 34435 + 34434 + 34433 + 34432 + 34187 + 34186 + 34185 + 34184 + 34183 + 34182 + 34181 + 34180 + 34179 + 34178 + 34177 + 34176 + 33931 + 33930 + 33929 + 33928 + 33927 + 33926 + 33925 + 33924 + 33923 + 33922 + 33921 + 33920 + 33675 + 33674 + 33673 + 33672 + 33671 + 33670 + 33669 + 33668 + 33667 + 33666 + 33665 + 33664 + 33419 + 33418 + 33417 + 33416 + 33415 + 33414 + 33413 + 33412 + 33411 + 33410 + 33409 + 33408 + 33163 + 33162 + 33161 + 33160 + 33159 + 33158 + 33157 + 33156 + 33155 + 33154 + 33153 + 33152 + 32907 + 32906 + 32905 + 32904 + 32903 + 32902 + 32901 + 32900 + 32899 + 32898 + 32897 + 32896 + 32651 + 32650 + 32649 + 32648 + 32647 + 32646 + 32645 + 32644 + 32643 + 32642 + 32641 + 32640 + --Tile-- HasTreeOnTile(): false IsFarmTile(): true @@ -9320,9 +9480,9 @@ ERROR: IsEnd() is invalid as Begin() is never called GetLocation(): 33417 GetEngineType(): 153 GetUnitNumber(): 1 - GetAge(): 0 + GetAge(): 1 GetMaxAge(): 5490 - GetAgeLeft(): 5490 + GetAgeLeft(): 5489 GetCurrentSpeed(): 7 GetRunningCost(): 421 GetProfitThisYear(): 0 @@ -9335,7 +9495,7 @@ ERROR: IsEnd() is invalid as Begin() is never called IsInDepot(): false GetNumWagons(): 1 GetWagonEngineType(): 153 - GetWagonAge(): 0 + GetWagonAge(): 1 GetLength(): 8 GetOwner(): 1 BuildVehicle(): 14 @@ -9389,6 +9549,8 @@ ERROR: IsEnd() is invalid as Begin() is never called --VehicleList-- Count(): 5 + InDepot Count(): 4 + RoadVehicle Count(): 2 Location ListDump: 13 => 33417 12 => 33417 @@ -9408,11 +9570,11 @@ ERROR: IsEnd() is invalid as Begin() is never called 14 => 1 12 => 1 Age ListDump: - 17 => 1 - 16 => 1 - 14 => 1 - 13 => 1 12 => 1 + 17 => 0 + 16 => 0 + 14 => 0 + 13 => 0 MaxAge ListDump: 16 => 10980 14 => 10980 @@ -9420,10 +9582,10 @@ ERROR: IsEnd() is invalid as Begin() is never called 13 => 5490 12 => 5490 AgeLeft ListDump: - 16 => 10979 - 14 => 10979 - 17 => 7319 - 13 => 5489 + 16 => 10980 + 14 => 10980 + 17 => 7320 + 13 => 5490 12 => 5489 CurrentSpeed ListDump: 12 => 27 @@ -9442,7 +9604,7 @@ ERROR: IsEnd() is invalid as Begin() is never called 16 => 0 14 => 0 13 => 0 - 12 => -1 + 12 => 0 ProfitLastYear ListDump: 17 => 0 16 => 0 @@ -9583,4 +9745,23 @@ ERROR: IsEnd() is invalid as Begin() is never called -1 > 2147483647: false -2147483648 > 2147483647: false 13725 > -2147483648: true +--Valuate() with excessive CPU usage-- +Your script made an error: excessive CPU usage in valuator function + +*FUNCTION [unknown()] regression/main.nut line [2051] +*FUNCTION [Valuate()] NATIVE line [-1] +*FUNCTION [Start()] regression/main.nut line [2052] + +[id] 0 +[this] TABLE +[Infinite] CLOSURE +[list] INSTANCE +[this] INSTANCE +Your script made an error: excessive CPU usage in valuator function + +*FUNCTION [Start()] regression/main.nut line [2052] + +[Infinite] CLOSURE +[list] INSTANCE +[this] INSTANCE ERROR: The script died unexpectedly. diff --git a/regression/regression/test.sav b/regression/regression/test.sav index cf97052c2e..30b68c12cf 100644 Binary files a/regression/regression/test.sav and b/regression/regression/test.sav differ diff --git a/regression/stationlist/CMakeLists.txt b/regression/stationlist/CMakeLists.txt new file mode 100644 index 0000000000..cfbc2cde56 --- /dev/null +++ b/regression/stationlist/CMakeLists.txt @@ -0,0 +1,7 @@ +include(CreateRegression) +create_regression( + ${CMAKE_CURRENT_SOURCE_DIR}/info.nut + ${CMAKE_CURRENT_SOURCE_DIR}/main.nut + ${CMAKE_CURRENT_SOURCE_DIR}/result.txt + ${CMAKE_CURRENT_SOURCE_DIR}/test.sav +) diff --git a/regression/stationlist/info.nut b/regression/stationlist/info.nut index f3a1684876..a1a10466dd 100644 --- a/regression/stationlist/info.nut +++ b/regression/stationlist/info.nut @@ -4,7 +4,7 @@ class StationList extends AIInfo { function GetShortName() { return "REGS"; } function GetDescription() { return "This runs stationlist-tests on some commands. On the same map the result should always be the same."; } function GetVersion() { return 1; } - function GetAPIVersion() { return "14"; } + function GetAPIVersion() { return "15"; } function GetDate() { return "2007-03-18"; } function CreateInstance() { return "StationList"; } function UseAsRandomAI() { return false; } diff --git a/src/3rdparty/CMakeLists.txt b/src/3rdparty/CMakeLists.txt index 50fa6922f4..4d17f023a5 100644 --- a/src/3rdparty/CMakeLists.txt +++ b/src/3rdparty/CMakeLists.txt @@ -1,5 +1,9 @@ +add_subdirectory(catch2) add_subdirectory(fmt) +add_subdirectory(icu) add_subdirectory(md5) +add_subdirectory(monocypher) add_subdirectory(squirrel) +add_subdirectory(nlohmann) add_subdirectory(opengl) -add_subdirectory(os2) +add_subdirectory(openttd_social_integration_api) diff --git a/src/3rdparty/README.licensing b/src/3rdparty/README.licensing index 112b02a087..c5da7bdd15 100644 --- a/src/3rdparty/README.licensing +++ b/src/3rdparty/README.licensing @@ -1,3 +1,3 @@ The files in this directory are not licensed under the same terms as the -rest of OpenTTD. Licensing details can be found in OpenTTD's readme.txt +rest of OpenTTD. Licensing details can be found in OpenTTD's README.md and in this directory or subdirectories as well. diff --git a/src/3rdparty/catch2/CMakeLists.txt b/src/3rdparty/catch2/CMakeLists.txt new file mode 100644 index 0000000000..72e0afa732 --- /dev/null +++ b/src/3rdparty/catch2/CMakeLists.txt @@ -0,0 +1,3 @@ +add_files( + catch.hpp +) diff --git a/src/3rdparty/catch2/LICENSE.txt b/src/3rdparty/catch2/LICENSE.txt new file mode 100644 index 0000000000..36b7cd93cd --- /dev/null +++ b/src/3rdparty/catch2/LICENSE.txt @@ -0,0 +1,23 @@ +Boost Software License - Version 1.0 - August 17th, 2003 + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/src/3rdparty/catch2/catch.hpp b/src/3rdparty/catch2/catch.hpp new file mode 100644 index 0000000000..109698a5c2 --- /dev/null +++ b/src/3rdparty/catch2/catch.hpp @@ -0,0 +1,17976 @@ +/* + * Catch v2.13.10 + * Generated: 2022-10-16 11:01:23.452308 + * ---------------------------------------------------------- + * This file has been merged from multiple headers. Please don't edit it directly + * Copyright (c) 2022 Two Blue Cubes Ltd. All rights reserved. + * + * Distributed under the Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + */ +#ifndef TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED +#define TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED +// start catch.hpp + + +#define CATCH_VERSION_MAJOR 2 +#define CATCH_VERSION_MINOR 13 +#define CATCH_VERSION_PATCH 10 + +#ifdef __clang__ +# pragma clang system_header +#elif defined __GNUC__ +# pragma GCC system_header +#endif + +// start catch_suppress_warnings.h + +#ifdef __clang__ +# ifdef __ICC // icpc defines the __clang__ macro +# pragma warning(push) +# pragma warning(disable: 161 1682) +# else // __ICC +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wpadded" +# pragma clang diagnostic ignored "-Wswitch-enum" +# pragma clang diagnostic ignored "-Wcovered-switch-default" +# endif +#elif defined __GNUC__ + // Because REQUIREs trigger GCC's -Wparentheses, and because still + // supported version of g++ have only buggy support for _Pragmas, + // Wparentheses have to be suppressed globally. +# pragma GCC diagnostic ignored "-Wparentheses" // See #674 for details + +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wunused-variable" +# pragma GCC diagnostic ignored "-Wpadded" +#endif +// end catch_suppress_warnings.h +#if defined(CATCH_CONFIG_MAIN) || defined(CATCH_CONFIG_RUNNER) +# define CATCH_IMPL +# define CATCH_CONFIG_ALL_PARTS +#endif + +// In the impl file, we want to have access to all parts of the headers +// Can also be used to sanely support PCHs +#if defined(CATCH_CONFIG_ALL_PARTS) +# define CATCH_CONFIG_EXTERNAL_INTERFACES +# if defined(CATCH_CONFIG_DISABLE_MATCHERS) +# undef CATCH_CONFIG_DISABLE_MATCHERS +# endif +# if !defined(CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER) +# define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER +# endif +#endif + +#if !defined(CATCH_CONFIG_IMPL_ONLY) +// start catch_platform.h + +// See e.g.: +// https://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/TargetConditionals.h.auto.html +#ifdef __APPLE__ +# include +# if (defined(TARGET_OS_OSX) && TARGET_OS_OSX == 1) || \ + (defined(TARGET_OS_MAC) && TARGET_OS_MAC == 1) +# define CATCH_PLATFORM_MAC +# elif (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE == 1) +# define CATCH_PLATFORM_IPHONE +# endif + +#elif defined(linux) || defined(__linux) || defined(__linux__) +# define CATCH_PLATFORM_LINUX + +#elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || defined(__MINGW32__) +# define CATCH_PLATFORM_WINDOWS +#endif + +// end catch_platform.h + +#ifdef CATCH_IMPL +# ifndef CLARA_CONFIG_MAIN +# define CLARA_CONFIG_MAIN_NOT_DEFINED +# define CLARA_CONFIG_MAIN +# endif +#endif + +// start catch_user_interfaces.h + +namespace Catch { + unsigned int rngSeed(); +} + +// end catch_user_interfaces.h +// start catch_tag_alias_autoregistrar.h + +// start catch_common.h + +// start catch_compiler_capabilities.h + +// Detect a number of compiler features - by compiler +// The following features are defined: +// +// CATCH_CONFIG_COUNTER : is the __COUNTER__ macro supported? +// CATCH_CONFIG_WINDOWS_SEH : is Windows SEH supported? +// CATCH_CONFIG_POSIX_SIGNALS : are POSIX signals supported? +// CATCH_CONFIG_DISABLE_EXCEPTIONS : Are exceptions enabled? +// **************** +// Note to maintainers: if new toggles are added please document them +// in configuration.md, too +// **************** + +// In general each macro has a _NO_ form +// (e.g. CATCH_CONFIG_NO_POSIX_SIGNALS) which disables the feature. +// Many features, at point of detection, define an _INTERNAL_ macro, so they +// can be combined, en-mass, with the _NO_ forms later. + +#ifdef __cplusplus + +# if (__cplusplus >= 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L) +# define CATCH_CPP14_OR_GREATER +# endif + +# if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) +# define CATCH_CPP17_OR_GREATER +# endif + +#endif + +// Only GCC compiler should be used in this block, so other compilers trying to +// mask themselves as GCC should be ignored. +#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && !defined(__CUDACC__) && !defined(__LCC__) +# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic push" ) +# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic pop" ) + +# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__) + +#endif + +#if defined(__clang__) + +# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic push" ) +# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic pop" ) + +// As of this writing, IBM XL's implementation of __builtin_constant_p has a bug +// which results in calls to destructors being emitted for each temporary, +// without a matching initialization. In practice, this can result in something +// like `std::string::~string` being called on an uninitialized value. +// +// For example, this code will likely segfault under IBM XL: +// ``` +// REQUIRE(std::string("12") + "34" == "1234") +// ``` +// +// Therefore, `CATCH_INTERNAL_IGNORE_BUT_WARN` is not implemented. +# if !defined(__ibmxl__) && !defined(__CUDACC__) +# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__) /* NOLINT(cppcoreguidelines-pro-type-vararg, hicpp-vararg) */ +# endif + +# define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ + _Pragma( "clang diagnostic ignored \"-Wexit-time-destructors\"" ) \ + _Pragma( "clang diagnostic ignored \"-Wglobal-constructors\"") + +# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \ + _Pragma( "clang diagnostic ignored \"-Wparentheses\"" ) + +# define CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS \ + _Pragma( "clang diagnostic ignored \"-Wunused-variable\"" ) + +# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \ + _Pragma( "clang diagnostic ignored \"-Wgnu-zero-variadic-macro-arguments\"" ) + +# define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \ + _Pragma( "clang diagnostic ignored \"-Wunused-template\"" ) + +#endif // __clang__ + +//////////////////////////////////////////////////////////////////////////////// +// Assume that non-Windows platforms support posix signals by default +#if !defined(CATCH_PLATFORM_WINDOWS) + #define CATCH_INTERNAL_CONFIG_POSIX_SIGNALS +#endif + +//////////////////////////////////////////////////////////////////////////////// +// We know some environments not to support full POSIX signals +#if defined(__CYGWIN__) || defined(__QNX__) || defined(__EMSCRIPTEN__) || defined(__DJGPP__) + #define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS +#endif + +#ifdef __OS400__ +# define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS +# define CATCH_CONFIG_COLOUR_NONE +#endif + +//////////////////////////////////////////////////////////////////////////////// +// Android somehow still does not support std::to_string +#if defined(__ANDROID__) +# define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING +# define CATCH_INTERNAL_CONFIG_ANDROID_LOGWRITE +#endif + +//////////////////////////////////////////////////////////////////////////////// +// Not all Windows environments support SEH properly +#if defined(__MINGW32__) +# define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH +#endif + +//////////////////////////////////////////////////////////////////////////////// +// PS4 +#if defined(__ORBIS__) +# define CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE +#endif + +//////////////////////////////////////////////////////////////////////////////// +// Cygwin +#ifdef __CYGWIN__ + +// Required for some versions of Cygwin to declare gettimeofday +// see: http://stackoverflow.com/questions/36901803/gettimeofday-not-declared-in-this-scope-cygwin +# define _BSD_SOURCE +// some versions of cygwin (most) do not support std::to_string. Use the libstd check. +// https://gcc.gnu.org/onlinedocs/gcc-4.8.2/libstdc++/api/a01053_source.html line 2812-2813 +# if !((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99) \ + && !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF)) + +# define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING + +# endif +#endif // __CYGWIN__ + +//////////////////////////////////////////////////////////////////////////////// +// Visual C++ +#if defined(_MSC_VER) + +// Universal Windows platform does not support SEH +// Or console colours (or console at all...) +# if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP) +# define CATCH_CONFIG_COLOUR_NONE +# else +# define CATCH_INTERNAL_CONFIG_WINDOWS_SEH +# endif + +# if !defined(__clang__) // Handle Clang masquerading for msvc + +// MSVC traditional preprocessor needs some workaround for __VA_ARGS__ +// _MSVC_TRADITIONAL == 0 means new conformant preprocessor +// _MSVC_TRADITIONAL == 1 means old traditional non-conformant preprocessor +# if !defined(_MSVC_TRADITIONAL) || (defined(_MSVC_TRADITIONAL) && _MSVC_TRADITIONAL) +# define CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +# endif // MSVC_TRADITIONAL + +// Only do this if we're not using clang on Windows, which uses `diagnostic push` & `diagnostic pop` +# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION __pragma( warning(push) ) +# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION __pragma( warning(pop) ) +# endif // __clang__ + +#endif // _MSC_VER + +#if defined(_REENTRANT) || defined(_MSC_VER) +// Enable async processing, as -pthread is specified or no additional linking is required +# define CATCH_INTERNAL_CONFIG_USE_ASYNC +#endif // _MSC_VER + +//////////////////////////////////////////////////////////////////////////////// +// Check if we are compiled with -fno-exceptions or equivalent +#if defined(__EXCEPTIONS) || defined(__cpp_exceptions) || defined(_CPPUNWIND) +# define CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED +#endif + +//////////////////////////////////////////////////////////////////////////////// +// DJGPP +#ifdef __DJGPP__ +# define CATCH_INTERNAL_CONFIG_NO_WCHAR +#endif // __DJGPP__ + +//////////////////////////////////////////////////////////////////////////////// +// Embarcadero C++Build +#if defined(__BORLANDC__) + #define CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN +#endif + +//////////////////////////////////////////////////////////////////////////////// + +// Use of __COUNTER__ is suppressed during code analysis in +// CLion/AppCode 2017.2.x and former, because __COUNTER__ is not properly +// handled by it. +// Otherwise all supported compilers support COUNTER macro, +// but user still might want to turn it off +#if ( !defined(__JETBRAINS_IDE__) || __JETBRAINS_IDE__ >= 20170300L ) + #define CATCH_INTERNAL_CONFIG_COUNTER +#endif + +//////////////////////////////////////////////////////////////////////////////// + +// RTX is a special version of Windows that is real time. +// This means that it is detected as Windows, but does not provide +// the same set of capabilities as real Windows does. +#if defined(UNDER_RTSS) || defined(RTX64_BUILD) + #define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH + #define CATCH_INTERNAL_CONFIG_NO_ASYNC + #define CATCH_CONFIG_COLOUR_NONE +#endif + +#if !defined(_GLIBCXX_USE_C99_MATH_TR1) +#define CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER +#endif + +// Various stdlib support checks that require __has_include +#if defined(__has_include) + // Check if string_view is available and usable + #if __has_include() && defined(CATCH_CPP17_OR_GREATER) + # define CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW + #endif + + // Check if optional is available and usable + # if __has_include() && defined(CATCH_CPP17_OR_GREATER) + # define CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL + # endif // __has_include() && defined(CATCH_CPP17_OR_GREATER) + + // Check if byte is available and usable + # if __has_include() && defined(CATCH_CPP17_OR_GREATER) + # include + # if defined(__cpp_lib_byte) && (__cpp_lib_byte > 0) + # define CATCH_INTERNAL_CONFIG_CPP17_BYTE + # endif + # endif // __has_include() && defined(CATCH_CPP17_OR_GREATER) + + // Check if variant is available and usable + # if __has_include() && defined(CATCH_CPP17_OR_GREATER) + # if defined(__clang__) && (__clang_major__ < 8) + // work around clang bug with libstdc++ https://bugs.llvm.org/show_bug.cgi?id=31852 + // fix should be in clang 8, workaround in libstdc++ 8.2 + # include + # if defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9) + # define CATCH_CONFIG_NO_CPP17_VARIANT + # else + # define CATCH_INTERNAL_CONFIG_CPP17_VARIANT + # endif // defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9) + # else + # define CATCH_INTERNAL_CONFIG_CPP17_VARIANT + # endif // defined(__clang__) && (__clang_major__ < 8) + # endif // __has_include() && defined(CATCH_CPP17_OR_GREATER) +#endif // defined(__has_include) + +#if defined(CATCH_INTERNAL_CONFIG_COUNTER) && !defined(CATCH_CONFIG_NO_COUNTER) && !defined(CATCH_CONFIG_COUNTER) +# define CATCH_CONFIG_COUNTER +#endif +#if defined(CATCH_INTERNAL_CONFIG_WINDOWS_SEH) && !defined(CATCH_CONFIG_NO_WINDOWS_SEH) && !defined(CATCH_CONFIG_WINDOWS_SEH) && !defined(CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH) +# define CATCH_CONFIG_WINDOWS_SEH +#endif +// This is set by default, because we assume that unix compilers are posix-signal-compatible by default. +#if defined(CATCH_INTERNAL_CONFIG_POSIX_SIGNALS) && !defined(CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_POSIX_SIGNALS) +# define CATCH_CONFIG_POSIX_SIGNALS +#endif +// This is set by default, because we assume that compilers with no wchar_t support are just rare exceptions. +#if !defined(CATCH_INTERNAL_CONFIG_NO_WCHAR) && !defined(CATCH_CONFIG_NO_WCHAR) && !defined(CATCH_CONFIG_WCHAR) +# define CATCH_CONFIG_WCHAR +#endif + +#if !defined(CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_CPP11_TO_STRING) +# define CATCH_CONFIG_CPP11_TO_STRING +#endif + +#if defined(CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_NO_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_CPP17_OPTIONAL) +# define CATCH_CONFIG_CPP17_OPTIONAL +#endif + +#if defined(CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_NO_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_CPP17_STRING_VIEW) +# define CATCH_CONFIG_CPP17_STRING_VIEW +#endif + +#if defined(CATCH_INTERNAL_CONFIG_CPP17_VARIANT) && !defined(CATCH_CONFIG_NO_CPP17_VARIANT) && !defined(CATCH_CONFIG_CPP17_VARIANT) +# define CATCH_CONFIG_CPP17_VARIANT +#endif + +#if defined(CATCH_INTERNAL_CONFIG_CPP17_BYTE) && !defined(CATCH_CONFIG_NO_CPP17_BYTE) && !defined(CATCH_CONFIG_CPP17_BYTE) +# define CATCH_CONFIG_CPP17_BYTE +#endif + +#if defined(CATCH_CONFIG_EXPERIMENTAL_REDIRECT) +# define CATCH_INTERNAL_CONFIG_NEW_CAPTURE +#endif + +#if defined(CATCH_INTERNAL_CONFIG_NEW_CAPTURE) && !defined(CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE) && !defined(CATCH_CONFIG_NO_NEW_CAPTURE) && !defined(CATCH_CONFIG_NEW_CAPTURE) +# define CATCH_CONFIG_NEW_CAPTURE +#endif + +#if !defined(CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED) && !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) +# define CATCH_CONFIG_DISABLE_EXCEPTIONS +#endif + +#if defined(CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_NO_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_POLYFILL_ISNAN) +# define CATCH_CONFIG_POLYFILL_ISNAN +#endif + +#if defined(CATCH_INTERNAL_CONFIG_USE_ASYNC) && !defined(CATCH_INTERNAL_CONFIG_NO_ASYNC) && !defined(CATCH_CONFIG_NO_USE_ASYNC) && !defined(CATCH_CONFIG_USE_ASYNC) +# define CATCH_CONFIG_USE_ASYNC +#endif + +#if defined(CATCH_INTERNAL_CONFIG_ANDROID_LOGWRITE) && !defined(CATCH_CONFIG_NO_ANDROID_LOGWRITE) && !defined(CATCH_CONFIG_ANDROID_LOGWRITE) +# define CATCH_CONFIG_ANDROID_LOGWRITE +#endif + +#if defined(CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER) && !defined(CATCH_CONFIG_NO_GLOBAL_NEXTAFTER) && !defined(CATCH_CONFIG_GLOBAL_NEXTAFTER) +# define CATCH_CONFIG_GLOBAL_NEXTAFTER +#endif + +// Even if we do not think the compiler has that warning, we still have +// to provide a macro that can be used by the code. +#if !defined(CATCH_INTERNAL_START_WARNINGS_SUPPRESSION) +# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION +#endif +#if !defined(CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION) +# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION +#endif +#if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS) +# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS +#endif +#if !defined(CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS) +# define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS +#endif +#if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS) +# define CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS +#endif +#if !defined(CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS) +# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS +#endif + +// The goal of this macro is to avoid evaluation of the arguments, but +// still have the compiler warn on problems inside... +#if !defined(CATCH_INTERNAL_IGNORE_BUT_WARN) +# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) +#endif + +#if defined(__APPLE__) && defined(__apple_build_version__) && (__clang_major__ < 10) +# undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS +#elif defined(__clang__) && (__clang_major__ < 5) +# undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS +#endif + +#if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS) +# define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS +#endif + +#if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) +#define CATCH_TRY if ((true)) +#define CATCH_CATCH_ALL if ((false)) +#define CATCH_CATCH_ANON(type) if ((false)) +#else +#define CATCH_TRY try +#define CATCH_CATCH_ALL catch (...) +#define CATCH_CATCH_ANON(type) catch (type) +#endif + +#if defined(CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_NO_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR) +#define CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#endif + +// end catch_compiler_capabilities.h +#define INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) name##line +#define INTERNAL_CATCH_UNIQUE_NAME_LINE( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) +#ifdef CATCH_CONFIG_COUNTER +# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __COUNTER__ ) +#else +# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ ) +#endif + +#include +#include +#include + +// We need a dummy global operator<< so we can bring it into Catch namespace later +struct Catch_global_namespace_dummy {}; +std::ostream& operator<<(std::ostream&, Catch_global_namespace_dummy); + +namespace Catch { + + struct CaseSensitive { enum Choice { + Yes, + No + }; }; + + class NonCopyable { + NonCopyable( NonCopyable const& ) = delete; + NonCopyable( NonCopyable && ) = delete; + NonCopyable& operator = ( NonCopyable const& ) = delete; + NonCopyable& operator = ( NonCopyable && ) = delete; + + protected: + NonCopyable(); + virtual ~NonCopyable(); + }; + + struct SourceLineInfo { + + SourceLineInfo() = delete; + SourceLineInfo( char const* _file, std::size_t _line ) noexcept + : file( _file ), + line( _line ) + {} + + SourceLineInfo( SourceLineInfo const& other ) = default; + SourceLineInfo& operator = ( SourceLineInfo const& ) = default; + SourceLineInfo( SourceLineInfo&& ) noexcept = default; + SourceLineInfo& operator = ( SourceLineInfo&& ) noexcept = default; + + bool empty() const noexcept { return file[0] == '\0'; } + bool operator == ( SourceLineInfo const& other ) const noexcept; + bool operator < ( SourceLineInfo const& other ) const noexcept; + + char const* file; + std::size_t line; + }; + + std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info ); + + // Bring in operator<< from global namespace into Catch namespace + // This is necessary because the overload of operator<< above makes + // lookup stop at namespace Catch + using ::operator<<; + + // Use this in variadic streaming macros to allow + // >> +StreamEndStop + // as well as + // >> stuff +StreamEndStop + struct StreamEndStop { + std::string operator+() const; + }; + template + T const& operator + ( T const& value, StreamEndStop ) { + return value; + } +} + +#define CATCH_INTERNAL_LINEINFO \ + ::Catch::SourceLineInfo( __FILE__, static_cast( __LINE__ ) ) + +// end catch_common.h +namespace Catch { + + struct RegistrarForTagAliases { + RegistrarForTagAliases( char const* alias, char const* tag, SourceLineInfo const& lineInfo ); + }; + +} // end namespace Catch + +#define CATCH_REGISTER_TAG_ALIAS( alias, spec ) \ + CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ + CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ + namespace{ Catch::RegistrarForTagAliases INTERNAL_CATCH_UNIQUE_NAME( AutoRegisterTagAlias )( alias, spec, CATCH_INTERNAL_LINEINFO ); } \ + CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION + +// end catch_tag_alias_autoregistrar.h +// start catch_test_registry.h + +// start catch_interfaces_testcase.h + +#include + +namespace Catch { + + class TestSpec; + + struct ITestInvoker { + virtual void invoke () const = 0; + virtual ~ITestInvoker(); + }; + + class TestCase; + struct IConfig; + + struct ITestCaseRegistry { + virtual ~ITestCaseRegistry(); + virtual std::vector const& getAllTests() const = 0; + virtual std::vector const& getAllTestsSorted( IConfig const& config ) const = 0; + }; + + bool isThrowSafe( TestCase const& testCase, IConfig const& config ); + bool matchTest( TestCase const& testCase, TestSpec const& testSpec, IConfig const& config ); + std::vector filterTests( std::vector const& testCases, TestSpec const& testSpec, IConfig const& config ); + std::vector const& getAllTestCasesSorted( IConfig const& config ); + +} + +// end catch_interfaces_testcase.h +// start catch_stringref.h + +#include +#include +#include +#include + +namespace Catch { + + /// A non-owning string class (similar to the forthcoming std::string_view) + /// Note that, because a StringRef may be a substring of another string, + /// it may not be null terminated. + class StringRef { + public: + using size_type = std::size_t; + using const_iterator = const char*; + + private: + static constexpr char const* const s_empty = ""; + + char const* m_start = s_empty; + size_type m_size = 0; + + public: // construction + constexpr StringRef() noexcept = default; + + StringRef( char const* rawChars ) noexcept; + + constexpr StringRef( char const* rawChars, size_type size ) noexcept + : m_start( rawChars ), + m_size( size ) + {} + + StringRef( std::string const& stdString ) noexcept + : m_start( stdString.c_str() ), + m_size( stdString.size() ) + {} + + explicit operator std::string() const { + return std::string(m_start, m_size); + } + + public: // operators + auto operator == ( StringRef const& other ) const noexcept -> bool; + auto operator != (StringRef const& other) const noexcept -> bool { + return !(*this == other); + } + + auto operator[] ( size_type index ) const noexcept -> char { + assert(index < m_size); + return m_start[index]; + } + + public: // named queries + constexpr auto empty() const noexcept -> bool { + return m_size == 0; + } + constexpr auto size() const noexcept -> size_type { + return m_size; + } + + // Returns the current start pointer. If the StringRef is not + // null-terminated, throws std::domain_exception + auto c_str() const -> char const*; + + public: // substrings and searches + // Returns a substring of [start, start + length). + // If start + length > size(), then the substring is [start, size()). + // If start > size(), then the substring is empty. + auto substr( size_type start, size_type length ) const noexcept -> StringRef; + + // Returns the current start pointer. May not be null-terminated. + auto data() const noexcept -> char const*; + + constexpr auto isNullTerminated() const noexcept -> bool { + return m_start[m_size] == '\0'; + } + + public: // iterators + constexpr const_iterator begin() const { return m_start; } + constexpr const_iterator end() const { return m_start + m_size; } + }; + + auto operator += ( std::string& lhs, StringRef const& sr ) -> std::string&; + auto operator << ( std::ostream& os, StringRef const& sr ) -> std::ostream&; + + constexpr auto operator "" _sr( char const* rawChars, std::size_t size ) noexcept -> StringRef { + return StringRef( rawChars, size ); + } +} // namespace Catch + +constexpr auto operator "" _catch_sr( char const* rawChars, std::size_t size ) noexcept -> Catch::StringRef { + return Catch::StringRef( rawChars, size ); +} + +// end catch_stringref.h +// start catch_preprocessor.hpp + + +#define CATCH_RECURSION_LEVEL0(...) __VA_ARGS__ +#define CATCH_RECURSION_LEVEL1(...) CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL2(...) CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL3(...) CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL4(...) CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL5(...) CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(__VA_ARGS__))) + +#ifdef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#define INTERNAL_CATCH_EXPAND_VARGS(...) __VA_ARGS__ +// MSVC needs more evaluations +#define CATCH_RECURSION_LEVEL6(...) CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(__VA_ARGS__))) +#define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL6(CATCH_RECURSION_LEVEL6(__VA_ARGS__)) +#else +#define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL5(__VA_ARGS__) +#endif + +#define CATCH_REC_END(...) +#define CATCH_REC_OUT + +#define CATCH_EMPTY() +#define CATCH_DEFER(id) id CATCH_EMPTY() + +#define CATCH_REC_GET_END2() 0, CATCH_REC_END +#define CATCH_REC_GET_END1(...) CATCH_REC_GET_END2 +#define CATCH_REC_GET_END(...) CATCH_REC_GET_END1 +#define CATCH_REC_NEXT0(test, next, ...) next CATCH_REC_OUT +#define CATCH_REC_NEXT1(test, next) CATCH_DEFER ( CATCH_REC_NEXT0 ) ( test, next, 0) +#define CATCH_REC_NEXT(test, next) CATCH_REC_NEXT1(CATCH_REC_GET_END test, next) + +#define CATCH_REC_LIST0(f, x, peek, ...) , f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1) ) ( f, peek, __VA_ARGS__ ) +#define CATCH_REC_LIST1(f, x, peek, ...) , f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST0) ) ( f, peek, __VA_ARGS__ ) +#define CATCH_REC_LIST2(f, x, peek, ...) f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1) ) ( f, peek, __VA_ARGS__ ) + +#define CATCH_REC_LIST0_UD(f, userdata, x, peek, ...) , f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1_UD) ) ( f, userdata, peek, __VA_ARGS__ ) +#define CATCH_REC_LIST1_UD(f, userdata, x, peek, ...) , f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST0_UD) ) ( f, userdata, peek, __VA_ARGS__ ) +#define CATCH_REC_LIST2_UD(f, userdata, x, peek, ...) f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1_UD) ) ( f, userdata, peek, __VA_ARGS__ ) + +// Applies the function macro `f` to each of the remaining parameters, inserts commas between the results, +// and passes userdata as the first parameter to each invocation, +// e.g. CATCH_REC_LIST_UD(f, x, a, b, c) evaluates to f(x, a), f(x, b), f(x, c) +#define CATCH_REC_LIST_UD(f, userdata, ...) CATCH_RECURSE(CATCH_REC_LIST2_UD(f, userdata, __VA_ARGS__, ()()(), ()()(), ()()(), 0)) + +#define CATCH_REC_LIST(f, ...) CATCH_RECURSE(CATCH_REC_LIST2(f, __VA_ARGS__, ()()(), ()()(), ()()(), 0)) + +#define INTERNAL_CATCH_EXPAND1(param) INTERNAL_CATCH_EXPAND2(param) +#define INTERNAL_CATCH_EXPAND2(...) INTERNAL_CATCH_NO## __VA_ARGS__ +#define INTERNAL_CATCH_DEF(...) INTERNAL_CATCH_DEF __VA_ARGS__ +#define INTERNAL_CATCH_NOINTERNAL_CATCH_DEF +#define INTERNAL_CATCH_STRINGIZE(...) INTERNAL_CATCH_STRINGIZE2(__VA_ARGS__) +#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#define INTERNAL_CATCH_STRINGIZE2(...) #__VA_ARGS__ +#define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param)) +#else +// MSVC is adding extra space and needs another indirection to expand INTERNAL_CATCH_NOINTERNAL_CATCH_DEF +#define INTERNAL_CATCH_STRINGIZE2(...) INTERNAL_CATCH_STRINGIZE3(__VA_ARGS__) +#define INTERNAL_CATCH_STRINGIZE3(...) #__VA_ARGS__ +#define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) (INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param)) + 1) +#endif + +#define INTERNAL_CATCH_MAKE_NAMESPACE2(...) ns_##__VA_ARGS__ +#define INTERNAL_CATCH_MAKE_NAMESPACE(name) INTERNAL_CATCH_MAKE_NAMESPACE2(name) + +#define INTERNAL_CATCH_REMOVE_PARENS(...) INTERNAL_CATCH_EXPAND1(INTERNAL_CATCH_DEF __VA_ARGS__) + +#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#define INTERNAL_CATCH_MAKE_TYPE_LIST2(...) decltype(get_wrapper()) +#define INTERNAL_CATCH_MAKE_TYPE_LIST(...) INTERNAL_CATCH_MAKE_TYPE_LIST2(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__)) +#else +#define INTERNAL_CATCH_MAKE_TYPE_LIST2(...) INTERNAL_CATCH_EXPAND_VARGS(decltype(get_wrapper())) +#define INTERNAL_CATCH_MAKE_TYPE_LIST(...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_MAKE_TYPE_LIST2(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__))) +#endif + +#define INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(...)\ + CATCH_REC_LIST(INTERNAL_CATCH_MAKE_TYPE_LIST,__VA_ARGS__) + +#define INTERNAL_CATCH_REMOVE_PARENS_1_ARG(_0) INTERNAL_CATCH_REMOVE_PARENS(_0) +#define INTERNAL_CATCH_REMOVE_PARENS_2_ARG(_0, _1) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_1_ARG(_1) +#define INTERNAL_CATCH_REMOVE_PARENS_3_ARG(_0, _1, _2) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_2_ARG(_1, _2) +#define INTERNAL_CATCH_REMOVE_PARENS_4_ARG(_0, _1, _2, _3) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_3_ARG(_1, _2, _3) +#define INTERNAL_CATCH_REMOVE_PARENS_5_ARG(_0, _1, _2, _3, _4) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_4_ARG(_1, _2, _3, _4) +#define INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_0, _1, _2, _3, _4, _5) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_5_ARG(_1, _2, _3, _4, _5) +#define INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_0, _1, _2, _3, _4, _5, _6) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_1, _2, _3, _4, _5, _6) +#define INTERNAL_CATCH_REMOVE_PARENS_8_ARG(_0, _1, _2, _3, _4, _5, _6, _7) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_1, _2, _3, _4, _5, _6, _7) +#define INTERNAL_CATCH_REMOVE_PARENS_9_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_8_ARG(_1, _2, _3, _4, _5, _6, _7, _8) +#define INTERNAL_CATCH_REMOVE_PARENS_10_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_9_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9) +#define INTERNAL_CATCH_REMOVE_PARENS_11_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_10_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10) + +#define INTERNAL_CATCH_VA_NARGS_IMPL(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...) N + +#define INTERNAL_CATCH_TYPE_GEN\ + template struct TypeList {};\ + template\ + constexpr auto get_wrapper() noexcept -> TypeList { return {}; }\ + template class...> struct TemplateTypeList{};\ + template class...Cs>\ + constexpr auto get_wrapper() noexcept -> TemplateTypeList { return {}; }\ + template\ + struct append;\ + template\ + struct rewrap;\ + template class, typename...>\ + struct create;\ + template class, typename>\ + struct convert;\ + \ + template \ + struct append { using type = T; };\ + template< template class L1, typename...E1, template class L2, typename...E2, typename...Rest>\ + struct append, L2, Rest...> { using type = typename append, Rest...>::type; };\ + template< template class L1, typename...E1, typename...Rest>\ + struct append, TypeList, Rest...> { using type = L1; };\ + \ + template< template class Container, template class List, typename...elems>\ + struct rewrap, List> { using type = TypeList>; };\ + template< template class Container, template class List, class...Elems, typename...Elements>\ + struct rewrap, List, Elements...> { using type = typename append>, typename rewrap, Elements...>::type>::type; };\ + \ + template