maplibre support for Qt6 and MSVC 2019 (#125)
* [qt] Updating CMake project files for Qt6 * [qt] Updating non-test projects for Qt6 and msvc2019 * [qt] Test fixes for Qt6 and msvc2019 * [qt] Link whole test archive for Qt and msvc2019 * [qt] Fixing Qt6 headless backend renderer * [qt] Fixes for test failures * [qt] Expression and style parser test fixes * [qt] Backwards compatibility with Qt5 and Qt6 Minimum version is Qt 5.4 due to use of QOpenGLWidget * [qt] LLVM is no longer required for a Windows build * [msvc] msvc2019 fixes for maplibre * Update test/storage/offline_database.test.cpp Co-authored-by: Tadej Novak <tadej@tano.si> * Vector + const is not standard C++ Co-authored-by: Tadej Novak <tadej@tano.si>
This commit is contained in:
@@ -4,10 +4,18 @@
|
||||
#include <mbgl/util/platform.hpp>
|
||||
#include <mbgl/util/run_loop.hpp>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <climits>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#if defined(WIN32)
|
||||
#include <Windows.h>
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX MAX_PATH
|
||||
#endif /* PATH_MAX */
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
std::string toAbsoluteURL(const std::string& fileName) {
|
||||
@@ -136,15 +144,22 @@ TEST(LocalFileSource, URLLimit) {
|
||||
|
||||
size_t length = PATH_MAX - toAbsoluteURL("").size();
|
||||
LocalFileSource fs(ResourceOptions::Default());
|
||||
char filename[length];
|
||||
char* filename = new char[length];
|
||||
memset(filename, 'x', length);
|
||||
|
||||
std::string url(filename, length);
|
||||
|
||||
delete[] filename;
|
||||
|
||||
std::unique_ptr<AsyncRequest> req = fs.request({ Resource::Unknown, toAbsoluteURL(url) }, [&](Response res) {
|
||||
req.reset();
|
||||
ASSERT_NE(nullptr, res.error);
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
// Microsoft Visual Studio defines PATH_MAX as 260, less than the limit to trigger an error with reason "Other"
|
||||
EXPECT_EQ(Response::Error::Reason::NotFound, res.error->reason);
|
||||
#else
|
||||
EXPECT_EQ(Response::Error::Reason::Other, res.error->reason);
|
||||
#endif
|
||||
ASSERT_FALSE(res.data.get());
|
||||
loop.stop();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user