Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • T titan.EclipsePlug-ins
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 102
    • Issues 102
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Eclipse ProjectsEclipse Projects
  • Eclipse Titan
  • titan.EclipsePlug-ins
  • Issues
  • #421
Closed
Open
Issue created Jun 21, 2021 by Adam Knapp@aknappqwtMaintainer

RAW decoding error, hexstring, HEXORDER (high), FIELDORDER(msb)

Copy of titan.core#555 (closed)

Summary

The RAW encoder fails to correctly decode the last digit of hexstring if

  • the hexstring is odd number length and length > 2
  • and variant "HEXORDER (high)"
  • and variant "FIELDORDER(msb)"

Steps and/or TTCN-3 code to reproduce

module proba{
type record MyRec{
  MCC       mcc,
  bitstring bs length(4)
} with {
  variant "FIELDORDER(msb)"
}

type hexstring MCC
with {
variant "FIELDLENGTH (3)";
variant "FIELDORDER(msb)"
variant "HEXORDER (high)";
}

type component CT{}

template MyRec t_hex:={
  mcc:='042'H,
  bs:='0000'B
}

testcase TChex() runs on CT {
  var bitstring bdata:='0000010000100000'B
  
  var MyRec res
  var integer i:=decvalue(bdata,res)
  log(i)
  if(i!=0){
    setverdict(fail, "decvalue failed")
  } else {
    log(res)
    if(match(res,t_hex)){
      setverdict(pass)
    } else {
      setverdict(fail, "unmatched value")
    }
  }
    
  
}


control {
  execute(TChex())
}
 
} with { encode "RAW" }

What is the current bug behavior?

{ mcc := '040'H, bs := '0000'B }

What is the expected correct behavior?

{ mcc := '042'H, bs := '0000'B }

Titan version

up to 8.0.0

/cc @aknappqwt

Edited Nov 03, 2021 by Adam Knapp
Assignee
Assign to
Time tracking

Copyright © Eclipse Foundation, Inc. All Rights Reserved.     Privacy Policy | Terms of Use | Copyright Agent