Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cisco/senml does not pass unit tests #25

Open
x448 opened this issue Dec 12, 2019 · 0 comments
Open

cisco/senml does not pass unit tests #25

x448 opened this issue Dec 12, 2019 · 0 comments

Comments

@x448
Copy link

x448 commented Dec 12, 2019

Here are the results with cisco/senml commit d5a3c66 (Dec 11, 2019.)

The two PR mentioned in issue #24 resolves this issue.

go version go1.13.5 linux/amd64

$ go get github.com/cisco/senml
$ cd cisco/senml/
$ go test
Test Encode 0 got: [{"bn":"dev123","bt":-45.67,"bu":"degC","bver":5,"n":"temp","u":"degC","t":-1,"ut":10,"v":22.1,"s":0},{"n":"room","t":-1,"vs":"kitchen"},{"n":"data","vd":"abc"},{"n":"ok","vb":true}]
Test Encode 1 got: [132 170 33 102 100 101 118 49 50 51 34 251 192 70 213 194 143 92 40 246 2 251 64 54 25 153 153 153 153 154 1 100 100 101 103 67 32 5 35 100 100 101 103 67 0 100 116 101 109 112 6 251 191 240 0 0 0 0 0 0 7 251 64 36 0 0 0 0 0 0 5 251 0 0 0 0 0 0 0 0 163 0 100 114 111 111 109 6 251 191 240 0 0 0 0 0 0 3 103 107 105 116 99 104 101 110 162 0 100 100 97 116 97 8 99 97 98 99 162 4 245 0 98 111 107]
Test Encode 2 got: <sensml xmlns="urn:ietf:params:xml:ns:senml"><senml bn="dev123" bt="-45.67" bu="degC" bver="5" n="temp" u="degC" t="-1" ut="10" v="22.1" s="0"></senml><senml n="room" t="-1" vs="kitchen"></senml><senml n="data" vd="abc"></senml><senml n="ok" vb="true"></senml></sensml>
Test Encode 3 got: temp,25568.999988,22.100000,degC

Test Encode 4 got: [148 138 162 98 110 166 100 101 118 49 50 51 162 98 116 203 192 70 213 194 143 92 40 246 162 98 117 164 100 101 103 67 164 98 118 101 114 5 161 110 164 116 101 109 112 161 115 203 0 0 0 0 0 0 0 0 161 116 203 191 240 0 0 0 0 0 0 161 117 164 100 101 103 67 162 117 116 203 64 36 0 0 0 0 0 0 161 118 203 64 54 25 153 153 153 153 154 131 161 110 164 114 111 111 109 161 116 203 191 240 0 0 0 0 0 0 162 118 115 167 107 105 116 99 104 101 110 130 161 110 164 100 97 116 97 162 118 100 163 97 98 99 130 161 110 162 111 107 162 118 98 195]
Test Encode 5 got: fluffySenml,n=temp,u=degC v=22.1,s=0 -1000000000

--- FAIL: TestEncode (0.00s)
    senml_test.go:94: Failed Encode for format 1 got: hKohZmRldjEyMyL7wEbVwo9cKPYC+0A2GZmZmZmaAWRkZWdDIAUjZGRlZ0MAZHRlbXAG+7/wAAAAAAAAB/tAJAAAAAAAAAX7AAAAAAAAAACjAGRyb29tBvu/8AAAAAAAAANna2l0Y2hlbqIAZGRhdGEIY2FiY6IE9QBib2s=
    senml_test.go:94: Failed Encode for format 4 got: lIqiYm6mZGV2MTIzomJ0y8BG1cKPXCj2omJ1pGRlZ0OkYnZlcgWhbqR0ZW1woXPLAAAAAAAAAAChdMu/8AAAAAAAAKF1pGRlZ0OidXTLQCQAAAAAAAChdstANhmZmZmZmoOhbqRyb29toXTLv/AAAAAAAACidnOna2l0Y2hlboKhbqRkYXRhonZko2FiY4KhbqJva6J2YsM=
Doing TestDecode for vector 0
Test Decode 0 got: [
  {"bn":"dev123","bt":-45.67,"bu":"degC","bver":5,"n":"temp","u":"degC","t":-1,"ut":10,"v":22.1,"s":0},
  {"n":"room","t":-1,"vs":"kitchen"},
  {"n":"data","vd":"abc"},
  {"n":"ok","vb":true}
]

Doing TestDecode for vector 1
Test Decode 1 got: [
  
]

Doing TestDecode for vector 2
Test Decode 2 got: [
  {"bn":"dev123","bt":-45.67,"bu":"degC","bver":5,"n":"temp","u":"degC","t":-1,"ut":10,"v":22.1,"s":0},
  {"n":"room","t":-1,"vs":"kitchen"},
  {"n":"data","vd":"abc"},
  {"n":"ok","vb":true}
]

Doing TestDecode for vector 3
Doing TestDecode for vector 4
Test Decode 4 got: [
  {"bn":"dev123","bt":-45.67,"bu":"degC","bver":5,"n":"temp","u":"degC","t":-1,"ut":10,"v":22.1,"s":0},
  {"n":"room","t":-1,"vs":"kitchen"},
  {"n":"data","vd":"abc"},
  {"n":"ok","vb":true}
]

Doing TestDecode for vector 5
--- FAIL: TestDecode (0.00s)
Test Normalize got: [
  {"bver":5,"n":"dev123/temp","u":"degC","t":897844.67,"ut":10,"v":22.1,"s":0},
  {"bver":5,"n":"dev123/room","u":"degC","t":897844.67,"vs":"kitchen"},
  {"bver":5,"n":"dev123/data","u":"degC","t":897845.67,"vd":"abc"},
  {"bver":5,"n":"dev123/ok","u":"degC","t":897845.67,"vb":true}
]

FAIL
exit status 1
FAIL	github.com/cisco/senml	0.007s

x448 added a commit to x448/senml that referenced this issue Dec 12, 2019
This project passes all unit tests and adds an extra unit test using CBOR example data from SenML RFC 8428.  Bump version of cisco/senml in README.md to Dec 11, 2019 commit.   See:
* cisco/senml#24
* cisco/senml#25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant