1
0
Fork 0

sccp: Merge SCCPAddress>>#createForSSN: from norbert, create a test

This commit is contained in:
Holger Hans Peter Freyther 2013-07-16 08:13:51 +02:00
parent a1b4166cb7
commit 00826da5db
2 changed files with 15 additions and 4 deletions

View File

@ -25,6 +25,15 @@ TestCase subclass: SCCPTests [
^ #('OsmoNetwork')
]
testCreateForSSN [
| addr |
addr := SCCPAddress createForSSN: 'hlr'.
self assert: addr subSystemNumber = SCCPAddress ssnHLR.
self assert: addr routedOnSSN.
self assert: addr globalTitle isNil.
self assert: addr pointCode isNil.
]
testPNCCreate [
| pnc |

View File

@ -41,10 +41,7 @@ Object subclass: SCCPAddress [
SCCPAddress class >> createWith: ssn [
<category: 'creation'>
^ (SCCPAddress new)
ssn: ssn;
routedOnSSN: true;
yourself
^self createWith: ssn pointCode: nil
]
SCCPAddress class >> createWith: ssn poi: aPointCode [
@ -62,6 +59,11 @@ Object subclass: SCCPAddress [
yourself
]
SCCPAddress class >> createForSSN: aSymbol [
<category: 'creation'>
^ self createWith: (self perform: ('ssn', aSymbol asUppercase) asSymbol)
]
SCCPAddress class >> parseFrom: aByteArray [
| routed_ssn gti_ind gti len ai ssn pointCode dat |
<category: 'parsing'>