goxr3plus / java-stream-player

🌌Java Advanced Audio Controller Library (WAV, AU, AIFF, MP3, OGG VORBIS, FLAC, MONKEY's AUDIO and SPEEX audio formats )
GNU General Public License v3.0
147 stars 33 forks source link

Some unit tests #19

Closed HelgeStenstrom closed 5 years ago

HelgeStenstrom commented 5 years ago

In the TimeTool test, I think I've found a bug. Check lines 45 and 46.

The tests are written to document the current behavior, rather than to guard against bugs.

The time duration test don't test very much. It's because the method needs input data that I can't easily create in the test. With test-driven development, the method would have been written in a different way.

goxr3plus commented 5 years ago

I don't completely understand how is a bug in line 45 and 46 ?

HelgeStenstrom commented 5 years ago

What I mean is that 1001 ms returns a result that is less than the result returned by 999 ms. The method behaves like a modulus or remainder function. Is that the intention?

HelgeStenstrom commented 5 years ago

To be even more clear: If TimeTool.millisecondsToTime(999) == "0.9" then I expect TimeTool.millisecondsToTime(1001) == "1.0"

but my expectations may be wrong. What are your expectations?

goxr3plus commented 5 years ago

Yep, i might have to take a deeper look at it :)

goxr3plus commented 5 years ago

I am merging your commits for now, can you open an issue about it so i fix it :)?

goxr3plus commented 5 years ago

Ouh can you mergr because i can't? Why actually i can't that's so strange, like i cannot merge some pull requests.

HelgeStenstrom commented 5 years ago

This is how it looks for me right now.

Skärmklipp 2019-09-02 20 48 36

So I can merge, can't you?

goxr3plus commented 5 years ago

Now i can :) Please open an issue about the bug you found.