DriveHQ Start Menu
Cloud Drive Mapping
Folder Sync
Cloud Backup
True Drop Box
FTP/SFTP Hosting
Group Account
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
|
Online Backup Tool
|
Cloud-to-Cloud Backup
FTP, Email & Web Service
FTP Home
|
FTP Hosting FAQ
|
Email Hosting
|
EmailManager
|
Web Hosting
Help & Resources
About
|
Enterprise Service
|
Partnership
|
Comparisons
|
Support
Quick Links
Security and Privacy
Download Software
Service Manual
Use Cases
Group Account
Online Help
Blog
Contact
Cloud Surveillance
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
IP Camera & DVR Solution
More...
Personal Features
Personal Cloud Drive
Backup All Devices
Mobile APPs
Personal Web Hosting
Sub-Account (for Kids)
Home/PC/Kids Monitoring
More...
Software
DriveHQ Drive Mapping Tool
DriveHQ FileManager
DriveHQ Online Backup
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
// Copyright (c) 2004 Daniel Wallin and Arvid Norberg // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF // ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT // SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR // ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE // OR OTHER DEALINGS IN THE SOFTWARE. #include "test.hpp" #include
#include
#include
namespace luabind { #ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP template
T* get_pointer(boost::shared_ptr
const& p) { return p.get(); } #endif template
boost::shared_ptr
* get_const_holder(boost::shared_ptr
const*) { return 0; } } struct base : counted_type
{ base(): n(4) {} virtual ~base() {} void f(int) { } int n; }; // this is here to make sure the pointer offsetting works struct first_base : counted_type
{ virtual ~first_base() {} virtual void a() {} int padding; }; struct derived : first_base, base { derived(): n2(7) {} void f() {} int n2; }; COUNTER_GUARD(first_base); COUNTER_GUARD(base); int feedback = 0; void tester(base* t) { if (t->n == 4) feedback = 1; } void tester_(derived* t) { if (t->n2 == 7) feedback = 2; } void tester2(boost::shared_ptr
t) { if (t->n == 4) feedback = 3; } void tester3(boost::shared_ptr
t) { if (t->n == 4) feedback = 4; } void tester4(const boost::shared_ptr
& t) { if (t->n == 4) feedback = 5; } void tester5(const boost::shared_ptr
* t) { if ((*t)->n == 4) feedback = 6; } void tester6(const boost::shared_ptr
* t) { if ((*t)->n == 4) feedback = 7; } void tester7(boost::shared_ptr
* t) { if ((*t)->n == 4) feedback = 8; } boost::shared_ptr
tester9() { feedback = 9; return boost::shared_ptr
(new base()); } void tester10(boost::shared_ptr
const& r) { if (r->n == 4) feedback = 10; } void tester11(boost::shared_ptr
const& r) { if (r->n == 4) feedback = 11; } void tester12(boost::shared_ptr
const& r) { if (r->n2 == 7) feedback = 12; } void test_main(lua_State* L) { boost::shared_ptr
base_ptr(new base()); using namespace luabind; module(L) [ def("tester", &tester), def("tester", &tester_), def("tester2", &tester2), def("tester3", &tester3), def("tester4", &tester4), def("tester5", &tester5), def("tester6", &tester6), def("tester7", &tester7), def("tester9", &tester9), def("tester10", &tester10), def("tester11", &tester11), def("tester12", &tester12), class_
>("base") .def(constructor<>()) .def("f", &base::f), class_
>("derived") .def(constructor<>()) .def("f", &derived::f) ]; object g = globals(L); g["ptr"] = base_ptr; DOSTRING(L, "tester(ptr)"); TEST_CHECK(feedback == 1); DOSTRING(L, "a = base()\n" "b = derived()\n"); DOSTRING(L, "tester(b)"); TEST_CHECK(feedback == 2); DOSTRING(L, "tester(a)"); TEST_CHECK(feedback == 1); DOSTRING(L, "tester2(b)"); TEST_CHECK(feedback == 3); DOSTRING(L, "tester3(b)"); TEST_CHECK(feedback == 4); DOSTRING(L, "tester4(b)"); TEST_CHECK(feedback == 5); feedback = 0; DOSTRING(L, "tester4(a)"); TEST_CHECK(feedback == 5); DOSTRING(L, "tester10(b)"); TEST_CHECK(feedback == 10); DOSTRING(L, "tester11(b)"); TEST_CHECK(feedback == 11); /* this test is messed up, shared_ptr
isn't even registered DOSTRING_EXPECTED( L , "tester12(b)" , "no match for function call 'tester12' with the parameters (derived)\n" "candidates are:\n" "tester12(const custom&)\n"); */ object nil = globals(L)["non_existing_variable_is_nil"]; TEST_CHECK(object_cast
>(nil).get() == 0); TEST_CHECK(object_cast
>(nil).get() == 0); }
test_held_type.cpp
Page URL
File URL
Prev
15/29
Next
Download
( 5 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.