mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-26 21:42:19 +03:00
14e02978fc
Avoid unspecified behavior of mmap when a file is resized reported by Christian Hardmeier
Fixes for Mavericks and a workaround for Boost's broken semaphore
Clean clang compile (of kenlm)
Merged some of 744376b3fb
but also undid some of it because it was just masking a fundaemntal problem with pread rather than working around windows limitations
21 lines
360 B
C++
21 lines
360 B
C++
#include "util/pcqueue.hh"
|
|
|
|
#define BOOST_TEST_MODULE PCQueueTest
|
|
#include <boost/test/unit_test.hpp>
|
|
|
|
namespace util {
|
|
namespace {
|
|
|
|
BOOST_AUTO_TEST_CASE(SingleThread) {
|
|
PCQueue<int> queue(10);
|
|
for (int i = 0; i < 10; ++i) {
|
|
queue.Produce(i);
|
|
}
|
|
for (int i = 0; i < 10; ++i) {
|
|
BOOST_CHECK_EQUAL(i, queue.Consume());
|
|
}
|
|
}
|
|
|
|
}
|
|
} // namespace util
|