From b6f81d1e1e160803596d36daff750d37599f0988 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Fri, 20 May 2011 20:31:16 +0200 Subject: [PATCH] Fix problems discovered by compiling with gcc 4.4 --- tests/components/backend/media-access-mock.cpp | 11 ++++------- tests/lib/sync-locking-test.cpp | 2 +- tests/lib/time/time-value-test.cpp | 18 +++++++++--------- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/tests/components/backend/media-access-mock.cpp b/tests/components/backend/media-access-mock.cpp index 01839dfae..096ecf197 100644 --- a/tests/components/backend/media-access-mock.cpp +++ b/tests/components/backend/media-access-mock.cpp @@ -37,11 +37,10 @@ #include "proc/mobject/session/testclip.hpp" #include "lib/util.hpp" -#include "lib/util-foreach.hpp" +#include "lib/singleton.hpp" #include "lib/time/mutation.hpp" #include "lib/symbol.hpp" -#include #include #include @@ -49,9 +48,7 @@ using lumiera::error::Invalid; using lib::time::Mutation; using lib::time::Duration; using lib::Literal; -using util::for_each; using util::isnil; -using std::cout; using std::string; using std::vector; using std::map; @@ -122,7 +119,7 @@ namespace test { }; // instantiate TestCasses table - TestCases testCases; + lib::Singleton testCases; } // (end) implementation namespace @@ -134,12 +131,12 @@ namespace test { if (isnil (name)) throw Invalid ("empty filename passed to MediaAccessFacade."); - if (!testCases.known(name)) + if (!testCases().known(name)) throw Invalid ("unable to use media file \""+name+"\"." "Hint: you're using a test-mock file access, " "which responds only to some magical names."); - return testCases[name].globalDesc; + return testCases()[name].globalDesc; } diff --git a/tests/lib/sync-locking-test.cpp b/tests/lib/sync-locking-test.cpp index 9fa27cbb9..6bc9d7614 100644 --- a/tests/lib/sync-locking-test.cpp +++ b/tests/lib/sync-locking-test.cpp @@ -52,7 +52,7 @@ namespace test{ class Victim : public Sync { - volatile long cnt_[NUM_COUNTERS]; + volatile uint cnt_[NUM_COUNTERS]; volatile uint step_; ///< @note stored as instance variable void diff --git a/tests/lib/time/time-value-test.cpp b/tests/lib/time/time-value-test.cpp index 08dfef586..e2316f240 100644 --- a/tests/lib/time/time-value-test.cpp +++ b/tests/lib/time/time-value-test.cpp @@ -74,7 +74,7 @@ namespace test{ createOffsets (ref); buildDuration (ref); buildTimeSpan (ref); - compareTimeSpan (ref); + compareTimeSpan (Time(ref)); relateTimeIntervals (ref); } @@ -309,12 +309,12 @@ namespace test{ void - compareTimeSpan (TimeValue org) + compareTimeSpan (Time const& org) { - TimeSpan span1 (Time(org), Time(org)+Time(org)); // using the distance between start and end point - TimeSpan span2 (Time(org), Offset(org, TimeValue(0))); // note: the offset is taken absolute, as Duration - TimeSpan span3 (Time(org), FSecs(5,2)); // Duration given explicitly, in seconds - TimeSpan span4 (Time(org), FSecs(5,-2)); // again: the Duration is taken absolute + TimeSpan span1 (org, org+org); // using the distance between start and end point + TimeSpan span2 (org, Offset(org, Time::ZERO)); // note: the offset is taken absolute, as Duration + TimeSpan span3 (org, FSecs(5,2)); // Duration given explicitly, in seconds + TimeSpan span4 (org, FSecs(5,-2)); // again: the Duration is taken absolute CHECK (span1 == span2); CHECK (span2 == span1); @@ -336,9 +336,9 @@ namespace test{ CHECK (span3.end() == span4.end()); // Verify the extended order on time intervals - TimeSpan span1x (Time(org)+Time(org), Duration(Time(org))); // starting later than span1 - TimeSpan span3y (Time(org), FSecs(2)); // shorter than span3 - TimeSpan span3z (Time(org)+Time(org), FSecs(2)); // starting later and shorter than span3 + TimeSpan span1x (org+org, Duration(org)); // starting later than span1 + TimeSpan span3y (org, FSecs(2)); // shorter than span3 + TimeSpan span3z (org+org, FSecs(2)); // starting later and shorter than span3 CHECK (span1 != span1x); CHECK (span3 != span3y);