Scroom 0.14-49-gb7ae7a6d
Loading...
Searching...
No Matches
threadpool-queueimpl-tests.cc File Reference
#include <iostream>
#include <memory>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/thread.hpp>
#include <gtest/gtest.h>
#include <scroom/semaphore.hh>
#include <scroom/threadpool.hh>
#include "helpers.hh"
Include dependency graph for threadpool-queueimpl-tests.cc:

Functions

const millisec short_timeout (250)
 
const millisec long_timeout (2000)
 
t schedule (clear(&s), weak)
 
t add ()
 
 EXPECT_TRUE (s.P(long_timeout))
 
queue reset ()
 
t schedule (clear(&s2))
 
 EXPECT_TRUE (s2.P(long_timeout))
 
 EXPECT_FALSE (s1.try_P())
 

Variables

ThreadPool::WeakQueue::Ptr const weak = queue->getWeak()
 
Semaphore s (0)
 
ThreadPool t (0)
 
Semaphore s1 (0)
 
Semaphore s2 (0)
 

Function Documentation

◆ add()

t add ( )

◆ EXPECT_FALSE()

EXPECT_FALSE ( s1.  try_P())

◆ EXPECT_TRUE() [1/2]

EXPECT_TRUE ( s.  Plong_timeout)

◆ EXPECT_TRUE() [2/2]

EXPECT_TRUE ( s2.  Plong_timeout)

◆ long_timeout()

const millisec long_timeout ( 2000  )

◆ reset()

queue reset ( )
132{
133 testData.reset();
134
135 return false;
136}
TestData::Ptr testData
Definition test-helpers.cc:25

◆ schedule() [1/2]

t schedule ( clear s,
weak   
)

◆ schedule() [2/2]

t schedule ( clear s2)

◆ short_timeout()

const millisec short_timeout ( 250  )

Variable Documentation

◆ s

Semaphore s(0) ( )

◆ s1

Semaphore s1(0) ( )

◆ s2

Semaphore s2(0) ( )

◆ t

ThreadPool t(0) ( )

◆ weak