mirror of
https://github.com/kerberos-io/onvif.git
synced 2026-08-23 15:08:33 +00:00
Propagate HTTP 4xx/5xx errors from SOAP and digest requests, preserve responses, and ensure PTZ zero coordinates are serialized. Add regression tests for both behaviors.
26 lines
540 B
Go
26 lines
540 B
Go
package ptz
|
|
|
|
import (
|
|
"encoding/xml"
|
|
"strings"
|
|
"testing"
|
|
|
|
"github.com/kerberos-io/onvif/xsd/onvif"
|
|
)
|
|
|
|
func TestContinuousMoveIncludesZeroPanTiltCoordinates(t *testing.T) {
|
|
request := ContinuousMove{
|
|
Velocity: onvif.PTZSpeedPanTilt{
|
|
PanTilt: onvif.Vector2D{X: 0.5, Y: 0},
|
|
},
|
|
}
|
|
|
|
encoded, err := xml.Marshal(request)
|
|
if err != nil {
|
|
t.Fatalf("xml.Marshal() error = %v", err)
|
|
}
|
|
if !strings.Contains(string(encoded), `x="0.5" y="0"`) {
|
|
t.Fatalf("ContinuousMove PanTilt = %s, want explicit x and y attributes", encoded)
|
|
}
|
|
}
|