tests/cpp11_condition_variable: fix NDEBUG compile problem
This commit is contained in:
parent
f4224890ae
commit
08706e771e
@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cassert>
|
|
||||||
#include <system_error>
|
#include <system_error>
|
||||||
|
|
||||||
#include "riot/mutex.hpp"
|
#include "riot/mutex.hpp"
|
||||||
@ -28,6 +27,8 @@
|
|||||||
#include "riot/thread.hpp"
|
#include "riot/thread.hpp"
|
||||||
#include "riot/condition_variable.hpp"
|
#include "riot/condition_variable.hpp"
|
||||||
|
|
||||||
|
#include "test_utils/expect.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace riot;
|
using namespace riot;
|
||||||
|
|
||||||
@ -62,7 +63,7 @@ int main() {
|
|||||||
cv.wait(lk, [&processed] { return processed; });
|
cv.wait(lk, [&processed] { return processed; });
|
||||||
}
|
}
|
||||||
string expected = "Example data after processing";
|
string expected = "Example data after processing";
|
||||||
assert(data == expected);
|
expect(data == expected);
|
||||||
worker.join();
|
worker.join();
|
||||||
}
|
}
|
||||||
puts("Done\n");
|
puts("Done\n");
|
||||||
@ -102,7 +103,7 @@ int main() {
|
|||||||
cv.wait_for(lk, chrono::seconds(timeout));
|
cv.wait_for(lk, chrono::seconds(timeout));
|
||||||
xtimer_now_timex(&after);
|
xtimer_now_timex(&after);
|
||||||
auto diff = timex_sub(after, before);
|
auto diff = timex_sub(after, before);
|
||||||
assert(diff.seconds >= timeout);
|
expect(diff.seconds >= timeout);
|
||||||
}
|
}
|
||||||
puts("Done\n");
|
puts("Done\n");
|
||||||
|
|
||||||
@ -119,7 +120,7 @@ int main() {
|
|||||||
cv.wait_until(lk, time);
|
cv.wait_until(lk, time);
|
||||||
xtimer_now_timex(&after);
|
xtimer_now_timex(&after);
|
||||||
auto diff = timex_sub(after, before);
|
auto diff = timex_sub(after, before);
|
||||||
assert(diff.seconds >= timeout);
|
expect(diff.seconds >= timeout);
|
||||||
}
|
}
|
||||||
puts("Done\n");
|
puts("Done\n");
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user