From c111dfa068ee9696a216417a434b24764740901a Mon Sep 17 00:00:00 2001
From: Tristan Matthews <tristan.matthews@savoirfairelinux.com>
Date: Thu, 12 Apr 2012 15:23:34 -0400
Subject: [PATCH] * #9782: fix warnings in tests

---
 daemon/test/audiolayertest.cpp     | 6 ++++--
 daemon/test/delaydetectiontest.cpp | 2 +-
 daemon/test/mainbuffertest.cpp     | 3 +--
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/daemon/test/audiolayertest.cpp b/daemon/test/audiolayertest.cpp
index 5eb9fef40c..3e80ef2f1f 100644
--- a/daemon/test/audiolayertest.cpp
+++ b/daemon/test/audiolayertest.cpp
@@ -80,7 +80,8 @@ void AudioLayerTest::testAudioLayerSwitch()
             CPPUNIT_ASSERT(dynamic_cast<AlsaLayer*>(Manager::instance().getAudioDriver()));
 
         wasAlsa = dynamic_cast<AlsaLayer*>(Manager::instance().getAudioDriver()) != 0;
-        usleep(100000);
+        const struct timespec req = {0, 100000000};
+        nanosleep(&req, 0);
     }
 }
 
@@ -90,7 +91,8 @@ void AudioLayerTest::testPulseConnect()
 
     if (dynamic_cast<AlsaLayer*>(Manager::instance().getAudioDriver())) {
         Manager::instance().switchAudioManager();
-        usleep(100000);
+        const struct timespec req = {0, 100000000};
+        nanosleep(&req, 0);
     }
 
     pulselayer_ = dynamic_cast<PulseLayer*>(Manager::instance().getAudioDriver());
diff --git a/daemon/test/delaydetectiontest.cpp b/daemon/test/delaydetectiontest.cpp
index aaed8881ef..6b744c79f1 100644
--- a/daemon/test/delaydetectiontest.cpp
+++ b/daemon/test/delaydetectiontest.cpp
@@ -67,7 +67,7 @@ void DelayDetectionTest::testCrossCorrelationDelay()
 
     delaydetect_.crossCorrelate(ref, signal, result, 3, 10);
 
-    float expected[10] = {0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0};
+//    float expected[10] = {0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0};
 }
 
 void DelayDetectionTest::testFirFilter()
diff --git a/daemon/test/mainbuffertest.cpp b/daemon/test/mainbuffertest.cpp
index 2e5893c0e5..1ca7a603eb 100644
--- a/daemon/test/mainbuffertest.cpp
+++ b/daemon/test/mainbuffertest.cpp
@@ -865,7 +865,6 @@ void MainBufferTest::testGetPutDataByID()
     int test_input2 = 13;
     int test_output;
 
-    int avail_for_put_testid;
     int avail_for_put_defaultid;
 
     // put by default_id get by test_id without preleminary put
@@ -883,7 +882,7 @@ void MainBufferTest::testGetPutDataByID()
     CPPUNIT_ASSERT(test_input1 == test_output);
 
     // get by default_id without preliminary input
-    avail_for_put_testid = mainbuffer_.availForPut(test_id);
+    mainbuffer_.availForPut(test_id);
     CPPUNIT_ASSERT(mainbuffer_.availForGetByID(test_id, default_id) == 0);
     CPPUNIT_ASSERT(mainbuffer_.getDataByID(&test_output, sizeof(int), 100, test_id, default_id) == 0);
 
-- 
GitLab