platform01.gms : Test platform function

Description

This test ensures that the function "platformCode" and the system attribute
"platform" are in sync and that compile time constants %platformCode.XXX%
work as expected.

Contributor: Lutz Westermann, April 2021


Small Model of Type : GAMS


Category : GAMS Test library


Main file : platform01.gms

$title Test platformCode function (PLATFORM01,SEQ=861)

$onText
This test ensures that the function "platformCode" and the system attribute
"platform" are in sync and that compile time constants %platformCode.XXX%
work as expected.

Contributor: Lutz Westermann, April 2021
$offText


$eval myPf platformCode

$ifThenI %system.platform%==DEX
$ife %myPf%<>%platformCode.DEX% $abort PlatformCode should be %platformCode.DEX%
$elseIfI %system.platform%==LEX
$ife %myPf%<>%platformCode.LEX% $abort PlatformCode should be %platformCode.LEX%
$elseIfI %system.platform%==WEX
$ife %myPf%<>%platformCode.WEX% $abort PlatformCode should be %platformCode.WEX%
$elseIfI %system.platform%==DAX
$ife %myPf%<>%platformCode.DAX% $abort PlatformCode should be %platformCode.DAX%
$else
$abort Unknown PlatformCode %myPf%
$endIf

scalar myPFData /[platformCode] /;

$ifThenI %system.platform%==DEX
$ife myPFData<>%platformCode.DEX% $abort PlatformCode should be %platformCode.DEX%
$elseIfI %system.platform%==LEX
$ife myPFData<>%platformCode.LEX% $abort PlatformCode should be %platformCode.LEX%
$elseIfI %system.platform%==WEX
$ife myPFData<>%platformCode.WEX% $abort PlatformCode should be %platformCode.WEX%
$elseIfI %system.platform%==DAX
$ife myPFData<>%platformCode.DAX% $abort PlatformCode should be %platformCode.DAC%
$else
$abort Unknown PlatformCode
$endIf

scalar myPFExec;

myPFExec = platformCode;

$ifThenI %system.platform%==DEX
abort$(myPFExec<>%platformCode.DEX%) 'PlatformCode should be %platformCode.DEX%';
$elseIfI %system.platform%==LEX
abort$(myPFExec<>%platformCode.LEX%) 'PlatformCode should be %platformCode.LEX%';
$elseIfI %system.platform%==WEX
abort$(myPFExec<>%platformCode.WEX%) 'PlatformCode should be %platformCode.WEX%';
$elseIfI %system.platform%==DAX
abort$(myPFExec<>%platformCode.DAX%) 'PlatformCode should be %platformCode.DAX%';
$else
abort 'Unknown PlatformCode', myPFExec;
$endIf