summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am4
-rw-r--r--tests/quantize_test.cpp28
-rw-r--r--tests/time_test.cpp1
3 files changed, 31 insertions, 2 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 05b0f21..9e8e6c8 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -3,7 +3,7 @@ if BUILD_TESTS
AM_CXXFLAGS = -I.. -lpthread @RASQAL_CFLAGS@ @GLIBMM_CFLAGS@
ALL_LIBS = @RASQAL_LIBS@ @GLIBMM_LIBS@ ../src/libraul.la
-bin_PROGRAMS = path_test thread_test queue_test atomic_test list_test time_test
+bin_PROGRAMS = path_test thread_test queue_test atomic_test list_test time_test quantize_test
thread_test_LDADD = $(ALL_LIBS)
path_test_LDADD = $(ALL_LIBS)
@@ -11,6 +11,7 @@ queue_test_LDADD = $(ALL_LIBS)
atomic_test_LDADD = $(ALL_LIBS)
list_test_LDADD = $(ALL_LIBS)
time_test_LDADD = $(ALL_LIBS)
+quantize_test_LDADD = $(ALL_LIBS)
path_test_SOURCES = path_test.cpp
thread_test_SOURCES = thread_test.cpp
@@ -18,5 +19,6 @@ queue_test_SOURCES = queue_test.cpp
atomic_test_SOURCES = atomic_test.cpp
list_test_SOURCES = list_test.cpp
time_test_SOURCES = time_test.cpp
+quantize_test_SOURCES = quantize_test.cpp
endif
diff --git a/tests/quantize_test.cpp b/tests/quantize_test.cpp
new file mode 100644
index 0000000..434df2e
--- /dev/null
+++ b/tests/quantize_test.cpp
@@ -0,0 +1,28 @@
+#include <iostream>
+#include <raul/Quantizer.h>
+
+using namespace std;
+using namespace Raul;
+
+
+int
+main()
+{
+ double q = 0;
+ double beats = 0;
+
+ cout << "Quantization: ";
+ cin >> q;
+ cout << endl;
+
+ while (true) {
+ cout << "Beats: ";
+ cin >> beats;
+
+ cout << "Quantized: ";
+ cout << Quantizer::quantize(q, beats) << endl << endl;
+ }
+
+ return 0;
+}
+
diff --git a/tests/time_test.cpp b/tests/time_test.cpp
index 0eb0a83..0ffdc61 100644
--- a/tests/time_test.cpp
+++ b/tests/time_test.cpp
@@ -10,7 +10,6 @@ main()
{
TimeSlice ts(1/48000.0, 120);
- string in_string;
double in_double = 0;
cout << "Beats: ";