function hexString = getIntegerMax(numBits, isSigned, typeString)
% check xml generated for code coverage annotations

% Copyright 2015 The MathWorks, Inc.
assert(mod(numBits, 8) == 0, 'numBits must be multiple of 8.');
numBytes = numBits / 8; 
if isSigned
   hexString = ['0x7F', repmat('FF', 1, numBytes - 1)];
else
   hexString = ['0x' repmat('FF', 1, numBytes)];  
end
if ~isSigned
  hexString = [hexString 'U'];
end

typeValAssigned = false;

switch typeString
    case 'long'
        typeVal = 'L';
        typeValAssigned = true;
    case 'long long'
        typeVal = 'LL';
        typeValAssigned = true;
    case {'char', 'short', 'int'}
        typeVal = '';
        typeValAssigned = true;
end

assert(typeValAssigned, 'Invalid typeString = %s', typeString);      

hexString = [hexString typeVal];
