[openbeos-midi] Re: BMidiPort is finished

  • From: Jerome Leveque <jerl1@xxxxxxx>
  • To: openbeos-midi@xxxxxxxxxxxxx
  • Date: Sat, 16 Nov 2002 16:51:54 +0100

>Two remarks:
>1) Testing. You say the class still needs testing and debugging.
>That means it is _not_ finished. What I would like you to do -- and
>this is how all the other OpenBeOS teams do it -- is write "unit
>tests" for the classes. These tests go into the src/tests/kits/midi/
>directory. If you are unsure about what unit tests exactly are,
>please look through some of the older OpenBeOS newsletters.

In fact I test it but not with a special test unit I compile the same app with 
libmidi and 
with the source I write, if the answer are same I suppose it's OK.
When the class are finished I compile it in MidiPlayerReplacement and I try 
playing with 
my External keyboard and that make music, for testing the reverse way I play a 
MidiFiles to the keyboard and the keyboard play alone.

>These tests are very important, and I want all of our classes to
>have corresponding tests! What sort of things should you test?
>Anything that can go wrong. Also test if your implementation of
>BMidiPort exactly does what Be's BMidiPort did, and what the BeBook
>says it should do.

I check with the BeBook and I think that do what it said.

>2) Thread-safety. Is your implementation of BMidiPort thread-safe? I
>want you to think about what possible problems might occur if two
>threads use the same BMidiPort class at the same time. And how did
>you/will you solve these problems? Is Be's BMidiPort thread-safe?
>What does the BeBook say about this? And so on...

I don't know how to make I "thread safe class" then if it is that just chance 

>> 3 private functions(Dispatch(...), Read(...), Write(...)) and 2
>> data (=5Fm=5Fprev=5Fcmd, =5Fm=5Fenhanced) are not used.
>You can throw away the functions that you don't use (as long as they
>are private and not virtual). You can also throw away the private
>data you don't use, but you have to add a little to the reserved[]
>array to keep the size of the class the same. I suggest you do that
>because having things around that are not used will be confusing.

Ok I will clear MidiPort.h but I'm not sure of me

>One remark though: I saw that you removed all of the code for
>MidiPort that I wrote and replaced it with your own. That is not
>very smart. I spent a lot of time fixing up these source files and
>making sure they are binary compatible. If you simply throw that
>away, then I did all of that work for nothing, and more importantly:
>I will have to do it all over again. Next time, could you please add
>your code to the existing source code and not throw anything away?

Ok I will never do it again and I will copy all the things I write into your 


Other related posts: