DriveHQ Start Menu
Cloud Drive Mapping
Folder Sync
True Drop Box
FTP/SFTP Hosting
Group Account
Team Anywhere
DriveHQ Start Menu
Online File Server
My Storage
|
Manage Shares
|
Publishes
|
Drop Boxes
|
Group Account
WebDAV Drive Mapping
Cloud Drive Home
|
WebDAV Guide
|
Drive Mapping Tool
|
Drive Mapping URL
Complete Data Backup
Backup Guide
|
Cloud-to-Cloud Backup
|
DVR/Camera Backup
FTP, Email & Web Service
FTP/SFTP Hosting
|
Email Hosting
|
Web Hosting
|
Webcam Hosting
Other Products & Services
Team Anywhere
|
Connect to Remote PC
|
Cloud Surveillance
|
Virtual CCTV NVR
Quick Links
Security and Privacy
Customer Support
Service Manual
Use Cases
Group Account
Online Help
Support Forum
Contact Us
About DriveHQ
Sign Up
Login
Features
Business Features
Online File Server
FTP Hosting
Cloud Drive Mapping
Cloud File Backup
Email Backup & Hosting
Cloud File Sharing
Folder Synchronization
Group Management
True Drop Box
Full-text Search
AD Integration/SSO
Mobile Access
Personal Features
Personal Cloud Drive
Backup All Devices
Mobile APPs
Personal Web Hosting
Sub-Account (for Kids)
Home/PC/Kids Monitoring
Other Features
Team Anywhere (Remote Desktop Service)
CameraFTP Cloud Surveillance
Software
DriveHQ Drive Mapping Tool
DriveHQ FileManager
DriveHQ Online Backup
DriveHQ Team Anywhere for Windows (Beta)
DriveHQ Mobile Apps
Pricing
Business Plans & Pricing
Personal Plans & Pricing
Price Comparison with Others
Feature Comparison with Others
Install Mobile App
Sign up
Creating account...
Invalid character in username! Only 0-9, a-z, A-Z, _, -, . allowed.
Username is required!
Invalid email address!
E-mail is required!
Password is required!
Password is invalid!
Password and confirmation do not match.
Confirm password is required!
I accept
Membership Agreement
Please read the Membership Agreement and check "I accept"!
Free Quick Sign-up
Sign-up Page
Log in
Signing in...
Username or e-mail address is required!
Password is required!
Keep me logged in
Quick Login
Forgot Password
Up
Upload
Download
Share
Publish
New Folder
New File
Copy
Cut
Delete
Paste
Rate
Upgrade
Rotate
Effect
Edit
Slide
History
// (C) Copyright Gennadiy Rozental 2005-2007. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org/libs/test for the library home page. // // File : $RCSfile$ // // Version : $Revision: 41369 $ // // Description : Facilities to perform exception safety_tests // *************************************************************************** #ifndef BOOST_TEST_MOCK_OBJECT_HPP_112205GER #define BOOST_TEST_MOCK_OBJECT_HPP_112205GER // Boost.Test #include
#include
// Boost #include
#include
//____________________________________________________________________________// namespace boost { namespace itest { // ************************************************************************** // // ************** mock_object_base ************** // // ************************************************************************** // class mock_object_base { public: mock_object_base() {} template
mock_object_base( T1 const& ) {} template
mock_object_base( T1 const&, T2 const& ) {} template
mock_object_base( T1 const&, T2 const&, T3 const& ) {} template
mock_object_base( T1 const&, T2 const&, T3 const&, T4 const& ) {} template
mock_object_base( T1 const&, T2 const&, T3 const&, T4 const&, T5 const& ) {} }; // ************************************************************************** // // ************** mock_object implementation helpers ************** // // ************************************************************************** // #define MO_OP_IMPL( op, descr, ret ) \ BOOST_ITEST_SCOPE( mock_object::operator op ); \ BOOST_ITEST_EPOINT( descr ); \ return ret \ /**/ #define MO_UNARY_OP( op, descr ) \ self_type const& operator op() const \ { \ MO_OP_IMPL( op, descr, prototype() ); \ } \ /**/ #define MO_UNARY_BOOL_OP( op, descr ) \ bool operator op() const \ { \ MO_OP_IMPL( op, descr, (!!BOOST_ITEST_DPOINT()) ); \ } \ /**/ #define MO_BINARY_OP( op, descr ) \ template
\ inline mock_object
const& \ operator op( mock_object
const& mo, \ mock_object
const& ) \ { \ MO_OP_IMPL( op, descr, mo ); \ } \ \ template
\ inline mock_object
const& \ operator op( mock_object
const& mo, T const& ) \ { \ MO_OP_IMPL( op, descr, mo ); \ } \ \ template
\ inline mock_object
const& \ operator op( T const&, mock_object
const& mo ) \ { \ MO_OP_IMPL( op, descr, mo ); \ } \ /**/ #define MO_BINARY_BOOL_OP( op, descr ) \ template
\ inline bool \ operator op( mock_object
const&, \ mock_object
const& ) \ { \ MO_OP_IMPL( op, descr, BOOST_ITEST_DPOINT() ); \ } \ \ template
\ inline bool \ operator op( mock_object
const&, T const& ) \ { \ MO_OP_IMPL( op, descr, BOOST_ITEST_DPOINT() ); \ } \ \ template
\ inline bool \ operator op( T const&, mock_object
const& ) \ { \ MO_OP_IMPL( op, descr, BOOST_ITEST_DPOINT() ); \ } \ /**/ // ************************************************************************** // // ************** mock_object ************** // // ************************************************************************** // template
class mock_object; template
class mock_object : public Base { // Private typeefs typedef mock_object
self_type; struct dummy { void nonnull() {}; }; typedef void (dummy::*safe_bool)(); // prototype constructor mock_object( dummy* ) {} public: static mock_object& prototype() { static mock_object p( (dummy*)0 ); return p; } // Constructors mock_object() { BOOST_ITEST_SCOPE( mock_object::mock_object ); BOOST_ITEST_EPOINT( "Mock object default constructor" ); } template
mock_object( T1 const& arg1 ) : mock_object_base( arg1 ) { BOOST_ITEST_SCOPE( mock_object::mock_object ); BOOST_ITEST_EPOINT( "Mock object constructor" ); } template
mock_object( T1 const& arg1, T2 const& arg2 ) : mock_object_base( arg1, arg2 ) { BOOST_ITEST_SCOPE( mock_object::mock_object ); BOOST_ITEST_EPOINT( "Mock object constructor" ); } template
mock_object( T1 const& arg1, T2 const& arg2, T3 const& arg3 ) : mock_object_base( arg1, arg2, arg3 ) { BOOST_ITEST_SCOPE( mock_object::mock_object ); BOOST_ITEST_EPOINT( "Mock object constructor" ); } template
mock_object( T1 const& arg1, T2 const& arg2, T3 const& arg3, T4 const& arg4 ) : mock_object_base( arg1, arg2, arg3, arg4 ) { BOOST_ITEST_SCOPE( mock_object::mock_object ); BOOST_ITEST_EPOINT( "Mock object constructor" ); } template
mock_object( T1 const& arg1, T2 const& arg2, T3 const& arg3, T4 const& arg4, T5 const& arg5 ) : mock_object_base( arg1, arg2, arg3, arg4, arg5 ) { BOOST_ITEST_SCOPE( mock_object::mock_object ); BOOST_ITEST_EPOINT( "Mock object constructor" ); } mock_object( mock_object const& ) { BOOST_ITEST_SCOPE( mock_object::mock_object ); BOOST_ITEST_EPOINT( "Mock object copy constructor" ); } // assignment self_type const& operator =( mock_object const& ) const { MO_OP_IMPL( =, "Copy assignment", prototype() ); } template
self_type const& operator =( T const& ) const { MO_OP_IMPL( =, "Copy assignment", prototype() ); } // Unary operators MO_UNARY_BOOL_OP( !, "Logical NOT operator" ) MO_UNARY_OP( &, "Address-of operator" ) MO_UNARY_OP( ~, "One's complement operator" ) MO_UNARY_OP( *, "Pointer dereference" ) MO_UNARY_OP( +, "Unary plus" ) // Increment and Decrement MO_UNARY_OP( ++, "Prefix increment" ) MO_UNARY_OP( --, "Prefix decrement" ) self_type const& operator ++(int) const { MO_OP_IMPL( ++, "Postfix increment", prototype() ); } self_type const& operator --(int) const { MO_OP_IMPL( --, "Postfix decrement", prototype() ); } // Bool context convertion operator safe_bool() const { MO_OP_IMPL( safe_bool, "Bool context conversion", (BOOST_ITEST_DPOINT() ? 0 : &dummy::nonnull) ); } // Function-call operators self_type const& operator ()() const { MO_OP_IMPL( (), "0-arity function-call", prototype() ); } template
self_type const& operator ()( T1 const& arg1 ) const { MO_OP_IMPL( (), "1-arity function-call", prototype() ); } template
self_type const& operator ()( T1 const&, T2 const& ) const { MO_OP_IMPL( (), "2-arity function-call", prototype() ); } template
self_type const& operator ()( T1 const&, T2 const&, T3 const& ) const { MO_OP_IMPL( (), "3-arity function-call", prototype() ); } template
self_type const& operator ()( T1 const&, T2 const&, T3 const&, T4 const& ) const { MO_OP_IMPL( (), "4-arity function-call", prototype() ); } template
self_type const& operator ()( T1 const&, T2 const&, T3 const&, T4 const&, T5 const& ) const { MO_OP_IMPL( (), "5-arity function-call", prototype() ); } // Substripting template
self_type const& operator []( T const& ) const { MO_OP_IMPL( [], "Substripting", prototype() ); } // Class member access self_type const* operator->() const { MO_OP_IMPL( ->, "Class member access", this ); } }; // !! MO_BINARY_OP( BOOST_PP_COMMA(), "Comma operator" ) MO_BINARY_BOOL_OP( !=, "Inequality" ) MO_BINARY_OP( %, "Modulus" ) MO_BINARY_OP( %=, "Modulus/assignment" ) MO_BINARY_OP( &, "Bitwise AND" ) MO_BINARY_BOOL_OP( &&, "Logical AND" ) MO_BINARY_OP( &=, "Bitwise AND/assignment" ) MO_BINARY_OP( *, "Multiplication" ) MO_BINARY_OP( *=, "Multiplication/assignment" ) MO_BINARY_OP( +, "Addition" ) MO_BINARY_OP( +=, "Addition/assignment" ) //MO_BINARY_OP( -, "Subtraction" ) MO_BINARY_OP( -=, "Subtraction/assignment" ) MO_BINARY_OP( ->*, "Pointer-to-member selection" ) MO_BINARY_OP( /, "Division" ) MO_BINARY_OP( /=, "Division/assignment" ) MO_BINARY_BOOL_OP( <, "Less than" ) MO_BINARY_OP( <<=, "Left shift/assignment" ) MO_BINARY_BOOL_OP( <=, "Less than or equal to" ) MO_BINARY_BOOL_OP( ==, "Equality" ) MO_BINARY_BOOL_OP( >, "Greater than" ) MO_BINARY_BOOL_OP( >=, "Greater than or equal to" ) MO_BINARY_OP( >>=, "Right shift/assignment" ) MO_BINARY_OP( ^, "Exclusive OR" ) MO_BINARY_OP( ^=, "Exclusive OR/assignment" ) MO_BINARY_OP( |, "Bitwise inclusive OR" ) MO_BINARY_OP( |=, "Bitwise inclusive OR/assignment" ) MO_BINARY_BOOL_OP( ||, "Logical OR" ) MO_BINARY_OP( <<, "Left shift" ) MO_BINARY_OP( >>, "Right shift" ) } // namespace itest } // namespace boost #include
#endif // BOOST_TEST_MOCK_OBJECT_HPP_112205GER
mock_object.hpp
Page URL
File URL
Prev
11/28
Next
Download
( 12 KB )
Note: The DriveHQ service banners will NOT be displayed if the file owner is a paid member.
Comments
Total ratings:
0
Average rating:
Not Rated
Would you like to comment?
Join DriveHQ
for a free account, or
Logon
if you are already a member.