-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #602 from CBATeam/fix-getPos
fix CBA_fnc_getPos
- Loading branch information
Showing
3 changed files
with
66 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#include "script_component.hpp" | ||
SCRIPT(test_position); | ||
|
||
// execVM "\x\cba\addons\common\test_position.sqf"; | ||
|
||
private ["_funcName", "_value", "_result"]; | ||
|
||
_funcName = "CBA_fnc_getPos"; | ||
LOG("Testing " + _funcName); | ||
|
||
TEST_DEFINED(_funcName,""); | ||
|
||
_value = objNull; | ||
_result = _value call CBA_fnc_getPos; | ||
|
||
#define EXPECTED [0,0,0] | ||
TEST_TRUE(_result isEqualTo EXPECTED,_funcName); | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
_value = grpNull; | ||
_result = _value call CBA_fnc_getPos; | ||
|
||
TEST_TRUE(_result isEqualTo EXPECTED,_funcName); | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
_value = ""; // marker | ||
_result = _value call CBA_fnc_getPos; | ||
|
||
TEST_TRUE(_result isEqualTo EXPECTED,_funcName); | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
_value = locationNull; | ||
_result = _value call CBA_fnc_getPos; | ||
|
||
TEST_TRUE(_result isEqualTo EXPECTED,_funcName); | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
#define EXPECTED [1,2,0] // Pos 3D | ||
|
||
_value = EXPECTED; | ||
_result = _value call CBA_fnc_getPos; | ||
|
||
// confirm that input array is copied | ||
_value set [0,-1]; | ||
|
||
TEST_TRUE(_result isEqualTo EXPECTED,_funcName); | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
#define EXPECTED [1,2] // Pos 2D | ||
|
||
_value = EXPECTED; | ||
_result = _value call CBA_fnc_getPos; | ||
|
||
// confirm that input array is copied | ||
_value set [0,-1]; | ||
|
||
TEST_TRUE(_result isEqualTo EXPECTED,_funcName); | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////////////////// |