From fc0ea376e51337f5ca02f902e1677871a8d5edae Mon Sep 17 00:00:00 2001 From: Brett Mayson Date: Sat, 19 Oct 2024 01:40:47 +0000 Subject: [PATCH] restore test --- addons/diagnostic/test_parameters.inc.sqf | 40 +++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 addons/diagnostic/test_parameters.inc.sqf diff --git a/addons/diagnostic/test_parameters.inc.sqf b/addons/diagnostic/test_parameters.inc.sqf new file mode 100644 index 000000000..bbd127181 --- /dev/null +++ b/addons/diagnostic/test_parameters.inc.sqf @@ -0,0 +1,40 @@ +// ---------------------------------------------------------------------------- + +#include "script_component.hpp" + +SCRIPT(test_parameters); + +// ---------------------------------------------------------------------------- + +LOG("Testing parameters"); + +private ["_expected", "_result", "_this"]; + +// Test default params. +_this = [5]; +DEFAULT_PARAM(0,_result,12); +_expected = 5; +TEST_OP(_result,==,_expected,"DEFAULT_PARAM"); + +_result = nil; + +_this = []; +DEFAULT_PARAM(0,_result,12); +_expected = 12; +TEST_OP(_result,==,_expected,"DEFAULT_PARAM"); + +_result = nil; + +_this = [nil]; +DEFAULT_PARAM(0,_result,12); +_expected = 12; +TEST_OP(_result,==,_expected,"DEFAULT_PARAM"); + +_result = nil; + +_this = nil; +DEFAULT_PARAM(0,_result,12); +_expected = 12; +TEST_OP(_result,==,_expected,"DEFAULT_PARAM"); + +nil;