diff options
author | David Robillard <d@drobilla.net> | 2010-01-07 21:27:39 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-01-07 21:27:39 +0000 |
commit | 0d009a4e980e40dc8a9c9b5e3d25c3fafb363e95 (patch) | |
tree | 4d41dea009f1647519af8df10f114cd7a6165792 /test/time_test.cpp | |
parent | 61ac4a41f0aea63f45d7b27be3ef2e0554e93ece (diff) | |
download | raul-0d009a4e980e40dc8a9c9b5e3d25c3fafb363e95.tar.gz raul-0d009a4e980e40dc8a9c9b5e3d25c3fafb363e95.tar.bz2 raul-0d009a4e980e40dc8a9c9b5e3d25c3fafb363e95.zip |
Move unit testing and coverage framework into autowaf.
Make raul tests return 0 on success, 1 on failure.
Test coverage for Raul.
git-svn-id: http://svn.drobilla.net/lad/trunk/raul@2368 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'test/time_test.cpp')
-rw-r--r-- | test/time_test.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/time_test.cpp b/test/time_test.cpp new file mode 100644 index 0000000..2b53207 --- /dev/null +++ b/test/time_test.cpp @@ -0,0 +1,32 @@ +#include "raul/TimeStamp.hpp" +#include "raul/TimeSlice.hpp" +#include <iostream> + +using namespace std; +using namespace Raul; + + +int +main() +{ + TimeUnit unit(TimeUnit::BEATS, 19200); + TimeSlice ts(48000, 19200, 120.0); + + double in_double; + cout << "Beats: "; + cin >> in_double; + + TimeStamp t(unit, (uint32_t)in_double, + (uint32_t)((in_double - (uint32_t)in_double) * unit.ppt())); + + cout << "\tSeconds: "; + cout << ts.beats_to_seconds(t); + cout << endl; + + cout << "\tTicks: "; + cout << ts.beats_to_ticks(t); + cout << endl; + + return 0; +} + |