sccp: Merge SCCPAddress>>#createForSSN: from norbert, create a test
This commit is contained in:
parent
a1b4166cb7
commit
00826da5db
9
Tests.st
9
Tests.st
|
@ -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 |
|
||||
|
||||
|
|
|
@ -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'>
|
||||
|
|
Reference in New Issue