-
Notifications
You must be signed in to change notification settings - Fork 144
[winrt support] Disabling usage of some banned APIs for the Windows Runtime #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Attaching a debugger is disabled if running tests for the Windows Runtime. Disabled some usage of environment variables, which aren't avaliable, when under the Windows Runtime.
include/boost/test/debug.hpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
Please remove this line.
|
Thanks for the pull request. Would it be possible to remove all the copyright notice please? |
|
No I don't believe so, otherwise I wouldn't be able to contribute the changes back. Our legal team has approved the contributions only if they contain the copyright for source code changes. This hasn't been in any issue with several other contributions to other libraries is Boost. Is this going to be a blocker for you? For example see boostorg/system#3 and boostorg/predef#5. Thanks, |
|
I do not know as I am not the copyright holder. I should ask the other members and I'll get back to you. |
|
Ok let me know, it hasn't been a problem so far. CreateFile isn't deprecated it just isn't an API allowed in Windows phone and store applications. It is only available for Windows desktop applications, but isn't deprecated. Thanks, |
|
I I've never understood 100% what these copyright statement are for. On Tue, Jun 17, 2014 at 2:58 PM, stgates [email protected] wrote:
Gennadiy Rozental |
|
Yes my understanding is the copyright is only for the changes made. This has been the approach I've followed successfully contributing to other libraries in Boost. Steve |
|
Ok after some more discussion with legal at Microsoft they've agreed to let me contribute these back without a Microsoft copyright. They've been removed from all the source files I changed here. |
|
Ping! This has been pending for some time and I've addressed all the comments made. Is this change likely to be accepted? Thanks, |
|
Sorry for the delay. Best, On 02 Sep 2014, at 19:56, Steve Gates [email protected] wrote:
|
|
Great thanks Raffi! |
|
Hi, Sorry, it takes more time than expected. I am on it.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to add definitions like
#if !defined(UNDER_CE) && !BOOST_PLAT_WINDOWS_RUNTIME
#define BOOST_TEST_HAS_GETENV_SUPPORT
#define BOOST_TEST_HAS_SETENV_SUPPORT
#endif
and then to propagate these macros in the code, like in cpp_main.cpp
|
Hi Steve, I putted some comments on your pull request. Could you please review them? Thanks, On 04 Sep 2014, at 09:38, Raffi Enficiaud [email protected] wrote:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this last line is erroneous, since we want the environment variable support on eg linux or OSX. Could be replaced by
#if defined(BOOST_TEST_HAS_GETENV_SUPPORT) || defined(BOOST_TEST_HAS_SETENV_SUPPORT)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same remark as for line 74 in file cpp_main.ipp
|
Yes I'll take a look at your comments and address them. Unfortunately I'm busy the next few days and with CppCon next week, I probably won't get to this until the week after. |
|
I can also do some parts of course. Best, On 04 Sep 2014, at 19:23, Steve Gates [email protected] wrote:
|
|
@stgates Pinging! Any chance this work could be revived? I would LOVE to be using Boost UTF on my Windows Runtime projects. |
|
@jneidlinger These changes here were to enable running some of the Boost tests covering the Windows Runtime. I'm not entirely sure how easy it would be to use for testing arbitrary Windows Runtime projects. More of the Windows APIs are being unbanned and allowed in the Windows Runtime, for example the socket and threading APIs. I'm canceling this pull request, as I think the changes are a bit invasive and going to be difficult to maintain. |
|
@stgates I was more interested in using the same Boost tests we currently use to test some cross platform native libraries we share between Windows apps and WinRT apps. Are you thinking enough banned APIs will be opened up to use Boost UTF out of the box (Windows) in the future? Thanks for the update, I appreciate it. |
|
@jneidlinger I don't know if that will happened, but I don't have any more time to spend on this pull request. Also without regular testing it would be quite easy to break this work. |
Detected by asan with gcc10:
==863==ERROR: AddressSanitizer: invalid-pointer-pair: 0x7ffe21c831b0 0x00000c26f470
#0 0x2688702 in boost::unit_test::framework::state::priority_order::operator()(boost::unit_test::test_observer*, boost::unit_test::test_observer*) const libs/test/include/boost/test/impl/framework.ipp:865
boostorg#1 0x2688702 in std::_Rb_tree<boost::unit_test::test_observer*, boost::unit_test::test_observer*, std::_Identity<boost::unit_test::test_observer*>, boost::unit_test::framework::state::priority_order, std::allocator<boost::unit_test::test_observer*> >::_M_get_insert_unique_pos(boost::unit_test::test_observer* const&) /opt/gcc-10.2.0/include/c++/10.2.0/bits/stl_tree.h:2101
boostorg#2 0x268aafb in std::pair<std::_Rb_tree_iterator<boost::unit_test::test_observer*>, bool> std::_Rb_tree<boost::unit_test::test_observer*, boost::unit_test::test_observer*, std::_Identity<boost::unit_test::test_observer*>, boost::unit_test::framework::state::priority_order, std::allocator<boost::unit_test::test_observer*> >::_M_insert_unique<boost::unit_test::test_observer*>(boost::unit_test::test_observer*&&) /opt/gcc-10.2.0/include/c++/10.2.0/bits/stl_tree.h:2154
boostorg#3 0x2614ac4 in std::set<boost::unit_test::test_observer*, boost::unit_test::framework::state::priority_order, std::allocator<boost::unit_test::test_observer*> >::insert(boost::unit_test::test_observer*&&) /opt/gcc-10.2.0/include/c++/10.2.0/bits/stl_set.h:521
boostorg#4 0x2614ac4 in boost::unit_test::framework::register_observer(boost::unit_test::test_observer&) libs/test/include/boost/test/impl/framework.ipp:1380
boostorg#5 0x2642b56 in boost::unit_test::framework::register_observer_helper::register_obs() libs/test/include/boost/test/impl/framework.ipp:1627
boostorg#6 0x2642b56 in boost::unit_test::framework::run(unsigned long, bool) libs/test/include/boost/test/impl/framework.ipp:1731
boostorg#7 0x27f6c77 in boost::unit_test::unit_test_main(boost::unit_test::test_suite* (*)(int, char**), int, char**) libs/test/include/boost/test/impl/unit_test_main.ipp:250
boostorg#8 0x27f9495 in main libs/test/include/boost/test/impl/unit_test_main.ipp:306
boostorg#9 0x7f8d8b3c1554 in __libc_start_main ../csu/libc-start.c:266
boostorg#10 0x568e0d (test+0x568e0d)
Detected by asan with gcc10:
==863==ERROR: AddressSanitizer: invalid-pointer-pair: 0x7ffe21c831b0 0x00000c26f470
#0 0x2688702 in boost::unit_test::framework::state::priority_order::operator()(boost::unit_test::test_observer*, boost::unit_test::test_observer*) const libs/test/include/boost/test/impl/framework.ipp:865
boostorg#1 0x2688702 in std::_Rb_tree<boost::unit_test::test_observer*, boost::unit_test::test_observer*, std::_Identity<boost::unit_test::test_observer*>, boost::unit_test::framework::state::priority_order, std::allocator<boost::unit_test::test_observer*> >::_M_get_insert_unique_pos(boost::unit_test::test_observer* const&) /opt/gcc-10.2.0/include/c++/10.2.0/bits/stl_tree.h:2101
boostorg#2 0x268aafb in std::pair<std::_Rb_tree_iterator<boost::unit_test::test_observer*>, bool> std::_Rb_tree<boost::unit_test::test_observer*, boost::unit_test::test_observer*, std::_Identity<boost::unit_test::test_observer*>, boost::unit_test::framework::state::priority_order, std::allocator<boost::unit_test::test_observer*> >::_M_insert_unique<boost::unit_test::test_observer*>(boost::unit_test::test_observer*&&) /opt/gcc-10.2.0/include/c++/10.2.0/bits/stl_tree.h:2154
boostorg#3 0x2614ac4 in std::set<boost::unit_test::test_observer*, boost::unit_test::framework::state::priority_order, std::allocator<boost::unit_test::test_observer*> >::insert(boost::unit_test::test_observer*&&) /opt/gcc-10.2.0/include/c++/10.2.0/bits/stl_set.h:521
boostorg#4 0x2614ac4 in boost::unit_test::framework::register_observer(boost::unit_test::test_observer&) libs/test/include/boost/test/impl/framework.ipp:1380
boostorg#5 0x2642b56 in boost::unit_test::framework::register_observer_helper::register_obs() libs/test/include/boost/test/impl/framework.ipp:1627
boostorg#6 0x2642b56 in boost::unit_test::framework::run(unsigned long, bool) libs/test/include/boost/test/impl/framework.ipp:1731
boostorg#7 0x27f6c77 in boost::unit_test::unit_test_main(boost::unit_test::test_suite* (*)(int, char**), int, char**) libs/test/include/boost/test/impl/unit_test_main.ipp:250
boostorg#8 0x27f9495 in main libs/test/include/boost/test/impl/unit_test_main.ipp:306
boostorg#9 0x7f8d8b3c1554 in __libc_start_main ../csu/libc-start.c:266
boostorg#10 0x568e0d (test+0x568e0d)
Clarify formatting
Adding a macro for turning on/off for debugger support. Attaching a debugger is disabled if running tests for the Windows Runtime.
Disabled some usage of environment variables, which aren't avaliable, when under the Windows Runtime.
Replaced one usage of CreateFileA, which isn't allow in the Windows Runtime with fopen.