[android] Share common code between test runners
This commit is contained in:
34
platform/android/src/test/collator_test_stub.cpp
Normal file
34
platform/android/src/test/collator_test_stub.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
#include <mbgl/i18n/collator.hpp>
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace mbgl {
|
||||
namespace platform {
|
||||
|
||||
class Collator::Impl {
|
||||
public:
|
||||
Impl(optional<std::string>) {}
|
||||
|
||||
bool operator==(const Impl&) const { return true; }
|
||||
|
||||
int compare(const std::string&, const std::string&) const { return 0; }
|
||||
|
||||
std::string resolvedLocale() const { return ""; }
|
||||
};
|
||||
|
||||
Collator::Collator(bool, bool, optional<std::string> locale_) : impl(std::make_shared<Impl>(std::move(locale_))) {}
|
||||
|
||||
int Collator::compare(const std::string& lhs, const std::string& rhs) const {
|
||||
return impl->compare(lhs, rhs);
|
||||
}
|
||||
|
||||
bool Collator::operator==(const Collator& other) const {
|
||||
return *impl == *(other.impl);
|
||||
}
|
||||
|
||||
std::string Collator::resolvedLocale() const {
|
||||
return impl->resolvedLocale();
|
||||
}
|
||||
|
||||
} // namespace platform
|
||||
} // namespace mbgl
|
||||
Reference in New Issue
Block a user