đŸ’Ÿ Archived View for lofi.haiku-os.org â€ș docs â€ș develop â€ș midi â€ș testing.gmi captured on 2023-12-28 at 15:19:22. Gemini links have been rewritten to link to archived content

View Raw

More Information

âŹ…ïž Previous capture (2023-09-28)

-=-=-=-=-=-=-

Testing the Midi Kit

Most of the OpenBeOS source code has unit tests in the current/src/tests directory. I looked into building CppUnit tests for the midi2 kit, but decided that it doesn’t really make much sense. Unit tests work best if you can test something in isolation, but in the case of the midi2 kit this is very hard to achieve. Because the classes from libmidi2.so always need to talk to the midi_server, the tests depend on too many external factors. The available endpoints, for example, will differ from system to system. The spray and hook functions are difficult to test this way, too.

So instead of a CppUnit test suite, here is a list of manual tests that I performed when developing the midi2 kit:

======================================================================

Registering the application

======================================================================

Creating endpoints

======================================================================

Deleting endpoints

======================================================================

Changing attributes

======================================================================

Consulting the roster


Verify that FindEndpoint() returns a valid BMidiEndpoint object if you pass it:


======================================================================

Making/breaking connections



======================================================================

Watching

======================================================================

Event tests

======================================================================

Other tests

The reason this happens is because you kill app1. When app2 sends a synchronous request to the midi_server, the server re-used that same message to notify the other apps. (Because it already contained all the necessary fields.) But app1 is dead, the notification fails, and this (probably) wipes out the reply address in the message. I changed the midi_server to create new BMessages for the notifications, and was no longer able to reproduce the problem.