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