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

Functions

static const millisec short_timeout (250)
 
static const millisec long_timeout (2000)
 
 ASSERT_FALSE (s.try_P())
 
 ASSERT_TRUE (s.try_P())
 
std::weak_ptr< int > const w (p)
 
 ASSERT_TRUE (w.lock())
 
boost::function< void()> const f (destroy(p))
 
p reset ()
 
 f ()
 
 ASSERT_FALSE (w.lock())
 
 ASSERT_FALSE (s1.try_P())
 
 ASSERT_FALSE (s2.try_P())
 
clear s1 clear s2 ()
 
 ASSERT_TRUE (s1.try_P())
 
 ASSERT_TRUE (s2.try_P())
 
 EXPECT_FALSE (s1.try_P())
 
 EXPECT_FALSE (s2.try_P())
 
boost::thread t (pass(&s1)+clear(&s2))
 
 EXPECT_FALSE (s2.P(short_timeout))
 
s1 V ()
 
 EXPECT_TRUE (s2.P(long_timeout))
 
 EXPECT_TRUE (t.timed_join(long_timeout))
 
EXPECT_EQa (a+clear(&s2))
 
boost::thread t (a)
 
EXPECT_EQa (pass(&s1)+a)
 
Semaphore s2 (25)
 
() void (clear(nullptr)+(5 *clear(nullptr)) *5)
 
() void (clear(nullptr)+5 *(5 *clear(nullptr)))
 
() void (4 *(clear(nullptr)+clear(nullptr)))
 
() void ((clear(nullptr)+clear(nullptr)) *4)
 

Variables

clear(&) s ()
 
Semaphore s2 (0)
 
Semaphore s1 (0)
 
 a = pass(&s1)
 

Function Documentation

◆ a() [1/2]

EXPECT_EQ & a ( a+clear s2)

◆ a() [2/2]

EXPECT_EQ & a ( pass &s1 a)

◆ ASSERT_FALSE() [1/4]

ASSERT_FALSE ( s.  try_P())

◆ ASSERT_FALSE() [2/4]

ASSERT_FALSE ( s1.  try_P())

◆ ASSERT_FALSE() [3/4]

*pass s2 * ASSERT_FALSE ( s2.  try_P())

◆ ASSERT_FALSE() [4/4]

ASSERT_FALSE ( w.  lock())

◆ ASSERT_TRUE() [1/4]

ASSERT_TRUE ( s.  try_P())

◆ ASSERT_TRUE() [2/4]

ASSERT_TRUE ( s1.  try_P())

◆ ASSERT_TRUE() [3/4]

ASSERT_TRUE ( s2.  try_P())

◆ ASSERT_TRUE() [4/4]

ASSERT_TRUE ( w.  lock())

◆ EXPECT_FALSE() [1/3]

EXPECT_FALSE ( s1.  try_P())

◆ EXPECT_FALSE() [2/3]

EXPECT_FALSE ( s2.  Pshort_timeout)

◆ EXPECT_FALSE() [3/3]

EXPECT_FALSE ( s2.  try_P())

◆ EXPECT_TRUE() [1/2]

EXPECT_TRUE ( s2.  Plong_timeout)

◆ EXPECT_TRUE() [2/2]

EXPECT_TRUE ( t.  timed_joinlong_timeout)

◆ f() [1/2]

◆ f() [2/2]

boost::function< void()> const f ( destroy(p )

◆ long_timeout()

static const millisec long_timeout ( 2000  )
static

◆ reset()

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

◆ s2() [1/2]

clear s1 clear s2 ( )

◆ s2() [2/2]

Semaphore s2 ( 25  )

◆ short_timeout()

static const millisec short_timeout ( 250  )
static

◆ t() [1/2]

boost::thread t ( a  )

◆ t() [2/2]

boost::thread t ( pass &s1+clear s2)

◆ V()

s1 V ( )

◆ void() [1/4]

() void ( (clear(nullptr)+clear(nullptr)) *  4)

◆ void() [2/4]

() void ( 4 *  clear(nullptr)+clear(nullptr))

◆ void() [3/4]

() void ( clear(nullptr)+(5 *clear(nullptr)) *  5)

Referenced by Scroom::GtkHelpers::async_on_ui_thread_and_wait(), and TileViewState::process().

Here is the caller graph for this function:

◆ void() [4/4]

() void ( clear(nullptr)+5 *(5 *clear(nullptr))  )

◆ w()

std::weak_ptr< int > const w ( p  )

Variable Documentation

◆ a

a = pass(&s1)

◆ s

pass(&) s() ( )
Initial value:
{
Definition semaphore.hh:16
clear(&) s()
Definition function-additor-tests.cc:30

◆ s1

Scaffold s1 ( )
Initial value:
{
Definition function-additor.hh:17
a
Definition function-additor-tests.cc:84

◆ s2

Scaffold s2 ( )
Initial value:
{
Semaphore s1(0)
Definition rectangletests.cc:196