Skip to content
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

auto-test app for sync functionality #1139

Merged
merged 6 commits into from Aug 20, 2018
Merged

auto-test app for sync functionality #1139

merged 6 commits into from Aug 20, 2018

Conversation

mattw-mega
Copy link
Contributor

Added a test app for sync. It's not finished yet but has some useful tests and may be good to have available in other branches. I've used some c++17 features just in that (without affecting the main SDK - mostly std::filesystem) which prompted this next one:

Resolved some issues when building with a c++17 compliant compiler, mainly that it defines std::byte which clashes with the byte we were defining, and probably with others. The main change is removing 'using namespace std' from headers (even inside the mega namespace it still caused clashes). Just 'using std::map' to pull the specific items we need into the mega namespace works pretty well.

…ng the gtest framework.

Also some updates to be able to build with a C++17 compiler, without breaking compilation under older standards.
The main clash with C++17 was std::byte which is not compatible with our usage.  Additionally there were a few things that were deprecated and are now removed, eg. auto_ptr and ptr_fun
@JenkinsMega
Copy link

megasdk_PR SUCCEDED (85) 👍

@JenkinsMega
Copy link

megasdk_PR SUCCEDED (97) 👍

@javiserrano
Copy link
Contributor

I'm having some problems to build MEGAsync with this branch due to conflicts between mega::byte and another definition of byte in rpcndr.h (from the Windows SDK). The compilation fails in cryptopp/secblock.h with Cryptopp 5.6.3 with QTCreator and the Visual Studio 2015 toolchain. There are other similar compilation errors in megaapi_impl.cpp but in that case the fix is trivial because we can change byte by mega::byte. I will investigate further.

added a couple of tests that use it.  Tests also confirm the local sync
debris folders are in the correct state.
@JenkinsMega
Copy link

megasdk_PR SUCCEDED (98) 👍

@mattw-mega
Copy link
Contributor Author

I see cryptopp have made an adjustment for std::byte also, they too have stopped relying on a global definition and defined their own in their own namespace. I see that in version 610 which I've been building against. From their config.h: ```// Originally in global namespace to avoid ambiguity with other byte typedefs.
// Moved to Crypto++ namespace due to C++17, std::byte and potential compile problems. Also see
// http://www.cryptopp.com/wiki/std::byte and http://github.com/weidai11/cryptopp/issues/442
// typedef unsigned char byte;
#define CRYPTOPP_NO_GLOBAL_BYTE 1

NAMESPACE_BEGIN(CryptoPP)

typedef unsigned char byte;```

@JenkinsMega
Copy link

megasdk_PR SUCCEDED (104) 👍

@JenkinsMega
Copy link

megasdk_PR SUCCEDED (105) 👍

@javiserrano javiserrano merged commit 1cf25fa into develop Aug 20, 2018
@javiserrano javiserrano deleted the test_sync branch August 20, 2018 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants