[beast: 5/24] TESTS: use Rapicorn's printout()
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast: 5/24] TESTS: use Rapicorn's printout()
- Date: Thu, 24 Sep 2015 20:10:01 +0000 (UTC)
commit 504c0a5de38e6eb2dab113400083ce929e756351
Author: Tim Janik <timj gnu org>
Date: Tue Sep 22 21:41:07 2015 +0200
TESTS: use Rapicorn's printout()
tests/bse/cxxbinding.cc | 34 +++++++++++++++++-----------------
tests/bse/testplugin.cc | 2 +-
tests/testresamplerq.cc | 2 +-
tests/testwavechunk.cc | 32 ++++++++++++++++----------------
4 files changed, 35 insertions(+), 35 deletions(-)
---
diff --git a/tests/bse/cxxbinding.cc b/tests/bse/cxxbinding.cc
index f8b361d..524f2c9 100644
--- a/tests/bse/cxxbinding.cc
+++ b/tests/bse/cxxbinding.cc
@@ -27,27 +27,27 @@ main (int argc,
Bse::init_async (&argc, argv, "CxxBindingTest");
bse_context = Bse::init_glue_context (argv[0], []() { g_main_context_wakeup (g_main_context_default()); });
sfi_glue_context_push (bse_context);
- g_print ("type_blurb(BseContainer)=%s\n", type_blurb("BseContainer").c_str());
+ printout ("type_blurb(BseContainer)=%s\n", type_blurb("BseContainer").c_str());
const gchar *file_name = "empty.ogg";
SampleFileInfoHandle info = sample_file_info (file_name);
if (info.c_ptr())
{
- g_print ("sample_file_info(\"%s\"): file = %s, loader = %s\n",
+ printout ("sample_file_info(\"%s\"): file = %s, loader = %s\n",
file_name, info->file.c_str(), info->loader.c_str());
- g_print (" %d waves contained:\n", info->waves.length());
+ printout (" %d waves contained:\n", info->waves.length());
for (unsigned int i = 0; i < info->waves.length(); i++)
- g_print (" - %s\n", info->waves[i].c_str());
+ printout (" - %s\n", info->waves[i].c_str());
}
else
{
- g_print ("sample_file_info(\"%s\"): failed\n", file_name);
+ printout ("sample_file_info(\"%s\"): failed\n", file_name);
}
- g_print ("error_blurb(ERROR_DEVICE_ASYNC): %s\n", error_blurb (ERROR_DEVICE_ASYNC).c_str());
+ printout ("error_blurb(ERROR_DEVICE_ASYNC): %s\n", error_blurb (ERROR_DEVICE_ASYNC).c_str());
Server server = 1; // FIXME: users may not hardcode this
- // g_print ("server.get_custom_instrument_dir()=%s\n", server.get_custom_instrument_dir().c_str());
+ // printout ("server.get_custom_instrument_dir()=%s\n", server.get_custom_instrument_dir().c_str());
GConfigHandle prefs = GConfig::from_rec (server.bse_preferences ());
prefs->plugin_path = "./.libs/testplugin.so";
@@ -61,22 +61,22 @@ main (int argc,
server.register_core_plugins();
printf ("waiting... (FIXME: need to connect to server signals here)\n");
do_sleep (2);
- g_print ("done.\n");
+ printout ("done.\n");
/* ... test plugin ... */
Project test_project = server.use_new_project ("test_project");
CSynth synth = test_project.create_csynth ("synth");
- g_print ("--- creating TestObject ---\n");
+ printout ("--- creating TestObject ---\n");
Namespace::TestObject to = synth.create_source("NamespaceTestObject")._proxy(); // FIXME: dynamic_cast me
if (to)
- g_print ("success creating TestObject: %ld\n", to._proxy());
+ printout ("success creating TestObject: %ld\n", to._proxy());
else
g_error ("failed.");
/* --- test procedures --- */
- g_print ("--- calling procedure test_exception() ---\n");
- g_print ("invoking as: result = test_exception (21, %ld, 42, \"moderately-funky\");\n", to._proxy());
+ printout ("--- calling procedure test_exception() ---\n");
+ printout ("invoking as: result = test_exception (21, %ld, 42, \"moderately-funky\");\n", to._proxy());
SfiSeq *pseq = sfi_seq_new ();
sfi_seq_append_int (pseq, 21);
sfi_seq_append_proxy (pseq, to._proxy());
@@ -87,26 +87,26 @@ main (int argc,
if (!rvalue || !SFI_VALUE_HOLDS_INT (rvalue))
g_error ("failed (no result).");
SfiInt result = sfi_value_get_int (rvalue);
- g_print ("result=%d\n", result);
+ printout ("result=%d\n", result);
if (result != 21 + 42)
g_error ("wrong result.");
- g_print ("invoking to trigger exception: result = test_exception ();\n");
+ printout ("invoking to trigger exception: result = test_exception ();\n");
pseq = sfi_seq_new ();
rvalue = sfi_glue_call_seq ("namespace-test-exception", pseq);
sfi_seq_unref (pseq);
if (!rvalue || !SFI_VALUE_HOLDS_INT (rvalue))
g_error ("failed (no result).");
result = sfi_value_get_int (rvalue);
- g_print ("result=%d\n", result);
+ printout ("result=%d\n", result);
/* --- test playback --- */
file_name = "../test/test-song.bse";
- g_print ("--- playing %s... ---\n", file_name);
+ printout ("--- playing %s... ---\n", file_name);
Project project = server.use_new_project ("foo");
project.restore_from_file (file_name);
project.play();
sleep (3);
- g_print ("done.\n");
+ printout ("done.\n");
sfi_glue_context_pop ();
}
diff --git a/tests/bse/testplugin.cc b/tests/bse/testplugin.cc
index 40cd64f..68384a4 100644
--- a/tests/bse/testplugin.cc
+++ b/tests/bse/testplugin.cc
@@ -41,7 +41,7 @@ Procedure::test_exception::exec (SfiInt i,
SfiInt bar,
FunkynessType ft)
{
- g_print ("testplugin.cc: test_exception: i=%d obj=%p bar=%d ft=%d (MODERATELY_FUNKY=%d)\n",
+ printout ("testplugin.cc: test_exception: i=%d obj=%p bar=%d ft=%d (MODERATELY_FUNKY=%d)\n",
i, o, bar, ft, (int) MODERATELY_FUNKY);
if (ft != MODERATELY_FUNKY)
throw std::runtime_error ("need to be moderately funky");
diff --git a/tests/testresamplerq.cc b/tests/testresamplerq.cc
index 39ab5ff..66803b4 100644
--- a/tests/testresamplerq.cc
+++ b/tests/testresamplerq.cc
@@ -233,7 +233,7 @@ main (int argc, char **argv)
}
assert (options.rand_samples <= options.test_size / 2);
assert (options.test_size >= 128);
- g_print ("Resampler test parameters: test_size=%zd rand_samples=%zd\n",
+ printout ("Resampler test parameters: test_size=%zd rand_samples=%zd\n",
options.test_size, options.rand_samples);
run_tests ("FPU");
diff --git a/tests/testwavechunk.cc b/tests/testwavechunk.cc
index 389588a..8cf030c 100644
--- a/tests/testwavechunk.cc
+++ b/tests/testwavechunk.cc
@@ -55,7 +55,7 @@ run_loop_test (GslWaveLoopType loop_type,
g_error ("failed to open wave chunk: %s", bse_error_blurb (error));
gsl_wave_chunk_unref (wchunk);
if (verbosity >= VERBOSITY_SETUP)
- g_print ("SETUP: loop_type=%u loop_first=%lld loop_last=%lld loop_count=%d playdir=%+d\n",
+ printout ("SETUP: loop_type=%u loop_first=%lld loop_last=%lld loop_count=%d playdir=%+d\n",
wchunk->loop_type, wchunk->loop_first, wchunk->loop_last, wchunk->loop_count, play_dir);
gsl_wave_chunk_debug_block (wchunk, - DEBUG_SIZE / 2, DEBUG_SIZE, cmpblock - DEBUG_SIZE / 2);
block.play_dir = play_dir;
@@ -86,7 +86,7 @@ run_loop_test (GslWaveLoopType loop_type,
verbosity = 99;
}
if (verbosity >= VERBOSITY_CHECKS)
- g_print ("%s: offset=%d (block.offset=%lld) value=%.16f found=%.16f\n",
+ printout ("%s: offset=%d (block.offset=%lld) value=%.16f found=%.16f\n",
fabs (cmpblock[i] - v) > 1e-15 ? "MISMATCH" : "match",
i, (i - block.offset), cmpblock[i], v);
}
@@ -112,47 +112,47 @@ print_block (GslWaveChunk *wchunk,
guint i;
if (verbosity >= VERBOSITY_BLOCKS)
{
- g_print ("BLOCK:");
- g_print (" offset=%lld", block->offset);
- g_print (" length=%lld", block->length);
- g_print (" dirstride=%d", block->dirstride);
+ printout ("BLOCK:");
+ printout (" offset=%lld", block->offset);
+ printout (" length=%lld", block->length);
+ printout (" dirstride=%d", block->dirstride);
}
if (verbosity >= VERBOSITY_PADDING)
{
- g_print (" {prepad:");
+ printout (" {prepad:");
i = wchunk->n_pad_values;
p = block->start - (block->dirstride > 0 ? i : -i);
while (i--)
{
- g_print (" %.1f", *p);
+ printout (" %.1f", *p);
p += block->dirstride;
}
- g_print ("}");
+ printout ("}");
}
if (verbosity >= VERBOSITY_DATA)
{
- g_print (" {data:");
+ printout (" {data:");
p = block->start;
while (p != block->end)
{
- g_print (" %.1f", *p);
+ printout (" %.1f", *p);
p += block->dirstride;
}
- g_print ("}");
+ printout ("}");
}
if (verbosity >= VERBOSITY_PADDING)
{
i = wchunk->n_pad_values;
- g_print (" {postpad:");
+ printout (" {postpad:");
while (i--)
{
- g_print (" %.1f", *p);
+ printout (" %.1f", *p);
p += block->dirstride;
}
- g_print ("}");
+ printout ("}");
}
if (verbosity >= VERBOSITY_BLOCKS)
- g_print ("\n");
+ printout ("\n");
}
static void
reversed_datahandle_test (void)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]