Commit 3c1ea5cb authored by Andrew Twyman's avatar Andrew Twyman Committed by Jacob Potter

Add a C++ Namespace to test-suite

parent 3e817fcb
...@@ -46,4 +46,6 @@ abstract class Marshal(spec: Spec) { ...@@ -46,4 +46,6 @@ abstract class Marshal(spec: Spec) {
case Some("") => "::" + t case Some("") => "::" + t
case Some(s) => "::" + s + "::" + t case Some(s) => "::" + s + "::" + t
} }
protected def withCppNs(t: String) = withNs(Some(spec.cppNamespace), t)
} }
...@@ -331,6 +331,8 @@ abstract class Generator(spec: Spec) ...@@ -331,6 +331,8 @@ abstract class Generator(spec: Spec)
case Some(s) => "::" + s + "::" + t case Some(s) => "::" + s + "::" + t
} }
def withCppNs(t: String) = withNs(Some(spec.cppNamespace), t)
def writeAlignedCall(w: IndentWriter, call: String, params: Seq[Field], delim: String, end: String, f: Field => String): IndentWriter = { def writeAlignedCall(w: IndentWriter, call: String, params: Seq[Field], delim: String, end: String, f: Field => String): IndentWriter = {
w.w(call) w.w(call)
val skipFirst = new SkipFirst val skipFirst = new SkipFirst
......
...@@ -8,4 +8,4 @@ objc: ...@@ -8,4 +8,4 @@ objc:
cd objc; xcodebuild -sdk iphonesimulator -project DjinniObjcTest.xcodeproj -scheme DjinniObjcTest test cd objc; xcodebuild -sdk iphonesimulator -project DjinniObjcTest.xcodeproj -scheme DjinniObjcTest test
java: java:
cd java; ant test cd java && ant test
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
#include "assorted_primitives.hpp" // my header #include "assorted_primitives.hpp" // my header
namespace testsuite {
bool operator==(const AssortedPrimitives& lhs, const AssortedPrimitives& rhs) { bool operator==(const AssortedPrimitives& lhs, const AssortedPrimitives& rhs) {
return lhs.b == rhs.b && return lhs.b == rhs.b &&
...@@ -24,3 +26,5 @@ bool operator==(const AssortedPrimitives& lhs, const AssortedPrimitives& rhs) { ...@@ -24,3 +26,5 @@ bool operator==(const AssortedPrimitives& lhs, const AssortedPrimitives& rhs) {
bool operator!=(const AssortedPrimitives& lhs, const AssortedPrimitives& rhs) { bool operator!=(const AssortedPrimitives& lhs, const AssortedPrimitives& rhs) {
return !(lhs == rhs); return !(lhs == rhs);
} }
} // namespace testsuite
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
#include <experimental/optional> #include <experimental/optional>
#include <utility> #include <utility>
namespace testsuite {
struct AssortedPrimitives final { struct AssortedPrimitives final {
bool b; bool b;
int8_t eight; int8_t eight;
...@@ -56,3 +58,5 @@ struct AssortedPrimitives final { ...@@ -56,3 +58,5 @@ struct AssortedPrimitives final {
, o_fsixtyfour(std::move(o_fsixtyfour)) , o_fsixtyfour(std::move(o_fsixtyfour))
{} {}
}; };
} // namespace testsuite
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
#include <string> #include <string>
#include <vector> #include <vector>
namespace testsuite {
/** Client interface */ /** Client interface */
class ClientInterface { class ClientInterface {
public: public:
...@@ -21,3 +23,5 @@ public: ...@@ -21,3 +23,5 @@ public:
virtual std::string return_str() = 0; virtual std::string return_str() = 0;
}; };
} // namespace testsuite
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#include <string> #include <string>
#include <utility> #include <utility>
namespace testsuite {
/** Record returned by a client */ /** Record returned by a client */
struct ClientReturnedRecord final { struct ClientReturnedRecord final {
int64_t record_id; int64_t record_id;
...@@ -22,3 +24,5 @@ struct ClientReturnedRecord final { ...@@ -22,3 +24,5 @@ struct ClientReturnedRecord final {
, misc(std::move(misc)) , misc(std::move(misc))
{} {}
}; };
} // namespace testsuite
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#include <functional> #include <functional>
namespace testsuite {
enum class color : int { enum class color : int {
RED, RED,
ORANGE, ORANGE,
...@@ -20,11 +22,13 @@ enum class color : int { ...@@ -20,11 +22,13 @@ enum class color : int {
VIOLET, VIOLET,
}; };
} // namespace testsuite
namespace std { namespace std {
template <> template <>
struct hash<::color> { struct hash<::testsuite::color> {
size_t operator()(::color type) const { size_t operator()(::testsuite::color type) const {
return std::hash<int>()(static_cast<int>(type)); return std::hash<int>()(static_cast<int>(type));
} }
}; };
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
#include "constants.hpp" // my header #include "constants.hpp" // my header
namespace testsuite {
bool const Constants::BOOL_CONSTANT = true; bool const Constants::BOOL_CONSTANT = true;
int8_t const Constants::I8_CONSTANT = 1; int8_t const Constants::I8_CONSTANT = 1;
...@@ -24,3 +26,5 @@ std::experimental::optional<int32_t> const Constants::OPTIONAL_INTEGER_CONSTANT ...@@ -24,3 +26,5 @@ std::experimental::optional<int32_t> const Constants::OPTIONAL_INTEGER_CONSTANT
Constants const Constants::OBJECT_CONSTANT = Constants( Constants const Constants::OBJECT_CONSTANT = Constants(
Constants::I32_CONSTANT /* some_integer */ , Constants::I32_CONSTANT /* some_integer */ ,
Constants::STRING_CONSTANT /* some_string */ ); Constants::STRING_CONSTANT /* some_string */ );
} // namespace testsuite
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#include <string> #include <string>
#include <utility> #include <utility>
namespace testsuite {
/** Record containing constants */ /** Record containing constants */
struct Constants final { struct Constants final {
...@@ -45,3 +47,5 @@ struct Constants final { ...@@ -45,3 +47,5 @@ struct Constants final {
, some_string(std::move(some_string)) , some_string(std::move(some_string))
{} {}
}; };
} // namespace testsuite
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
#include "constants_interface.hpp" // my header #include "constants_interface.hpp" // my header
namespace testsuite {
bool const ConstantsInterface::BOOL_CONSTANT = true; bool const ConstantsInterface::BOOL_CONSTANT = true;
int8_t const ConstantsInterface::I8_CONSTANT = 1; int8_t const ConstantsInterface::I8_CONSTANT = 1;
...@@ -16,3 +18,5 @@ int64_t const ConstantsInterface::I64_CONSTANT = 4; ...@@ -16,3 +18,5 @@ int64_t const ConstantsInterface::I64_CONSTANT = 4;
float const ConstantsInterface::F32_CONSTANT = 5.0f; float const ConstantsInterface::F32_CONSTANT = 5.0f;
double const ConstantsInterface::F64_CONSTANT = 5.0; double const ConstantsInterface::F64_CONSTANT = 5.0;
} // namespace testsuite
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#include <cstdint> #include <cstdint>
namespace testsuite {
/** Interface containing constants */ /** Interface containing constants */
class ConstantsInterface { class ConstantsInterface {
public: public:
...@@ -32,3 +34,5 @@ public: ...@@ -32,3 +34,5 @@ public:
virtual void dummy() = 0; virtual void dummy() = 0;
}; };
} // namespace testsuite
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include <cstdint> #include <cstdint>
#include <memory> #include <memory>
namespace testsuite {
class CppException { class CppException {
public: public:
virtual ~CppException() {} virtual ~CppException() {}
...@@ -14,3 +16,5 @@ public: ...@@ -14,3 +16,5 @@ public:
static std::shared_ptr<CppException> get(); static std::shared_ptr<CppException> get();
}; };
} // namespace testsuite
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
#include "date_record.hpp" // my header #include "date_record.hpp" // my header
namespace testsuite {
bool operator==(const DateRecord& lhs, const DateRecord& rhs) { bool operator==(const DateRecord& lhs, const DateRecord& rhs) {
return lhs.created_at == rhs.created_at; return lhs.created_at == rhs.created_at;
...@@ -33,3 +35,5 @@ bool operator<=(const DateRecord& lhs, const DateRecord& rhs) { ...@@ -33,3 +35,5 @@ bool operator<=(const DateRecord& lhs, const DateRecord& rhs) {
bool operator>=(const DateRecord& lhs, const DateRecord& rhs) { bool operator>=(const DateRecord& lhs, const DateRecord& rhs) {
return !(lhs < rhs); return !(lhs < rhs);
} }
} // namespace testsuite
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include <chrono> #include <chrono>
#include <utility> #include <utility>
namespace testsuite {
struct DateRecord final { struct DateRecord final {
std::chrono::system_clock::time_point created_at; std::chrono::system_clock::time_point created_at;
...@@ -22,3 +24,5 @@ struct DateRecord final { ...@@ -22,3 +24,5 @@ struct DateRecord final {
: created_at(std::move(created_at)) : created_at(std::move(created_at))
{} {}
}; };
} // namespace testsuite
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#include <utility> #include <utility>
namespace testsuite {
/** /**
* Empty record * Empty record
* (Second line of multi-line documentation. * (Second line of multi-line documentation.
...@@ -12,3 +14,5 @@ ...@@ -12,3 +14,5 @@
*/ */
struct EmptyRecord final { struct EmptyRecord final {
}; };
} // namespace testsuite
...@@ -11,5 +11,5 @@ class ExternInterface1 { ...@@ -11,5 +11,5 @@ class ExternInterface1 {
public: public:
virtual ~ExternInterface1() {} virtual ~ExternInterface1() {}
virtual ::ClientReturnedRecord foo(const std::shared_ptr<::ClientInterface> & i) = 0; virtual ::testsuite::ClientReturnedRecord foo(const std::shared_ptr<::testsuite::ClientInterface> & i) = 0;
}; };
...@@ -11,5 +11,5 @@ class ExternInterface2 { ...@@ -11,5 +11,5 @@ class ExternInterface2 {
public: public:
virtual ~ExternInterface2() {} virtual ~ExternInterface2() {}
virtual ExternRecordWithDerivings foo(const std::shared_ptr<::TestHelpers> & i) = 0; virtual ExternRecordWithDerivings foo(const std::shared_ptr<::testsuite::TestHelpers> & i) = 0;
}; };
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
/** This file tests YAML dumped by Djinni can be parsed back in */ /** This file tests YAML dumped by Djinni can be parsed back in */
struct ExternRecordWithDerivings final { struct ExternRecordWithDerivings final {
::RecordWithDerivings member; ::testsuite::RecordWithDerivings member;
::color e; ::testsuite::color e;
friend bool operator==(const ExternRecordWithDerivings& lhs, const ExternRecordWithDerivings& rhs); friend bool operator==(const ExternRecordWithDerivings& lhs, const ExternRecordWithDerivings& rhs);
friend bool operator!=(const ExternRecordWithDerivings& lhs, const ExternRecordWithDerivings& rhs); friend bool operator!=(const ExternRecordWithDerivings& lhs, const ExternRecordWithDerivings& rhs);
...@@ -21,8 +21,8 @@ struct ExternRecordWithDerivings final { ...@@ -21,8 +21,8 @@ struct ExternRecordWithDerivings final {
friend bool operator<=(const ExternRecordWithDerivings& lhs, const ExternRecordWithDerivings& rhs); friend bool operator<=(const ExternRecordWithDerivings& lhs, const ExternRecordWithDerivings& rhs);
friend bool operator>=(const ExternRecordWithDerivings& lhs, const ExternRecordWithDerivings& rhs); friend bool operator>=(const ExternRecordWithDerivings& lhs, const ExternRecordWithDerivings& rhs);
ExternRecordWithDerivings(::RecordWithDerivings member, ExternRecordWithDerivings(::testsuite::RecordWithDerivings member,
::color e) ::testsuite::color e)
: member(std::move(member)) : member(std::move(member))
, e(std::move(e)) , e(std::move(e))
{} {}
......
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#include <unordered_map> #include <unordered_map>
#include <utility> #include <utility>
namespace testsuite {
struct MapDateRecord final { struct MapDateRecord final {
std::unordered_map<std::string, std::chrono::system_clock::time_point> dates_by_id; std::unordered_map<std::string, std::chrono::system_clock::time_point> dates_by_id;
...@@ -15,3 +17,5 @@ struct MapDateRecord final { ...@@ -15,3 +17,5 @@ struct MapDateRecord final {
: dates_by_id(std::move(dates_by_id)) : dates_by_id(std::move(dates_by_id))
{} {}
}; };
} // namespace testsuite
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
namespace testsuite {
struct MapListRecord final { struct MapListRecord final {
std::vector<std::unordered_map<std::string, int64_t>> map_list; std::vector<std::unordered_map<std::string, int64_t>> map_list;
...@@ -16,3 +18,5 @@ struct MapListRecord final { ...@@ -16,3 +18,5 @@ struct MapListRecord final {
: map_list(std::move(map_list)) : map_list(std::move(map_list))
{} {}
}; };
} // namespace testsuite
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#include <unordered_map> #include <unordered_map>
#include <utility> #include <utility>
namespace testsuite {
struct MapRecord final { struct MapRecord final {
std::unordered_map<std::string, int64_t> map; std::unordered_map<std::string, int64_t> map;
std::unordered_map<int32_t, int32_t> imap; std::unordered_map<int32_t, int32_t> imap;
...@@ -18,3 +20,5 @@ struct MapRecord final { ...@@ -18,3 +20,5 @@ struct MapRecord final {
, imap(std::move(imap)) , imap(std::move(imap))
{} {}
}; };
} // namespace testsuite
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
namespace testsuite {
struct NestedCollection final { struct NestedCollection final {
std::vector<std::unordered_set<std::string>> set_list; std::vector<std::unordered_set<std::string>> set_list;
...@@ -15,3 +17,5 @@ struct NestedCollection final { ...@@ -15,3 +17,5 @@ struct NestedCollection final {
: set_list(std::move(set_list)) : set_list(std::move(set_list))
{} {}
}; };
} // namespace testsuite
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
namespace testsuite {
struct PrimitiveList final { struct PrimitiveList final {
std::vector<int64_t> list; std::vector<int64_t> list;
...@@ -14,3 +16,5 @@ struct PrimitiveList final { ...@@ -14,3 +16,5 @@ struct PrimitiveList final {
: list(std::move(list)) : list(std::move(list))
{} {}
}; };
} // namespace testsuite
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
#include "record_with_derivings.hpp" // my header #include "record_with_derivings.hpp" // my header
namespace testsuite {
bool operator==(const RecordWithDerivings& lhs, const RecordWithDerivings& rhs) { bool operator==(const RecordWithDerivings& lhs, const RecordWithDerivings& rhs) {
return lhs.key1 == rhs.key1 && return lhs.key1 == rhs.key1 &&
...@@ -40,3 +42,5 @@ bool operator<=(const RecordWithDerivings& lhs, const RecordWithDerivings& rhs) ...@@ -40,3 +42,5 @@ bool operator<=(const RecordWithDerivings& lhs, const RecordWithDerivings& rhs)
bool operator>=(const RecordWithDerivings& lhs, const RecordWithDerivings& rhs) { bool operator>=(const RecordWithDerivings& lhs, const RecordWithDerivings& rhs) {
return !(lhs < rhs); return !(lhs < rhs);
} }
} // namespace testsuite
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
#include <string> #include <string>
#include <utility> #include <utility>
namespace testsuite {
struct RecordWithDerivings final { struct RecordWithDerivings final {
int32_t key1; int32_t key1;
std::string key2; std::string key2;
...@@ -26,3 +28,5 @@ struct RecordWithDerivings final { ...@@ -26,3 +28,5 @@ struct RecordWithDerivings final {
, key2(std::move(key2)) , key2(std::move(key2))
{} {}
}; };
} // namespace testsuite
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
#include "record_with_duration_and_derivings.hpp" // my header #include "record_with_duration_and_derivings.hpp" // my header
namespace testsuite {
bool operator==(const RecordWithDurationAndDerivings& lhs, const RecordWithDurationAndDerivings& rhs) { bool operator==(const RecordWithDurationAndDerivings& lhs, const RecordWithDurationAndDerivings& rhs) {
return lhs.dt == rhs.dt; return lhs.dt == rhs.dt;
...@@ -33,3 +35,5 @@ bool operator<=(const RecordWithDurationAndDerivings& lhs, const RecordWithDurat ...@@ -33,3 +35,5 @@ bool operator<=(const RecordWithDurationAndDerivings& lhs, const RecordWithDurat
bool operator>=(const RecordWithDurationAndDerivings& lhs, const RecordWithDurationAndDerivings& rhs) { bool operator>=(const RecordWithDurationAndDerivings& lhs, const RecordWithDurationAndDerivings& rhs) {
return !(lhs < rhs); return !(lhs < rhs);
} }
} // namespace testsuite
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include <chrono> #include <chrono>
#include <utility> #include <utility>
namespace testsuite {
struct RecordWithDurationAndDerivings final { struct RecordWithDurationAndDerivings final {
std::chrono::duration<double, std::nano> dt; std::chrono::duration<double, std::nano> dt;
...@@ -22,3 +24,5 @@ struct RecordWithDurationAndDerivings final { ...@@ -22,3 +24,5 @@ struct RecordWithDurationAndDerivings final {
: dt(std::move(dt)) : dt(std::move(dt))
{} {}
}; };
} // namespace testsuite
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
#include "record_with_nested_derivings.hpp" // my header #include "record_with_nested_derivings.hpp" // my header
namespace testsuite {
bool operator==(const RecordWithNestedDerivings& lhs, const RecordWithNestedDerivings& rhs) { bool operator==(const RecordWithNestedDerivings& lhs, const RecordWithNestedDerivings& rhs) {
return lhs.key == rhs.key && return lhs.key == rhs.key &&
...@@ -40,3 +42,5 @@ bool operator<=(const RecordWithNestedDerivings& lhs, const RecordWithNestedDeri ...@@ -40,3 +42,5 @@ bool operator<=(const RecordWithNestedDerivings& lhs, const RecordWithNestedDeri
bool operator>=(const RecordWithNestedDerivings& lhs, const RecordWithNestedDerivings& rhs) { bool operator>=(const RecordWithNestedDerivings& lhs, const RecordWithNestedDerivings& rhs) {
return !(lhs < rhs); return !(lhs < rhs);
} }
} // namespace testsuite
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
#include <cstdint> #include <cstdint>
#include <utility> #include <utility>
namespace testsuite {
struct RecordWithNestedDerivings final { struct RecordWithNestedDerivings final {
int32_t key; int32_t key;
RecordWithDerivings rec; RecordWithDerivings rec;
...@@ -26,3 +28,5 @@ struct RecordWithNestedDerivings final { ...@@ -26,3 +28,5 @@ struct RecordWithNestedDerivings final {
, rec(std::move(rec)) , rec(std::move(rec))
{} {}
}; };
} // namespace testsuite
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#include <unordered_set> #include <unordered_set>
#include <utility> #include <utility>
namespace testsuite {
struct SetRecord final { struct SetRecord final {
std::unordered_set<std::string> set; std::unordered_set<std::string> set;
std::unordered_set<int32_t> iset; std::unordered_set<int32_t> iset;
...@@ -18,3 +20,5 @@ struct SetRecord final { ...@@ -18,3 +20,5 @@ struct SetRecord final {
, iset(std::move(iset)) , iset(std::move(iset))
{} {}
}; };
} // namespace testsuite
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#include <experimental/optional> #include <experimental/optional>
#include <string> #include <string>
namespace testsuite {
class TestDuration { class TestDuration {
public: public:
virtual ~TestDuration() {} virtual ~TestDuration() {}
...@@ -52,3 +54,5 @@ public: ...@@ -52,3 +54,5 @@ public:
static int64_t unbox(std::experimental::optional<std::chrono::duration<int64_t, std::ratio<1>>> dt); static int64_t unbox(std::experimental::optional<std::chrono::duration<int64_t, std::ratio<1>>> dt);
}; };
} // namespace testsuite
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
#include <unordered_map> #include <unordered_map>
#include <vector> #include <vector>
namespace testsuite {
class ClientInterface; class ClientInterface;
class UserToken; class UserToken;
...@@ -83,3 +85,5 @@ public: ...@@ -83,3 +85,5 @@ public:
static std::vector<uint8_t> id_binary(const std::vector<uint8_t> & b); static std::vector<uint8_t> id_binary(const std::vector<uint8_t> & b);
}; };
} // namespace testsuite
...@@ -5,9 +5,13 @@ ...@@ -5,9 +5,13 @@
#include <string> #include <string>
namespace testsuite {
class UserToken { class UserToken {
public: public:
virtual ~UserToken() {} virtual ~UserToken() {}
virtual std::string whoami() = 0; virtual std::string whoami() = 0;
}; };
} // namespace testsuite
...@@ -10,7 +10,7 @@ namespace djinni_generated { ...@@ -10,7 +10,7 @@ namespace djinni_generated {
class NativeAssortedPrimitives final { class NativeAssortedPrimitives final {
public: public:
using CppType = ::AssortedPrimitives; using CppType = ::testsuite::AssortedPrimitives;
using JniType = jobject; using JniType = jobject;
using Boxed = NativeAssortedPrimitives; using Boxed = NativeAssortedPrimitives;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
namespace djinni_generated { namespace djinni_generated {
NativeClientInterface::NativeClientInterface() : ::djinni::JniInterface<::ClientInterface, NativeClientInterface>() {} NativeClientInterface::NativeClientInterface() : ::djinni::JniInterface<::testsuite::ClientInterface, NativeClientInterface>() {}
NativeClientInterface::~NativeClientInterface() = default; NativeClientInterface::~NativeClientInterface() = default;
...@@ -15,7 +15,7 @@ NativeClientInterface::JavaProxy::JavaProxy(JniType j) : JavaProxyCacheEntry(j) ...@@ -15,7 +15,7 @@ NativeClientInterface::JavaProxy::JavaProxy(JniType j) : JavaProxyCacheEntry(j)
NativeClientInterface::JavaProxy::~JavaProxy() = default; NativeClientInterface::JavaProxy::~JavaProxy() = default;
::ClientReturnedRecord NativeClientInterface::JavaProxy::get_record(int64_t c_record_id, const std::string & c_utf8string, const std::experimental::optional<std::string> & c_misc) { ::testsuite::ClientReturnedRecord NativeClientInterface::JavaProxy::get_record(int64_t c_record_id, const std::string & c_utf8string, const std::experimental::optional<std::string> & c_misc) {
auto jniEnv = ::djinni::jniGetThreadEnv(); auto jniEnv = ::djinni::jniGetThreadEnv();
::djinni::JniLocalScope jscope(jniEnv, 10); ::djinni::JniLocalScope jscope(jniEnv, 10);
const auto& data = ::djinni::JniClass<::djinni_generated::NativeClientInterface>::get(); const auto& data = ::djinni::JniClass<::djinni_generated::NativeClientInterface>::get();
......
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
namespace djinni_generated { namespace djinni_generated {
class NativeClientInterface final : ::djinni::JniInterface<::ClientInterface, NativeClientInterface> { class NativeClientInterface final : ::djinni::JniInterface<::testsuite::ClientInterface, NativeClientInterface> {
public: public:
using CppType = std::shared_ptr<::ClientInterface>; using CppType = std::shared_ptr<::testsuite::ClientInterface>;
using JniType = jobject; using JniType = jobject;
using Boxed = NativeClientInterface; using Boxed = NativeClientInterface;
...@@ -23,21 +23,21 @@ public: ...@@ -23,21 +23,21 @@ public:
private: private:
NativeClientInterface(); NativeClientInterface();
friend ::djinni::JniClass<NativeClientInterface>; friend ::djinni::JniClass<NativeClientInterface>;
friend ::djinni::JniInterface<::ClientInterface, NativeClientInterface>; friend ::djinni::JniInterface<::testsuite::ClientInterface, NativeClientInterface>;
class JavaProxy final : ::djinni::JavaProxyCacheEntry, public ::ClientInterface class JavaProxy final : ::djinni::JavaProxyCacheEntry, public ::testsuite::ClientInterface
{ {
public: public:
JavaProxy(JniType j); JavaProxy(JniType j);
~JavaProxy(); ~JavaProxy();
::ClientReturnedRecord get_record(int64_t record_id, const std::string & utf8string, const std::experimental::optional<std::string> & misc) override; ::testsuite::ClientReturnedRecord get_record(int64_t record_id, const std::string & utf8string, const std::experimental::optional<std::string> & misc) override;
double identifier_check(const std::vector<uint8_t> & data, int32_t r, int64_t jret) override; double identifier_check(const std::vector<uint8_t> & data, int32_t r, int64_t jret) override;
std::string return_str() override; std::string return_str() override;
private: private:
using ::djinni::JavaProxyCacheEntry::getGlobalRef; using ::djinni::JavaProxyCacheEntry::getGlobalRef;
friend ::djinni::JniInterface<::ClientInterface, ::djinni_generated::NativeClientInterface>; friend ::djinni::JniInterface<::testsuite::ClientInterface, ::djinni_generated::NativeClientInterface>;
friend ::djinni::JavaProxyCache<JavaProxy>; friend ::djinni::JavaProxyCache<JavaProxy>;
}; };
......
...@@ -10,7 +10,7 @@ namespace djinni_generated { ...@@ -10,7 +10,7 @@ namespace djinni_generated {
class NativeClientReturnedRecord final { class NativeClientReturnedRecord final {
public: public:
using CppType = ::ClientReturnedRecord; using CppType = ::testsuite::ClientReturnedRecord;
using JniType = jobject; using JniType = jobject;
using Boxed = NativeClientReturnedRecord; using Boxed = NativeClientReturnedRecord;
......
...@@ -10,7 +10,7 @@ namespace djinni_generated { ...@@ -10,7 +10,7 @@ namespace djinni_generated {
class NativeColor final : ::djinni::JniEnum { class NativeColor final : ::djinni::JniEnum {
public: public:
using CppType = ::color; using CppType = ::testsuite::color;
using JniType = jobject; using JniType = jobject;
using Boxed = NativeColor; using Boxed = NativeColor;
......
...@@ -10,7 +10,7 @@ namespace djinni_generated { ...@@ -10,7 +10,7 @@ namespace djinni_generated {
class NativeConstants final { class NativeConstants final {
public: public:
using CppType = ::Constants; using CppType = ::testsuite::Constants;
using JniType = jobject; using JniType = jobject;
using Boxed = NativeConstants; using Boxed = NativeConstants;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
namespace djinni_generated { namespace djinni_generated {
NativeConstantsInterface::NativeConstantsInterface() : ::djinni::JniInterface<::ConstantsInterface, NativeConstantsInterface>("com/dropbox/djinni/test/ConstantsInterface$CppProxy") {} NativeConstantsInterface::NativeConstantsInterface() : ::djinni::JniInterface<::testsuite::ConstantsInterface, NativeConstantsInterface>("com/dropbox/djinni/test/ConstantsInterface$CppProxy") {}
NativeConstantsInterface::~NativeConstantsInterface() = default; NativeConstantsInterface::~NativeConstantsInterface() = default;
...@@ -15,7 +15,7 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_ConstantsInterface_00024Cpp ...@@ -15,7 +15,7 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_ConstantsInterface_00024Cpp
{ {
try { try {
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef); DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
delete reinterpret_cast<djinni::CppProxyHandle<::ConstantsInterface>*>(nativeRef); delete reinterpret_cast<djinni::CppProxyHandle<::testsuite::ConstantsInterface>*>(nativeRef);
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, ) } JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, )
} }
...@@ -23,7 +23,7 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_ConstantsInterface_00024Cpp ...@@ -23,7 +23,7 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_ConstantsInterface_00024Cpp
{ {
try { try {
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef); DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
const auto& ref = ::djinni::CppProxyHandle<::ConstantsInterface>::get(nativeRef); const auto& ref = ::djinni::CppProxyHandle<::testsuite::ConstantsInterface>::get(nativeRef);
ref->dummy(); ref->dummy();
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, ) } JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, )
} }
......
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
namespace djinni_generated { namespace djinni_generated {
class NativeConstantsInterface final : ::djinni::JniInterface<::ConstantsInterface, NativeConstantsInterface> { class NativeConstantsInterface final : ::djinni::JniInterface<::testsuite::ConstantsInterface, NativeConstantsInterface> {
public: public:
using CppType = std::shared_ptr<::ConstantsInterface>; using CppType = std::shared_ptr<::testsuite::ConstantsInterface>;
using JniType = jobject; using JniType = jobject;
using Boxed = NativeConstantsInterface; using Boxed = NativeConstantsInterface;
...@@ -23,7 +23,7 @@ public: ...@@ -23,7 +23,7 @@ public:
private: private:
NativeConstantsInterface(); NativeConstantsInterface();
friend ::djinni::JniClass<NativeConstantsInterface>; friend ::djinni::JniClass<NativeConstantsInterface>;
friend ::djinni::JniInterface<::ConstantsInterface, NativeConstantsInterface>; friend ::djinni::JniInterface<::testsuite::ConstantsInterface, NativeConstantsInterface>;
}; };
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
namespace djinni_generated { namespace djinni_generated {
NativeCppException::NativeCppException() : ::djinni::JniInterface<::CppException, NativeCppException>("com/dropbox/djinni/test/CppException$CppProxy") {} NativeCppException::NativeCppException() : ::djinni::JniInterface<::testsuite::CppException, NativeCppException>("com/dropbox/djinni/test/CppException$CppProxy") {}
NativeCppException::~NativeCppException() = default; NativeCppException::~NativeCppException() = default;
...@@ -16,7 +16,7 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_CppException_00024CppProxy_ ...@@ -16,7 +16,7 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_CppException_00024CppProxy_
{ {
try { try {
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef); DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
delete reinterpret_cast<djinni::CppProxyHandle<::CppException>*>(nativeRef); delete reinterpret_cast<djinni::CppProxyHandle<::testsuite::CppException>*>(nativeRef);
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, ) } JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, )
} }
...@@ -24,7 +24,7 @@ CJNIEXPORT jint JNICALL Java_com_dropbox_djinni_test_CppException_00024CppProxy_ ...@@ -24,7 +24,7 @@ CJNIEXPORT jint JNICALL Java_com_dropbox_djinni_test_CppException_00024CppProxy_
{ {
try { try {
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef); DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
const auto& ref = ::djinni::CppProxyHandle<::CppException>::get(nativeRef); const auto& ref = ::djinni::CppProxyHandle<::testsuite::CppException>::get(nativeRef);
auto r = ref->throw_an_exception(); auto r = ref->throw_an_exception();
return ::djinni::release(::djinni::I32::fromCpp(jniEnv, r)); return ::djinni::release(::djinni::I32::fromCpp(jniEnv, r));
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */) } JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
...@@ -34,7 +34,7 @@ CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_CppException_get(JNIEnv* ...@@ -34,7 +34,7 @@ CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_CppException_get(JNIEnv*
{ {
try { try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv); DJINNI_FUNCTION_PROLOGUE0(jniEnv);
auto r = ::CppException::get(); auto r = ::testsuite::CppException::get();
return ::djinni::release(::djinni_generated::NativeCppException::fromCpp(jniEnv, r)); return ::djinni::release(::djinni_generated::NativeCppException::fromCpp(jniEnv, r));
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */) } JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
} }
......
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
namespace djinni_generated { namespace djinni_generated {
class NativeCppException final : ::djinni::JniInterface<::CppException, NativeCppException> { class NativeCppException final : ::djinni::JniInterface<::testsuite::CppException, NativeCppException> {
public: public:
using CppType = std::shared_ptr<::CppException>; using CppType = std::shared_ptr<::testsuite::CppException>;
using JniType = jobject; using JniType = jobject;
using Boxed = NativeCppException; using Boxed = NativeCppException;
...@@ -23,7 +23,7 @@ public: ...@@ -23,7 +23,7 @@ public:
private: private:
NativeCppException(); NativeCppException();
friend ::djinni::JniClass<NativeCppException>; friend ::djinni::JniClass<NativeCppException>;
friend ::djinni::JniInterface<::CppException, NativeCppException>; friend ::djinni::JniInterface<::testsuite::CppException, NativeCppException>;
}; };
......
...@@ -10,7 +10,7 @@ namespace djinni_generated { ...@@ -10,7 +10,7 @@ namespace djinni_generated {
class NativeDateRecord final { class NativeDateRecord final {
public: public:
using CppType = ::DateRecord; using CppType = ::testsuite::DateRecord;
using JniType = jobject; using JniType = jobject;
using Boxed = NativeDateRecord; using Boxed = NativeDateRecord;
......
...@@ -10,7 +10,7 @@ namespace djinni_generated { ...@@ -10,7 +10,7 @@ namespace djinni_generated {
class NativeEmptyRecord final { class NativeEmptyRecord final {
public: public:
using CppType = ::EmptyRecord; using CppType = ::testsuite::EmptyRecord;
using JniType = jobject; using JniType = jobject;
using Boxed = NativeEmptyRecord; using Boxed = NativeEmptyRecord;
......
...@@ -15,7 +15,7 @@ NativeExternInterface2::JavaProxy::JavaProxy(JniType j) : JavaProxyCacheEntry(j) ...@@ -15,7 +15,7 @@ NativeExternInterface2::JavaProxy::JavaProxy(JniType j) : JavaProxyCacheEntry(j)
NativeExternInterface2::JavaProxy::~JavaProxy() = default; NativeExternInterface2::JavaProxy::~JavaProxy() = default;
::ExternRecordWithDerivings NativeExternInterface2::JavaProxy::foo(const std::shared_ptr<::TestHelpers> & c_i) { ::ExternRecordWithDerivings NativeExternInterface2::JavaProxy::foo(const std::shared_ptr<::testsuite::TestHelpers> & c_i) {
auto jniEnv = ::djinni::jniGetThreadEnv(); auto jniEnv = ::djinni::jniGetThreadEnv();
::djinni::JniLocalScope jscope(jniEnv, 10); ::djinni::JniLocalScope jscope(jniEnv, 10);
const auto& data = ::djinni::JniClass<::djinni_generated::NativeExternInterface2>::get(); const auto& data = ::djinni::JniClass<::djinni_generated::NativeExternInterface2>::get();
......
...@@ -31,7 +31,7 @@ private: ...@@ -31,7 +31,7 @@ private:
JavaProxy(JniType j); JavaProxy(JniType j);
~JavaProxy(); ~JavaProxy();
::ExternRecordWithDerivings foo(const std::shared_ptr<::TestHelpers> & i) override; ::ExternRecordWithDerivings foo(const std::shared_ptr<::testsuite::TestHelpers> & i) override;
private: private:
using ::djinni::JavaProxyCacheEntry::getGlobalRef; using ::djinni::JavaProxyCacheEntry::getGlobalRef;
......
...@@ -10,7 +10,7 @@ namespace djinni_generated { ...@@ -10,7 +10,7 @@ namespace djinni_generated {
class NativeMapDateRecord final { class NativeMapDateRecord final {
public: public:
using CppType = ::MapDateRecord; using CppType = ::testsuite::MapDateRecord;
using JniType = jobject; using JniType = jobject;
using Boxed = NativeMapDateRecord; using Boxed = NativeMapDateRecord;
......
...@@ -10,7 +10,7 @@ namespace djinni_generated { ...@@ -10,7 +10,7 @@ namespace djinni_generated {
class NativeMapListRecord final { class NativeMapListRecord final {
public: public:
using CppType = ::MapListRecord; using CppType = ::testsuite::MapListRecord;
using JniType = jobject; using JniType = jobject;
using Boxed = NativeMapListRecord; using Boxed = NativeMapListRecord;
......
...@@ -10,7 +10,7 @@ namespace djinni_generated { ...@@ -10,7 +10,7 @@ namespace djinni_generated {
class NativeMapRecord final { class NativeMapRecord final {
public: public:
using CppType = ::MapRecord; using CppType = ::testsuite::MapRecord;
using JniType = jobject; using JniType = jobject;
using Boxed = NativeMapRecord; using Boxed = NativeMapRecord;
......
...@@ -10,7 +10,7 @@ namespace djinni_generated { ...@@ -10,7 +10,7 @@ namespace djinni_generated {
class NativeNestedCollection final { class NativeNestedCollection final {
public: public:
using CppType = ::NestedCollection; using CppType = ::testsuite::NestedCollection;
using JniType = jobject; using JniType = jobject;
using Boxed = NativeNestedCollection; using Boxed = NativeNestedCollection;
......
...@@ -10,7 +10,7 @@ namespace djinni_generated { ...@@ -10,7 +10,7 @@ namespace djinni_generated {
class NativePrimitiveList final { class NativePrimitiveList final {
public: public:
using CppType = ::PrimitiveList; using CppType = ::testsuite::PrimitiveList;
using JniType = jobject; using JniType = jobject;
using Boxed = NativePrimitiveList; using Boxed = NativePrimitiveList;
......
...@@ -10,7 +10,7 @@ namespace djinni_generated { ...@@ -10,7 +10,7 @@ namespace djinni_generated {
class NativeRecordWithDerivings final { class NativeRecordWithDerivings final {
public: public:
using CppType = ::RecordWithDerivings; using CppType = ::testsuite::RecordWithDerivings;
using JniType = jobject; using JniType = jobject;
using Boxed = NativeRecordWithDerivings; using Boxed = NativeRecordWithDerivings;
......
...@@ -10,7 +10,7 @@ namespace djinni_generated { ...@@ -10,7 +10,7 @@ namespace djinni_generated {
class NativeRecordWithDurationAndDerivings final { class NativeRecordWithDurationAndDerivings final {
public: public:
using CppType = ::RecordWithDurationAndDerivings; using CppType = ::testsuite::RecordWithDurationAndDerivings;
using JniType = jobject; using JniType = jobject;
using Boxed = NativeRecordWithDurationAndDerivings; using Boxed = NativeRecordWithDurationAndDerivings;
......
...@@ -10,7 +10,7 @@ namespace djinni_generated { ...@@ -10,7 +10,7 @@ namespace djinni_generated {
class NativeRecordWithNestedDerivings final { class NativeRecordWithNestedDerivings final {
public: public:
using CppType = ::RecordWithNestedDerivings; using CppType = ::testsuite::RecordWithNestedDerivings;
using JniType = jobject; using JniType = jobject;
using Boxed = NativeRecordWithNestedDerivings; using Boxed = NativeRecordWithNestedDerivings;
......
...@@ -10,7 +10,7 @@ namespace djinni_generated { ...@@ -10,7 +10,7 @@ namespace djinni_generated {
class NativeSetRecord final { class NativeSetRecord final {
public: public:
using CppType = ::SetRecord; using CppType = ::testsuite::SetRecord;
using JniType = jobject; using JniType = jobject;
using Boxed = NativeSetRecord; using Boxed = NativeSetRecord;
......
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
namespace djinni_generated { namespace djinni_generated {
class NativeTestDuration final : ::djinni::JniInterface<::TestDuration, NativeTestDuration> { class NativeTestDuration final : ::djinni::JniInterface<::testsuite::TestDuration, NativeTestDuration> {
public: public:
using CppType = std::shared_ptr<::TestDuration>; using CppType = std::shared_ptr<::testsuite::TestDuration>;
using JniType = jobject; using JniType = jobject;
using Boxed = NativeTestDuration; using Boxed = NativeTestDuration;
...@@ -23,7 +23,7 @@ public: ...@@ -23,7 +23,7 @@ public:
private: private:
NativeTestDuration(); NativeTestDuration();
friend ::djinni::JniClass<NativeTestDuration>; friend ::djinni::JniClass<NativeTestDuration>;
friend ::djinni::JniInterface<::TestDuration, NativeTestDuration>; friend ::djinni::JniInterface<::testsuite::TestDuration, NativeTestDuration>;
}; };
......
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
namespace djinni_generated { namespace djinni_generated {
class NativeTestHelpers final : ::djinni::JniInterface<::TestHelpers, NativeTestHelpers> { class NativeTestHelpers final : ::djinni::JniInterface<::testsuite::TestHelpers, NativeTestHelpers> {
public: public:
using CppType = std::shared_ptr<::TestHelpers>; using CppType = std::shared_ptr<::testsuite::TestHelpers>;
using JniType = jobject; using JniType = jobject;
using Boxed = NativeTestHelpers; using Boxed = NativeTestHelpers;
...@@ -23,7 +23,7 @@ public: ...@@ -23,7 +23,7 @@ public:
private: private:
NativeTestHelpers(); NativeTestHelpers();
friend ::djinni::JniClass<NativeTestHelpers>; friend ::djinni::JniClass<NativeTestHelpers>;
friend ::djinni::JniInterface<::TestHelpers, NativeTestHelpers>; friend ::djinni::JniInterface<::testsuite::TestHelpers, NativeTestHelpers>;
}; };
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
namespace djinni_generated { namespace djinni_generated {
NativeUserToken::NativeUserToken() : ::djinni::JniInterface<::UserToken, NativeUserToken>("com/dropbox/djinni/test/UserToken$CppProxy") {} NativeUserToken::NativeUserToken() : ::djinni::JniInterface<::testsuite::UserToken, NativeUserToken>("com/dropbox/djinni/test/UserToken$CppProxy") {}
NativeUserToken::~NativeUserToken() = default; NativeUserToken::~NativeUserToken() = default;
...@@ -27,7 +27,7 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_UserToken_00024CppProxy_nat ...@@ -27,7 +27,7 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_UserToken_00024CppProxy_nat
{ {
try { try {
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef); DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
delete reinterpret_cast<djinni::CppProxyHandle<::UserToken>*>(nativeRef); delete reinterpret_cast<djinni::CppProxyHandle<::testsuite::UserToken>*>(nativeRef);
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, ) } JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, )
} }
...@@ -35,7 +35,7 @@ CJNIEXPORT jstring JNICALL Java_com_dropbox_djinni_test_UserToken_00024CppProxy_ ...@@ -35,7 +35,7 @@ CJNIEXPORT jstring JNICALL Java_com_dropbox_djinni_test_UserToken_00024CppProxy_
{ {
try { try {
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef); DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
const auto& ref = ::djinni::CppProxyHandle<::UserToken>::get(nativeRef); const auto& ref = ::djinni::CppProxyHandle<::testsuite::UserToken>::get(nativeRef);
auto r = ref->whoami(); auto r = ref->whoami();
return ::djinni::release(::djinni::String::fromCpp(jniEnv, r)); return ::djinni::release(::djinni::String::fromCpp(jniEnv, r));
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */) } JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
......
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
namespace djinni_generated { namespace djinni_generated {
class NativeUserToken final : ::djinni::JniInterface<::UserToken, NativeUserToken> { class NativeUserToken final : ::djinni::JniInterface<::testsuite::UserToken, NativeUserToken> {
public: public:
using CppType = std::shared_ptr<::UserToken>; using CppType = std::shared_ptr<::testsuite::UserToken>;
using JniType = jobject; using JniType = jobject;
using Boxed = NativeUserToken; using Boxed = NativeUserToken;
...@@ -23,9 +23,9 @@ public: ...@@ -23,9 +23,9 @@ public:
private: private:
NativeUserToken(); NativeUserToken();
friend ::djinni::JniClass<NativeUserToken>; friend ::djinni::JniClass<NativeUserToken>;
friend ::djinni::JniInterface<::UserToken, NativeUserToken>; friend ::djinni::JniInterface<::testsuite::UserToken, NativeUserToken>;
class JavaProxy final : ::djinni::JavaProxyCacheEntry, public ::UserToken class JavaProxy final : ::djinni::JavaProxyCacheEntry, public ::testsuite::UserToken
{ {
public: public:
JavaProxy(JniType j); JavaProxy(JniType j);
...@@ -35,7 +35,7 @@ private: ...@@ -35,7 +35,7 @@ private:
private: private:
using ::djinni::JavaProxyCacheEntry::getGlobalRef; using ::djinni::JavaProxyCacheEntry::getGlobalRef;
friend ::djinni::JniInterface<::UserToken, ::djinni_generated::NativeUserToken>; friend ::djinni::JniInterface<::testsuite::UserToken, ::djinni_generated::NativeUserToken>;
friend ::djinni::JavaProxyCache<JavaProxy>; friend ::djinni::JavaProxyCache<JavaProxy>;
}; };
......
...@@ -12,7 +12,7 @@ namespace djinni_generated { ...@@ -12,7 +12,7 @@ namespace djinni_generated {
struct AssortedPrimitives struct AssortedPrimitives
{ {
using CppType = ::AssortedPrimitives; using CppType = ::testsuite::AssortedPrimitives;
using ObjcType = DBAssortedPrimitives*; using ObjcType = DBAssortedPrimitives*;
using Boxed = AssortedPrimitives; using Boxed = AssortedPrimitives;
......
...@@ -13,7 +13,7 @@ namespace djinni_generated { ...@@ -13,7 +13,7 @@ namespace djinni_generated {
class ClientInterface class ClientInterface
{ {
public: public:
using CppType = std::shared_ptr<::ClientInterface>; using CppType = std::shared_ptr<::testsuite::ClientInterface>;
using ObjcType = id<DBClientInterface>; using ObjcType = id<DBClientInterface>;
using Boxed = ClientInterface; using Boxed = ClientInterface;
......
...@@ -12,12 +12,12 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -12,12 +12,12 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
namespace djinni_generated { namespace djinni_generated {
class ClientInterface::ObjcProxy final class ClientInterface::ObjcProxy final
: public ::ClientInterface : public ::testsuite::ClientInterface
, public ::djinni::DbxObjcWrapperCache<ObjcProxy>::Handle , public ::djinni::DbxObjcWrapperCache<ObjcProxy>::Handle
{ {
public: public:
using Handle::Handle; using Handle::Handle;
::ClientReturnedRecord get_record(int64_t c_record_id, const std::string & c_utf8string, const std::experimental::optional<std::string> & c_misc) override ::testsuite::ClientReturnedRecord get_record(int64_t c_record_id, const std::string & c_utf8string, const std::experimental::optional<std::string> & c_misc) override
{ {
@autoreleasepool { @autoreleasepool {
auto r = [(ObjcType)Handle::get() getRecord:(::djinni::I64::fromCpp(c_record_id)) auto r = [(ObjcType)Handle::get() getRecord:(::djinni::I64::fromCpp(c_record_id))
......
...@@ -12,7 +12,7 @@ namespace djinni_generated { ...@@ -12,7 +12,7 @@ namespace djinni_generated {
struct ClientReturnedRecord struct ClientReturnedRecord
{ {
using CppType = ::ClientReturnedRecord; using CppType = ::testsuite::ClientReturnedRecord;
using ObjcType = DBClientReturnedRecord*; using ObjcType = DBClientReturnedRecord*;
using Boxed = ClientReturnedRecord; using Boxed = ClientReturnedRecord;
......
...@@ -12,7 +12,7 @@ namespace djinni_generated { ...@@ -12,7 +12,7 @@ namespace djinni_generated {
struct Constants struct Constants
{ {
using CppType = ::Constants; using CppType = ::testsuite::Constants;
using ObjcType = DBConstants*; using ObjcType = DBConstants*;
using Boxed = Constants; using Boxed = Constants;
......
...@@ -13,7 +13,7 @@ namespace djinni_generated { ...@@ -13,7 +13,7 @@ namespace djinni_generated {
class ConstantsInterface class ConstantsInterface
{ {
public: public:
using CppType = std::shared_ptr<::ConstantsInterface>; using CppType = std::shared_ptr<::testsuite::ConstantsInterface>;
using ObjcType = DBConstantsInterface*; using ObjcType = DBConstantsInterface*;
using Boxed = ConstantsInterface; using Boxed = ConstantsInterface;
......
...@@ -13,15 +13,15 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -13,15 +13,15 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
@interface DBConstantsInterface () @interface DBConstantsInterface ()
- (id)initWithCpp:(const std::shared_ptr<::ConstantsInterface>&)cppRef; - (id)initWithCpp:(const std::shared_ptr<::testsuite::ConstantsInterface>&)cppRef;
@end @end
@implementation DBConstantsInterface { @implementation DBConstantsInterface {
::djinni::DbxCppWrapperCache<::ConstantsInterface>::Handle _cppRefHandle; ::djinni::DbxCppWrapperCache<::testsuite::ConstantsInterface>::Handle _cppRefHandle;
} }
- (id)initWithCpp:(const std::shared_ptr<::ConstantsInterface>&)cppRef - (id)initWithCpp:(const std::shared_ptr<::testsuite::ConstantsInterface>&)cppRef
{ {
if (self = [super init]) { if (self = [super init]) {
_cppRefHandle.assign(cppRef); _cppRefHandle.assign(cppRef);
...@@ -50,7 +50,7 @@ auto ConstantsInterface::fromCpp(const CppType& cpp) -> ObjcType ...@@ -50,7 +50,7 @@ auto ConstantsInterface::fromCpp(const CppType& cpp) -> ObjcType
if (!cpp) { if (!cpp) {
return nil; return nil;
} }
return ::djinni::DbxCppWrapperCache<::ConstantsInterface>::getInstance()->get(cpp, [] (const CppType& p) { return ::djinni::DbxCppWrapperCache<::testsuite::ConstantsInterface>::getInstance()->get(cpp, [] (const CppType& p) {
return [[DBConstantsInterface alloc] initWithCpp:p]; return [[DBConstantsInterface alloc] initWithCpp:p];
}); });
} }
......
...@@ -13,7 +13,7 @@ namespace djinni_generated { ...@@ -13,7 +13,7 @@ namespace djinni_generated {
class CppException class CppException
{ {
public: public:
using CppType = std::shared_ptr<::CppException>; using CppType = std::shared_ptr<::testsuite::CppException>;
using ObjcType = DBCppException*; using ObjcType = DBCppException*;
using Boxed = CppException; using Boxed = CppException;
......
...@@ -14,15 +14,15 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -14,15 +14,15 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
@interface DBCppException () @interface DBCppException ()
- (id)initWithCpp:(const std::shared_ptr<::CppException>&)cppRef; - (id)initWithCpp:(const std::shared_ptr<::testsuite::CppException>&)cppRef;
@end @end
@implementation DBCppException { @implementation DBCppException {
::djinni::DbxCppWrapperCache<::CppException>::Handle _cppRefHandle; ::djinni::DbxCppWrapperCache<::testsuite::CppException>::Handle _cppRefHandle;
} }
- (id)initWithCpp:(const std::shared_ptr<::CppException>&)cppRef - (id)initWithCpp:(const std::shared_ptr<::testsuite::CppException>&)cppRef
{ {
if (self = [super init]) { if (self = [super init]) {
_cppRefHandle.assign(cppRef); _cppRefHandle.assign(cppRef);
...@@ -39,7 +39,7 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -39,7 +39,7 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
+ (nullable DBCppException *)get { + (nullable DBCppException *)get {
try { try {
auto r = ::CppException::get(); auto r = ::testsuite::CppException::get();
return ::djinni_generated::CppException::fromCpp(r); return ::djinni_generated::CppException::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
...@@ -59,7 +59,7 @@ auto CppException::fromCpp(const CppType& cpp) -> ObjcType ...@@ -59,7 +59,7 @@ auto CppException::fromCpp(const CppType& cpp) -> ObjcType
if (!cpp) { if (!cpp) {
return nil; return nil;
} }
return ::djinni::DbxCppWrapperCache<::CppException>::getInstance()->get(cpp, [] (const CppType& p) { return ::djinni::DbxCppWrapperCache<::testsuite::CppException>::getInstance()->get(cpp, [] (const CppType& p) {
return [[DBCppException alloc] initWithCpp:p]; return [[DBCppException alloc] initWithCpp:p];
}); });
} }
......
...@@ -12,7 +12,7 @@ namespace djinni_generated { ...@@ -12,7 +12,7 @@ namespace djinni_generated {
struct DateRecord struct DateRecord
{ {
using CppType = ::DateRecord; using CppType = ::testsuite::DateRecord;
using ObjcType = DBDateRecord*; using ObjcType = DBDateRecord*;
using Boxed = DateRecord; using Boxed = DateRecord;
......
...@@ -12,7 +12,7 @@ namespace djinni_generated { ...@@ -12,7 +12,7 @@ namespace djinni_generated {
struct EmptyRecord struct EmptyRecord
{ {
using CppType = ::EmptyRecord; using CppType = ::testsuite::EmptyRecord;
using ObjcType = DBEmptyRecord*; using ObjcType = DBEmptyRecord*;
using Boxed = EmptyRecord; using Boxed = EmptyRecord;
......
...@@ -17,7 +17,7 @@ class ExternInterface2::ObjcProxy final ...@@ -17,7 +17,7 @@ class ExternInterface2::ObjcProxy final
{ {
public: public:
using Handle::Handle; using Handle::Handle;
::ExternRecordWithDerivings foo(const std::shared_ptr<::TestHelpers> & c_i) override ::ExternRecordWithDerivings foo(const std::shared_ptr<::testsuite::TestHelpers> & c_i) override
{ {
@autoreleasepool { @autoreleasepool {
auto r = [(ObjcType)Handle::get() foo:(::djinni_generated::TestHelpers::fromCpp(c_i))]; auto r = [(ObjcType)Handle::get() foo:(::djinni_generated::TestHelpers::fromCpp(c_i))];
......
...@@ -12,13 +12,13 @@ auto ExternRecordWithDerivings::toCpp(ObjcType obj) -> CppType ...@@ -12,13 +12,13 @@ auto ExternRecordWithDerivings::toCpp(ObjcType obj) -> CppType
{ {
assert(obj); assert(obj);
return {::djinni_generated::RecordWithDerivings::toCpp(obj.member), return {::djinni_generated::RecordWithDerivings::toCpp(obj.member),
::djinni::Enum<::color, DBColor>::toCpp(obj.e)}; ::djinni::Enum<::testsuite::color, DBColor>::toCpp(obj.e)};
} }
auto ExternRecordWithDerivings::fromCpp(const CppType& cpp) -> ObjcType auto ExternRecordWithDerivings::fromCpp(const CppType& cpp) -> ObjcType
{ {
return [[DBExternRecordWithDerivings alloc] initWithMember:(::djinni_generated::RecordWithDerivings::fromCpp(cpp.member)) return [[DBExternRecordWithDerivings alloc] initWithMember:(::djinni_generated::RecordWithDerivings::fromCpp(cpp.member))
e:(::djinni::Enum<::color, DBColor>::fromCpp(cpp.e))]; e:(::djinni::Enum<::testsuite::color, DBColor>::fromCpp(cpp.e))];
} }
} // namespace djinni_generated } // namespace djinni_generated
...@@ -12,7 +12,7 @@ namespace djinni_generated { ...@@ -12,7 +12,7 @@ namespace djinni_generated {
struct MapDateRecord struct MapDateRecord
{ {
using CppType = ::MapDateRecord; using CppType = ::testsuite::MapDateRecord;
using ObjcType = DBMapDateRecord*; using ObjcType = DBMapDateRecord*;
using Boxed = MapDateRecord; using Boxed = MapDateRecord;
......
...@@ -12,7 +12,7 @@ namespace djinni_generated { ...@@ -12,7 +12,7 @@ namespace djinni_generated {
struct MapListRecord struct MapListRecord
{ {
using CppType = ::MapListRecord; using CppType = ::testsuite::MapListRecord;
using ObjcType = DBMapListRecord*; using ObjcType = DBMapListRecord*;
using Boxed = MapListRecord; using Boxed = MapListRecord;
......
...@@ -12,7 +12,7 @@ namespace djinni_generated { ...@@ -12,7 +12,7 @@ namespace djinni_generated {
struct MapRecord struct MapRecord
{ {
using CppType = ::MapRecord; using CppType = ::testsuite::MapRecord;
using ObjcType = DBMapRecord*; using ObjcType = DBMapRecord*;
using Boxed = MapRecord; using Boxed = MapRecord;
......
...@@ -12,7 +12,7 @@ namespace djinni_generated { ...@@ -12,7 +12,7 @@ namespace djinni_generated {
struct NestedCollection struct NestedCollection
{ {
using CppType = ::NestedCollection; using CppType = ::testsuite::NestedCollection;
using ObjcType = DBNestedCollection*; using ObjcType = DBNestedCollection*;
using Boxed = NestedCollection; using Boxed = NestedCollection;
......
...@@ -12,7 +12,7 @@ namespace djinni_generated { ...@@ -12,7 +12,7 @@ namespace djinni_generated {
struct PrimitiveList struct PrimitiveList
{ {
using CppType = ::PrimitiveList; using CppType = ::testsuite::PrimitiveList;
using ObjcType = DBPrimitiveList*; using ObjcType = DBPrimitiveList*;
using Boxed = PrimitiveList; using Boxed = PrimitiveList;
......
...@@ -12,7 +12,7 @@ namespace djinni_generated { ...@@ -12,7 +12,7 @@ namespace djinni_generated {
struct RecordWithDerivings struct RecordWithDerivings
{ {
using CppType = ::RecordWithDerivings; using CppType = ::testsuite::RecordWithDerivings;
using ObjcType = DBRecordWithDerivings*; using ObjcType = DBRecordWithDerivings*;
using Boxed = RecordWithDerivings; using Boxed = RecordWithDerivings;
......
...@@ -12,7 +12,7 @@ namespace djinni_generated { ...@@ -12,7 +12,7 @@ namespace djinni_generated {
struct RecordWithDurationAndDerivings struct RecordWithDurationAndDerivings
{ {
using CppType = ::RecordWithDurationAndDerivings; using CppType = ::testsuite::RecordWithDurationAndDerivings;
using ObjcType = DBRecordWithDurationAndDerivings*; using ObjcType = DBRecordWithDurationAndDerivings*;
using Boxed = RecordWithDurationAndDerivings; using Boxed = RecordWithDurationAndDerivings;
......
...@@ -12,7 +12,7 @@ namespace djinni_generated { ...@@ -12,7 +12,7 @@ namespace djinni_generated {
struct RecordWithNestedDerivings struct RecordWithNestedDerivings
{ {
using CppType = ::RecordWithNestedDerivings; using CppType = ::testsuite::RecordWithNestedDerivings;
using ObjcType = DBRecordWithNestedDerivings*; using ObjcType = DBRecordWithNestedDerivings*;
using Boxed = RecordWithNestedDerivings; using Boxed = RecordWithNestedDerivings;
......
...@@ -12,7 +12,7 @@ namespace djinni_generated { ...@@ -12,7 +12,7 @@ namespace djinni_generated {
struct SetRecord struct SetRecord
{ {
using CppType = ::SetRecord; using CppType = ::testsuite::SetRecord;
using ObjcType = DBSetRecord*; using ObjcType = DBSetRecord*;
using Boxed = SetRecord; using Boxed = SetRecord;
......
...@@ -13,7 +13,7 @@ namespace djinni_generated { ...@@ -13,7 +13,7 @@ namespace djinni_generated {
class TestDuration class TestDuration
{ {
public: public:
using CppType = std::shared_ptr<::TestDuration>; using CppType = std::shared_ptr<::testsuite::TestDuration>;
using ObjcType = DBTestDuration*; using ObjcType = DBTestDuration*;
using Boxed = TestDuration; using Boxed = TestDuration;
......
...@@ -14,15 +14,15 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -14,15 +14,15 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
@interface DBTestDuration () @interface DBTestDuration ()
- (id)initWithCpp:(const std::shared_ptr<::TestDuration>&)cppRef; - (id)initWithCpp:(const std::shared_ptr<::testsuite::TestDuration>&)cppRef;
@end @end
@implementation DBTestDuration { @implementation DBTestDuration {
::djinni::DbxCppWrapperCache<::TestDuration>::Handle _cppRefHandle; ::djinni::DbxCppWrapperCache<::testsuite::TestDuration>::Handle _cppRefHandle;
} }
- (id)initWithCpp:(const std::shared_ptr<::TestDuration>&)cppRef - (id)initWithCpp:(const std::shared_ptr<::testsuite::TestDuration>&)cppRef
{ {
if (self = [super init]) { if (self = [super init]) {
_cppRefHandle.assign(cppRef); _cppRefHandle.assign(cppRef);
...@@ -32,140 +32,140 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -32,140 +32,140 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
+ (nonnull NSString *)hoursString:(NSTimeInterval)dt { + (nonnull NSString *)hoursString:(NSTimeInterval)dt {
try { try {
auto r = ::TestDuration::hoursString(::djinni::Duration<::djinni::I32, ::djinni::Duration_h>::toCpp(dt)); auto r = ::testsuite::TestDuration::hoursString(::djinni::Duration<::djinni::I32, ::djinni::Duration_h>::toCpp(dt));
return ::djinni::String::fromCpp(r); return ::djinni::String::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nonnull NSString *)minutesString:(NSTimeInterval)dt { + (nonnull NSString *)minutesString:(NSTimeInterval)dt {
try { try {
auto r = ::TestDuration::minutesString(::djinni::Duration<::djinni::I32, ::djinni::Duration_min>::toCpp(dt)); auto r = ::testsuite::TestDuration::minutesString(::djinni::Duration<::djinni::I32, ::djinni::Duration_min>::toCpp(dt));
return ::djinni::String::fromCpp(r); return ::djinni::String::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nonnull NSString *)secondsString:(NSTimeInterval)dt { + (nonnull NSString *)secondsString:(NSTimeInterval)dt {
try { try {
auto r = ::TestDuration::secondsString(::djinni::Duration<::djinni::I32, ::djinni::Duration_s>::toCpp(dt)); auto r = ::testsuite::TestDuration::secondsString(::djinni::Duration<::djinni::I32, ::djinni::Duration_s>::toCpp(dt));
return ::djinni::String::fromCpp(r); return ::djinni::String::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nonnull NSString *)millisString:(NSTimeInterval)dt { + (nonnull NSString *)millisString:(NSTimeInterval)dt {
try { try {
auto r = ::TestDuration::millisString(::djinni::Duration<::djinni::I32, ::djinni::Duration_ms>::toCpp(dt)); auto r = ::testsuite::TestDuration::millisString(::djinni::Duration<::djinni::I32, ::djinni::Duration_ms>::toCpp(dt));
return ::djinni::String::fromCpp(r); return ::djinni::String::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nonnull NSString *)microsString:(NSTimeInterval)dt { + (nonnull NSString *)microsString:(NSTimeInterval)dt {
try { try {
auto r = ::TestDuration::microsString(::djinni::Duration<::djinni::I32, ::djinni::Duration_us>::toCpp(dt)); auto r = ::testsuite::TestDuration::microsString(::djinni::Duration<::djinni::I32, ::djinni::Duration_us>::toCpp(dt));
return ::djinni::String::fromCpp(r); return ::djinni::String::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nonnull NSString *)nanosString:(NSTimeInterval)dt { + (nonnull NSString *)nanosString:(NSTimeInterval)dt {
try { try {
auto r = ::TestDuration::nanosString(::djinni::Duration<::djinni::I32, ::djinni::Duration_ns>::toCpp(dt)); auto r = ::testsuite::TestDuration::nanosString(::djinni::Duration<::djinni::I32, ::djinni::Duration_ns>::toCpp(dt));
return ::djinni::String::fromCpp(r); return ::djinni::String::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (NSTimeInterval)hours:(int32_t)count { + (NSTimeInterval)hours:(int32_t)count {
try { try {
auto r = ::TestDuration::hours(::djinni::I32::toCpp(count)); auto r = ::testsuite::TestDuration::hours(::djinni::I32::toCpp(count));
return ::djinni::Duration<::djinni::I32, ::djinni::Duration_h>::fromCpp(r); return ::djinni::Duration<::djinni::I32, ::djinni::Duration_h>::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (NSTimeInterval)minutes:(int32_t)count { + (NSTimeInterval)minutes:(int32_t)count {
try { try {
auto r = ::TestDuration::minutes(::djinni::I32::toCpp(count)); auto r = ::testsuite::TestDuration::minutes(::djinni::I32::toCpp(count));
return ::djinni::Duration<::djinni::I32, ::djinni::Duration_min>::fromCpp(r); return ::djinni::Duration<::djinni::I32, ::djinni::Duration_min>::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (NSTimeInterval)seconds:(int32_t)count { + (NSTimeInterval)seconds:(int32_t)count {
try { try {
auto r = ::TestDuration::seconds(::djinni::I32::toCpp(count)); auto r = ::testsuite::TestDuration::seconds(::djinni::I32::toCpp(count));
return ::djinni::Duration<::djinni::I32, ::djinni::Duration_s>::fromCpp(r); return ::djinni::Duration<::djinni::I32, ::djinni::Duration_s>::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (NSTimeInterval)millis:(int32_t)count { + (NSTimeInterval)millis:(int32_t)count {
try { try {
auto r = ::TestDuration::millis(::djinni::I32::toCpp(count)); auto r = ::testsuite::TestDuration::millis(::djinni::I32::toCpp(count));
return ::djinni::Duration<::djinni::I32, ::djinni::Duration_ms>::fromCpp(r); return ::djinni::Duration<::djinni::I32, ::djinni::Duration_ms>::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (NSTimeInterval)micros:(int32_t)count { + (NSTimeInterval)micros:(int32_t)count {
try { try {
auto r = ::TestDuration::micros(::djinni::I32::toCpp(count)); auto r = ::testsuite::TestDuration::micros(::djinni::I32::toCpp(count));
return ::djinni::Duration<::djinni::I32, ::djinni::Duration_us>::fromCpp(r); return ::djinni::Duration<::djinni::I32, ::djinni::Duration_us>::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (NSTimeInterval)nanos:(int32_t)count { + (NSTimeInterval)nanos:(int32_t)count {
try { try {
auto r = ::TestDuration::nanos(::djinni::I32::toCpp(count)); auto r = ::testsuite::TestDuration::nanos(::djinni::I32::toCpp(count));
return ::djinni::Duration<::djinni::I32, ::djinni::Duration_ns>::fromCpp(r); return ::djinni::Duration<::djinni::I32, ::djinni::Duration_ns>::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (NSTimeInterval)hoursf:(double)count { + (NSTimeInterval)hoursf:(double)count {
try { try {
auto r = ::TestDuration::hoursf(::djinni::F64::toCpp(count)); auto r = ::testsuite::TestDuration::hoursf(::djinni::F64::toCpp(count));
return ::djinni::Duration<::djinni::F64, ::djinni::Duration_h>::fromCpp(r); return ::djinni::Duration<::djinni::F64, ::djinni::Duration_h>::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (NSTimeInterval)minutesf:(double)count { + (NSTimeInterval)minutesf:(double)count {
try { try {
auto r = ::TestDuration::minutesf(::djinni::F64::toCpp(count)); auto r = ::testsuite::TestDuration::minutesf(::djinni::F64::toCpp(count));
return ::djinni::Duration<::djinni::F64, ::djinni::Duration_min>::fromCpp(r); return ::djinni::Duration<::djinni::F64, ::djinni::Duration_min>::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (NSTimeInterval)secondsf:(double)count { + (NSTimeInterval)secondsf:(double)count {
try { try {
auto r = ::TestDuration::secondsf(::djinni::F64::toCpp(count)); auto r = ::testsuite::TestDuration::secondsf(::djinni::F64::toCpp(count));
return ::djinni::Duration<::djinni::F64, ::djinni::Duration_s>::fromCpp(r); return ::djinni::Duration<::djinni::F64, ::djinni::Duration_s>::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (NSTimeInterval)millisf:(double)count { + (NSTimeInterval)millisf:(double)count {
try { try {
auto r = ::TestDuration::millisf(::djinni::F64::toCpp(count)); auto r = ::testsuite::TestDuration::millisf(::djinni::F64::toCpp(count));
return ::djinni::Duration<::djinni::F64, ::djinni::Duration_ms>::fromCpp(r); return ::djinni::Duration<::djinni::F64, ::djinni::Duration_ms>::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (NSTimeInterval)microsf:(double)count { + (NSTimeInterval)microsf:(double)count {
try { try {
auto r = ::TestDuration::microsf(::djinni::F64::toCpp(count)); auto r = ::testsuite::TestDuration::microsf(::djinni::F64::toCpp(count));
return ::djinni::Duration<::djinni::F64, ::djinni::Duration_us>::fromCpp(r); return ::djinni::Duration<::djinni::F64, ::djinni::Duration_us>::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (NSTimeInterval)nanosf:(double)count { + (NSTimeInterval)nanosf:(double)count {
try { try {
auto r = ::TestDuration::nanosf(::djinni::F64::toCpp(count)); auto r = ::testsuite::TestDuration::nanosf(::djinni::F64::toCpp(count));
return ::djinni::Duration<::djinni::F64, ::djinni::Duration_ns>::fromCpp(r); return ::djinni::Duration<::djinni::F64, ::djinni::Duration_ns>::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nullable NSNumber *)box:(int64_t)count { + (nullable NSNumber *)box:(int64_t)count {
try { try {
auto r = ::TestDuration::box(::djinni::I64::toCpp(count)); auto r = ::testsuite::TestDuration::box(::djinni::I64::toCpp(count));
return ::djinni::Optional<std::experimental::optional, ::djinni::Duration<::djinni::I64, ::djinni::Duration_s>>::fromCpp(r); return ::djinni::Optional<std::experimental::optional, ::djinni::Duration<::djinni::I64, ::djinni::Duration_s>>::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (int64_t)unbox:(nullable NSNumber *)dt { + (int64_t)unbox:(nullable NSNumber *)dt {
try { try {
auto r = ::TestDuration::unbox(::djinni::Optional<std::experimental::optional, ::djinni::Duration<::djinni::I64, ::djinni::Duration_s>>::toCpp(dt)); auto r = ::testsuite::TestDuration::unbox(::djinni::Optional<std::experimental::optional, ::djinni::Duration<::djinni::I64, ::djinni::Duration_s>>::toCpp(dt));
return ::djinni::I64::fromCpp(r); return ::djinni::I64::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
...@@ -185,7 +185,7 @@ auto TestDuration::fromCpp(const CppType& cpp) -> ObjcType ...@@ -185,7 +185,7 @@ auto TestDuration::fromCpp(const CppType& cpp) -> ObjcType
if (!cpp) { if (!cpp) {
return nil; return nil;
} }
return ::djinni::DbxCppWrapperCache<::TestDuration>::getInstance()->get(cpp, [] (const CppType& p) { return ::djinni::DbxCppWrapperCache<::testsuite::TestDuration>::getInstance()->get(cpp, [] (const CppType& p) {
return [[DBTestDuration alloc] initWithCpp:p]; return [[DBTestDuration alloc] initWithCpp:p];
}); });
} }
......
...@@ -13,7 +13,7 @@ namespace djinni_generated { ...@@ -13,7 +13,7 @@ namespace djinni_generated {
class TestHelpers class TestHelpers
{ {
public: public:
using CppType = std::shared_ptr<::TestHelpers>; using CppType = std::shared_ptr<::testsuite::TestHelpers>;
using ObjcType = DBTestHelpers*; using ObjcType = DBTestHelpers*;
using Boxed = TestHelpers; using Boxed = TestHelpers;
......
...@@ -20,15 +20,15 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -20,15 +20,15 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
@interface DBTestHelpers () @interface DBTestHelpers ()
- (id)initWithCpp:(const std::shared_ptr<::TestHelpers>&)cppRef; - (id)initWithCpp:(const std::shared_ptr<::testsuite::TestHelpers>&)cppRef;
@end @end
@implementation DBTestHelpers { @implementation DBTestHelpers {
::djinni::DbxCppWrapperCache<::TestHelpers>::Handle _cppRefHandle; ::djinni::DbxCppWrapperCache<::testsuite::TestHelpers>::Handle _cppRefHandle;
} }
- (id)initWithCpp:(const std::shared_ptr<::TestHelpers>&)cppRef - (id)initWithCpp:(const std::shared_ptr<::testsuite::TestHelpers>&)cppRef
{ {
if (self = [super init]) { if (self = [super init]) {
_cppRefHandle.assign(cppRef); _cppRefHandle.assign(cppRef);
...@@ -38,135 +38,135 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -38,135 +38,135 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
+ (nonnull DBSetRecord *)getSetRecord { + (nonnull DBSetRecord *)getSetRecord {
try { try {
auto r = ::TestHelpers::get_set_record(); auto r = ::testsuite::TestHelpers::get_set_record();
return ::djinni_generated::SetRecord::fromCpp(r); return ::djinni_generated::SetRecord::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (BOOL)checkSetRecord:(nonnull DBSetRecord *)rec { + (BOOL)checkSetRecord:(nonnull DBSetRecord *)rec {
try { try {
auto r = ::TestHelpers::check_set_record(::djinni_generated::SetRecord::toCpp(rec)); auto r = ::testsuite::TestHelpers::check_set_record(::djinni_generated::SetRecord::toCpp(rec));
return ::djinni::Bool::fromCpp(r); return ::djinni::Bool::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nonnull DBPrimitiveList *)getPrimitiveList { + (nonnull DBPrimitiveList *)getPrimitiveList {
try { try {
auto r = ::TestHelpers::get_primitive_list(); auto r = ::testsuite::TestHelpers::get_primitive_list();
return ::djinni_generated::PrimitiveList::fromCpp(r); return ::djinni_generated::PrimitiveList::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (BOOL)checkPrimitiveList:(nonnull DBPrimitiveList *)pl { + (BOOL)checkPrimitiveList:(nonnull DBPrimitiveList *)pl {
try { try {
auto r = ::TestHelpers::check_primitive_list(::djinni_generated::PrimitiveList::toCpp(pl)); auto r = ::testsuite::TestHelpers::check_primitive_list(::djinni_generated::PrimitiveList::toCpp(pl));
return ::djinni::Bool::fromCpp(r); return ::djinni::Bool::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nonnull DBNestedCollection *)getNestedCollection { + (nonnull DBNestedCollection *)getNestedCollection {
try { try {
auto r = ::TestHelpers::get_nested_collection(); auto r = ::testsuite::TestHelpers::get_nested_collection();
return ::djinni_generated::NestedCollection::fromCpp(r); return ::djinni_generated::NestedCollection::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (BOOL)checkNestedCollection:(nonnull DBNestedCollection *)nc { + (BOOL)checkNestedCollection:(nonnull DBNestedCollection *)nc {
try { try {
auto r = ::TestHelpers::check_nested_collection(::djinni_generated::NestedCollection::toCpp(nc)); auto r = ::testsuite::TestHelpers::check_nested_collection(::djinni_generated::NestedCollection::toCpp(nc));
return ::djinni::Bool::fromCpp(r); return ::djinni::Bool::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nonnull NSDictionary *)getMap { + (nonnull NSDictionary *)getMap {
try { try {
auto r = ::TestHelpers::get_map(); auto r = ::testsuite::TestHelpers::get_map();
return ::djinni::Map<::djinni::String, ::djinni::I64>::fromCpp(r); return ::djinni::Map<::djinni::String, ::djinni::I64>::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (BOOL)checkMap:(nonnull NSDictionary *)m { + (BOOL)checkMap:(nonnull NSDictionary *)m {
try { try {
auto r = ::TestHelpers::check_map(::djinni::Map<::djinni::String, ::djinni::I64>::toCpp(m)); auto r = ::testsuite::TestHelpers::check_map(::djinni::Map<::djinni::String, ::djinni::I64>::toCpp(m));
return ::djinni::Bool::fromCpp(r); return ::djinni::Bool::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nonnull NSDictionary *)getEmptyMap { + (nonnull NSDictionary *)getEmptyMap {
try { try {
auto r = ::TestHelpers::get_empty_map(); auto r = ::testsuite::TestHelpers::get_empty_map();
return ::djinni::Map<::djinni::String, ::djinni::I64>::fromCpp(r); return ::djinni::Map<::djinni::String, ::djinni::I64>::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (BOOL)checkEmptyMap:(nonnull NSDictionary *)m { + (BOOL)checkEmptyMap:(nonnull NSDictionary *)m {
try { try {
auto r = ::TestHelpers::check_empty_map(::djinni::Map<::djinni::String, ::djinni::I64>::toCpp(m)); auto r = ::testsuite::TestHelpers::check_empty_map(::djinni::Map<::djinni::String, ::djinni::I64>::toCpp(m));
return ::djinni::Bool::fromCpp(r); return ::djinni::Bool::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nonnull DBMapListRecord *)getMapListRecord { + (nonnull DBMapListRecord *)getMapListRecord {
try { try {
auto r = ::TestHelpers::get_map_list_record(); auto r = ::testsuite::TestHelpers::get_map_list_record();
return ::djinni_generated::MapListRecord::fromCpp(r); return ::djinni_generated::MapListRecord::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (BOOL)checkMapListRecord:(nonnull DBMapListRecord *)m { + (BOOL)checkMapListRecord:(nonnull DBMapListRecord *)m {
try { try {
auto r = ::TestHelpers::check_map_list_record(::djinni_generated::MapListRecord::toCpp(m)); auto r = ::testsuite::TestHelpers::check_map_list_record(::djinni_generated::MapListRecord::toCpp(m));
return ::djinni::Bool::fromCpp(r); return ::djinni::Bool::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (void)checkClientInterfaceAscii:(nullable id<DBClientInterface>)i { + (void)checkClientInterfaceAscii:(nullable id<DBClientInterface>)i {
try { try {
::TestHelpers::check_client_interface_ascii(::djinni_generated::ClientInterface::toCpp(i)); ::testsuite::TestHelpers::check_client_interface_ascii(::djinni_generated::ClientInterface::toCpp(i));
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (void)checkClientInterfaceNonascii:(nullable id<DBClientInterface>)i { + (void)checkClientInterfaceNonascii:(nullable id<DBClientInterface>)i {
try { try {
::TestHelpers::check_client_interface_nonascii(::djinni_generated::ClientInterface::toCpp(i)); ::testsuite::TestHelpers::check_client_interface_nonascii(::djinni_generated::ClientInterface::toCpp(i));
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (void)checkEnumMap:(nonnull NSDictionary *)m { + (void)checkEnumMap:(nonnull NSDictionary *)m {
try { try {
::TestHelpers::check_enum_map(::djinni::Map<::djinni::Enum<::color, DBColor>, ::djinni::String>::toCpp(m)); ::testsuite::TestHelpers::check_enum_map(::djinni::Map<::djinni::Enum<::testsuite::color, DBColor>, ::djinni::String>::toCpp(m));
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (void)checkEnum:(DBColor)c { + (void)checkEnum:(DBColor)c {
try { try {
::TestHelpers::check_enum(::djinni::Enum<::color, DBColor>::toCpp(c)); ::testsuite::TestHelpers::check_enum(::djinni::Enum<::testsuite::color, DBColor>::toCpp(c));
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nullable id<DBUserToken>)tokenId:(nullable id<DBUserToken>)t { + (nullable id<DBUserToken>)tokenId:(nullable id<DBUserToken>)t {
try { try {
auto r = ::TestHelpers::token_id(::djinni_generated::UserToken::toCpp(t)); auto r = ::testsuite::TestHelpers::token_id(::djinni_generated::UserToken::toCpp(t));
return ::djinni_generated::UserToken::fromCpp(r); return ::djinni_generated::UserToken::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nullable id<DBUserToken>)createCppToken { + (nullable id<DBUserToken>)createCppToken {
try { try {
auto r = ::TestHelpers::create_cpp_token(); auto r = ::testsuite::TestHelpers::create_cpp_token();
return ::djinni_generated::UserToken::fromCpp(r); return ::djinni_generated::UserToken::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (void)checkCppToken:(nullable id<DBUserToken>)t { + (void)checkCppToken:(nullable id<DBUserToken>)t {
try { try {
::TestHelpers::check_cpp_token(::djinni_generated::UserToken::toCpp(t)); ::testsuite::TestHelpers::check_cpp_token(::djinni_generated::UserToken::toCpp(t));
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (int64_t)cppTokenId:(nullable id<DBUserToken>)t { + (int64_t)cppTokenId:(nullable id<DBUserToken>)t {
try { try {
auto r = ::TestHelpers::cpp_token_id(::djinni_generated::UserToken::toCpp(t)); auto r = ::testsuite::TestHelpers::cpp_token_id(::djinni_generated::UserToken::toCpp(t));
return ::djinni::I64::fromCpp(r); return ::djinni::I64::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
...@@ -174,28 +174,28 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -174,28 +174,28 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
+ (void)checkTokenType:(nullable id<DBUserToken>)t + (void)checkTokenType:(nullable id<DBUserToken>)t
type:(nonnull NSString *)type { type:(nonnull NSString *)type {
try { try {
::TestHelpers::check_token_type(::djinni_generated::UserToken::toCpp(t), ::testsuite::TestHelpers::check_token_type(::djinni_generated::UserToken::toCpp(t),
::djinni::String::toCpp(type)); ::djinni::String::toCpp(type));
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nullable NSNumber *)returnNone { + (nullable NSNumber *)returnNone {
try { try {
auto r = ::TestHelpers::return_none(); auto r = ::testsuite::TestHelpers::return_none();
return ::djinni::Optional<std::experimental::optional, ::djinni::I32>::fromCpp(r); return ::djinni::Optional<std::experimental::optional, ::djinni::I32>::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nonnull DBAssortedPrimitives *)assortedPrimitivesId:(nonnull DBAssortedPrimitives *)i { + (nonnull DBAssortedPrimitives *)assortedPrimitivesId:(nonnull DBAssortedPrimitives *)i {
try { try {
auto r = ::TestHelpers::assorted_primitives_id(::djinni_generated::AssortedPrimitives::toCpp(i)); auto r = ::testsuite::TestHelpers::assorted_primitives_id(::djinni_generated::AssortedPrimitives::toCpp(i));
return ::djinni_generated::AssortedPrimitives::fromCpp(r); return ::djinni_generated::AssortedPrimitives::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nonnull NSData *)idBinary:(nonnull NSData *)b { + (nonnull NSData *)idBinary:(nonnull NSData *)b {
try { try {
auto r = ::TestHelpers::id_binary(::djinni::Binary::toCpp(b)); auto r = ::testsuite::TestHelpers::id_binary(::djinni::Binary::toCpp(b));
return ::djinni::Binary::fromCpp(r); return ::djinni::Binary::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
...@@ -215,7 +215,7 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType ...@@ -215,7 +215,7 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
if (!cpp) { if (!cpp) {
return nil; return nil;
} }
return ::djinni::DbxCppWrapperCache<::TestHelpers>::getInstance()->get(cpp, [] (const CppType& p) { return ::djinni::DbxCppWrapperCache<::testsuite::TestHelpers>::getInstance()->get(cpp, [] (const CppType& p) {
return [[DBTestHelpers alloc] initWithCpp:p]; return [[DBTestHelpers alloc] initWithCpp:p];
}); });
} }
......
...@@ -13,7 +13,7 @@ namespace djinni_generated { ...@@ -13,7 +13,7 @@ namespace djinni_generated {
class UserToken class UserToken
{ {
public: public:
using CppType = std::shared_ptr<::UserToken>; using CppType = std::shared_ptr<::testsuite::UserToken>;
using ObjcType = id<DBUserToken>; using ObjcType = id<DBUserToken>;
using Boxed = UserToken; using Boxed = UserToken;
......
...@@ -14,15 +14,15 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -14,15 +14,15 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
@interface DBUserTokenCppProxy : NSObject<DBUserToken> @interface DBUserTokenCppProxy : NSObject<DBUserToken>
- (id)initWithCpp:(const std::shared_ptr<::UserToken>&)cppRef; - (id)initWithCpp:(const std::shared_ptr<::testsuite::UserToken>&)cppRef;
@end @end
@implementation DBUserTokenCppProxy { @implementation DBUserTokenCppProxy {
::djinni::DbxCppWrapperCache<::UserToken>::Handle _cppRefHandle; ::djinni::DbxCppWrapperCache<::testsuite::UserToken>::Handle _cppRefHandle;
} }
- (id)initWithCpp:(const std::shared_ptr<::UserToken>&)cppRef - (id)initWithCpp:(const std::shared_ptr<::testsuite::UserToken>&)cppRef
{ {
if (self = [super init]) { if (self = [super init]) {
_cppRefHandle.assign(cppRef); _cppRefHandle.assign(cppRef);
...@@ -40,7 +40,7 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -40,7 +40,7 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
namespace djinni_generated { namespace djinni_generated {
class UserToken::ObjcProxy final class UserToken::ObjcProxy final
: public ::UserToken : public ::testsuite::UserToken
, public ::djinni::DbxObjcWrapperCache<ObjcProxy>::Handle , public ::djinni::DbxObjcWrapperCache<ObjcProxy>::Handle
{ {
public: public:
...@@ -77,7 +77,7 @@ auto UserToken::fromCpp(const CppType& cpp) -> ObjcType ...@@ -77,7 +77,7 @@ auto UserToken::fromCpp(const CppType& cpp) -> ObjcType
if (auto cppPtr = dynamic_cast<ObjcProxy*>(cpp.get())) { if (auto cppPtr = dynamic_cast<ObjcProxy*>(cpp.get())) {
return cppPtr->Handle::get(); return cppPtr->Handle::get();
} }
return ::djinni::DbxCppWrapperCache<::UserToken>::getInstance()->get(cpp, [] (const CppType& p) { return ::djinni::DbxCppWrapperCache<::testsuite::UserToken>::getInstance()->get(cpp, [] (const CppType& p) {
return [[DBUserTokenCppProxy alloc] initWithCpp:p]; return [[DBUserTokenCppProxy alloc] initWithCpp:p];
}); });
} }
......
#include "test_duration.hpp" #include "test_duration.hpp"
namespace testsuite {
std::string TestDuration::hoursString(std::chrono::duration<int32_t, std::ratio<3600>> dt) std::string TestDuration::hoursString(std::chrono::duration<int32_t, std::ratio<3600>> dt)
{ {
return std::to_string(dt.count()); return std::to_string(dt.count());
...@@ -101,3 +103,5 @@ int64_t TestDuration::unbox(std::experimental::optional<std::chrono::duration<in ...@@ -101,3 +103,5 @@ int64_t TestDuration::unbox(std::experimental::optional<std::chrono::duration<in
{ {
return dt ? dt->count() : -1; return dt ? dt->count() : -1;
} }
} // namespace testsuite
#include "cpp_exception_impl.hpp" #include "cpp_exception_impl.hpp"
#include <exception> #include <exception>
namespace testsuite {
int32_t CppExceptionImpl::throw_an_exception() { int32_t CppExceptionImpl::throw_an_exception() {
throw ExampleException(); throw ExampleException();
} }
...@@ -8,3 +10,5 @@ int32_t CppExceptionImpl::throw_an_exception() { ...@@ -8,3 +10,5 @@ int32_t CppExceptionImpl::throw_an_exception() {
std::shared_ptr<CppException> CppException::get() { std::shared_ptr<CppException> CppException::get() {
return std::make_shared<CppExceptionImpl>(); return std::make_shared<CppExceptionImpl>();
} }
} // namespace testsuite
#include "cpp_exception.hpp" #include "cpp_exception.hpp"
#include <exception> #include <exception>
namespace testsuite {
class ExampleException: public std::exception { class ExampleException: public std::exception {
virtual const char* what() const throw() { virtual const char* what() const throw() {
return "Exception Thrown"; return "Exception Thrown";
...@@ -16,3 +18,6 @@ class CppExceptionImpl : public CppException { ...@@ -16,3 +18,6 @@ class CppExceptionImpl : public CppException {
virtual int32_t throw_an_exception () override; virtual int32_t throw_an_exception () override;
}; };
} // namespace testsuite
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "user_token.hpp" #include "user_token.hpp"
#include <exception> #include <exception>
namespace testsuite {
SetRecord TestHelpers::get_set_record() { SetRecord TestHelpers::get_set_record() {
return SetRecord { { return SetRecord { {
"StringA", "StringA",
...@@ -142,3 +144,5 @@ AssortedPrimitives TestHelpers::assorted_primitives_id(const AssortedPrimitives ...@@ -142,3 +144,5 @@ AssortedPrimitives TestHelpers::assorted_primitives_id(const AssortedPrimitives
std::vector<uint8_t> TestHelpers::id_binary(const std::vector<uint8_t> & v) { std::vector<uint8_t> TestHelpers::id_binary(const std::vector<uint8_t> & v) {
return v; return v;
} }
} // namespace testsuite
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
#import "DBTestHelpers.h" #import "DBTestHelpers.h"
#import <XCTest/XCTest.h> #import <XCTest/XCTest.h>
using namespace testsuite;
@interface DBClientInterfaceTests : XCTestCase @interface DBClientInterfaceTests : XCTestCase
@end @end
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "cpp_exception_impl.hpp" #include "cpp_exception_impl.hpp"
using namespace testsuite;
@interface DBCppExceptionTests : XCTestCase @interface DBCppExceptionTests : XCTestCase
@end @end
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "date_record.hpp" #include "date_record.hpp"
#import <XCTest/XCTest.h> #import <XCTest/XCTest.h>
using namespace testsuite;
@interface DBDateRecordTests : XCTestCase @interface DBDateRecordTests : XCTestCase
@end @end
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include "map_record.hpp" #include "map_record.hpp"
using namespace testsuite;
@interface DBMapRecordTests : XCTestCase @interface DBMapRecordTests : XCTestCase
@end @end
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
#include "nested_collection.hpp" #include "nested_collection.hpp"
using namespace testsuite;
static NestedCollection cppNestedCollection { { {u8"String1", u8"String2"}, {u8"StringA", u8"StringB"} } }; static NestedCollection cppNestedCollection { { {u8"String1", u8"String2"}, {u8"StringA", u8"StringB"} } };
static DBNestedCollection *objcNestedCollection = [DBNestedCollection nestedCollectionWithSetList:@[ static DBNestedCollection *objcNestedCollection = [DBNestedCollection nestedCollectionWithSetList:@[
[NSSet setWithArray:@[ @"String1", @"String2" ]], [NSSet setWithArray:@[ @"String1", @"String2" ]],
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment