Skip to content

Receiving of osc bundles is broken #53

@depili

Description

@depili

Adding the following test-case

func TestReadBundle(t *testing.T) {
	b := NewBundle(time.Now())
	b.Append(NewMessage("/a", "test"))
	b.Append(NewMessage("/b", "test2"))

	d, err := b.MarshalBinary()
	if err != nil {
		t.Errorf("bundle marshal error: %v", err)
		return
	}

	d = append(d, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)

	io := bufio.NewReader(bytes.NewReader(d))
	start := 0
	bundle, err := readBundle(io, &start, len(d))
	if err != nil {
		t.Errorf("bundle read error: %v", err)
		return
	}

	if len(bundle.Messages) != 2 {
		t.Error("incorrect message count on decode")
		return
	}
}

resultst in:

--- FAIL: TestReadBundle (0.00s)
    osc_test.go:302: bundle read error: unsupported OSC packet type: only Bundle and Message are supported

During the decoding of osc bundles the appending of messages to the bundle fails.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions