Commit c51780fe authored by Andrew Twyman's avatar Andrew Twyman

Flesh out test suite with basic test for all primitive types, in both languages.

parent 5a0a374b
...@@ -263,7 +263,7 @@ and Objective-C `NSInteger` are not used because their length varies by architec ...@@ -263,7 +263,7 @@ and Objective-C `NSInteger` are not used because their length varies by architec
integers are not included because they are not available in Java. integers are not included because they are not available in Java.
## Test Suite ## Test Suite
Run `make` in the `test-suite` directory to invoke the test suite. Run `make test` to invoke the test suite, found in the test-suite subdirectory.
## Authors ## Authors
- Kannan Goundan - Kannan Goundan
......
...@@ -14,5 +14,4 @@ ...@@ -14,5 +14,4 @@
return self; return self;
} }
@end @end
...@@ -11,3 +11,7 @@ like to be generated. After input files are changed, run ./run_djinni.sh to rege ...@@ -11,3 +11,7 @@ like to be generated. After input files are changed, run ./run_djinni.sh to rege
Testing Testing
------- -------
Run 'make java' or 'make objc' to test the given environment. Run 'make java' or 'make objc' to test the given environment.
You may need to have Xcode open for the simulator portion of the objc
tests to complete successfully. Try opening the app if you see a
failure connecting to the simulator.
\ No newline at end of file
...@@ -8,6 +8,6 @@ ...@@ -8,6 +8,6 @@
@import "enum.djinni" @import "enum.djinni"
@import "token.djinni" @import "token.djinni"
@import "test.djinni" @import "test.djinni"
@import "inttypes.djinni" @import "primtypes.djinni"
@import "constants.djinni" @import "constants.djinni"
@import "date.djinni" @import "date.djinni"
assorted_integers = record { assorted_primitives = record {
b: bool;
eight: i8; eight: i8;
sixteen: i16; sixteen: i16;
thirtytwo: i32; thirtytwo: i32;
sixtyfour: i64; sixtyfour: i64;
fsixtyfour: f64;
o_b: optional<bool>;
o_eight: optional<i8>; o_eight: optional<i8>;
o_sixteen: optional<i16>; o_sixteen: optional<i16>;
o_thirtytwo: optional<i32>; o_thirtytwo: optional<i32>;
o_sixtyfour: optional<i64>; o_sixtyfour: optional<i64>;
o_fsixtyfour: optional<f64>;
} deriving (eq) } deriving (eq)
...@@ -30,7 +30,7 @@ test_helpers = interface +c { ...@@ -30,7 +30,7 @@ test_helpers = interface +c {
static return_none(): optional<i32>; static return_none(): optional<i32>;
# Ensures that we generate integer translation code # Ensures that we generate integer translation code
static assorted_integers_id(i: assorted_integers): assorted_integers; static assorted_primitives_id(i: assorted_primitives): assorted_primitives;
static id_binary(b: binary): binary; static id_binary(b: binary): binary;
} }
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from inttypes.djinni // This file generated by Djinni from primtypes.djinni
#include "assorted_integers.hpp" // my header #include "assorted_primitives.hpp" // my header
bool operator==(const AssortedIntegers& lhs, const AssortedIntegers& rhs) { bool operator==(const AssortedPrimitives& lhs, const AssortedPrimitives& rhs) {
return lhs.eight == rhs.eight && return lhs.b == rhs.b &&
lhs.eight == rhs.eight &&
lhs.sixteen == rhs.sixteen && lhs.sixteen == rhs.sixteen &&
lhs.thirtytwo == rhs.thirtytwo && lhs.thirtytwo == rhs.thirtytwo &&
lhs.sixtyfour == rhs.sixtyfour && lhs.sixtyfour == rhs.sixtyfour &&
lhs.fsixtyfour == rhs.fsixtyfour &&
lhs.o_b == rhs.o_b &&
lhs.o_eight == rhs.o_eight && lhs.o_eight == rhs.o_eight &&
lhs.o_sixteen == rhs.o_sixteen && lhs.o_sixteen == rhs.o_sixteen &&
lhs.o_thirtytwo == rhs.o_thirtytwo && lhs.o_thirtytwo == rhs.o_thirtytwo &&
lhs.o_sixtyfour == rhs.o_sixtyfour; lhs.o_sixtyfour == rhs.o_sixtyfour &&
lhs.o_fsixtyfour == rhs.o_fsixtyfour;
} }
bool operator!=(const AssortedIntegers& lhs, const AssortedIntegers& rhs) { bool operator!=(const AssortedPrimitives& lhs, const AssortedPrimitives& rhs) {
return !(lhs == rhs); return !(lhs == rhs);
} }
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from inttypes.djinni // This file generated by Djinni from primtypes.djinni
#pragma once #pragma once
...@@ -7,34 +7,46 @@ ...@@ -7,34 +7,46 @@
#include <experimental/optional> #include <experimental/optional>
#include <utility> #include <utility>
struct AssortedIntegers final { struct AssortedPrimitives final {
bool b;
int8_t eight; int8_t eight;
int16_t sixteen; int16_t sixteen;
int32_t thirtytwo; int32_t thirtytwo;
int64_t sixtyfour; int64_t sixtyfour;
double fsixtyfour;
std::experimental::optional<bool> o_b;
std::experimental::optional<int8_t> o_eight; std::experimental::optional<int8_t> o_eight;
std::experimental::optional<int16_t> o_sixteen; std::experimental::optional<int16_t> o_sixteen;
std::experimental::optional<int32_t> o_thirtytwo; std::experimental::optional<int32_t> o_thirtytwo;
std::experimental::optional<int64_t> o_sixtyfour; std::experimental::optional<int64_t> o_sixtyfour;
std::experimental::optional<double> o_fsixtyfour;
friend bool operator==(const AssortedIntegers& lhs, const AssortedIntegers& rhs); friend bool operator==(const AssortedPrimitives& lhs, const AssortedPrimitives& rhs);
friend bool operator!=(const AssortedIntegers& lhs, const AssortedIntegers& rhs); friend bool operator!=(const AssortedPrimitives& lhs, const AssortedPrimitives& rhs);
AssortedIntegers(int8_t eight, AssortedPrimitives(bool b,
int8_t eight,
int16_t sixteen, int16_t sixteen,
int32_t thirtytwo, int32_t thirtytwo,
int64_t sixtyfour, int64_t sixtyfour,
double fsixtyfour,
std::experimental::optional<bool> o_b,
std::experimental::optional<int8_t> o_eight, std::experimental::optional<int8_t> o_eight,
std::experimental::optional<int16_t> o_sixteen, std::experimental::optional<int16_t> o_sixteen,
std::experimental::optional<int32_t> o_thirtytwo, std::experimental::optional<int32_t> o_thirtytwo,
std::experimental::optional<int64_t> o_sixtyfour) std::experimental::optional<int64_t> o_sixtyfour,
: eight(std::move(eight)) std::experimental::optional<double> o_fsixtyfour)
: b(std::move(b))
, eight(std::move(eight))
, sixteen(std::move(sixteen)) , sixteen(std::move(sixteen))
, thirtytwo(std::move(thirtytwo)) , thirtytwo(std::move(thirtytwo))
, sixtyfour(std::move(sixtyfour)) , sixtyfour(std::move(sixtyfour))
, fsixtyfour(std::move(fsixtyfour))
, o_b(std::move(o_b))
, o_eight(std::move(o_eight)) , o_eight(std::move(o_eight))
, o_sixteen(std::move(o_sixteen)) , o_sixteen(std::move(o_sixteen))
, o_thirtytwo(std::move(o_thirtytwo)) , o_thirtytwo(std::move(o_thirtytwo))
, o_sixtyfour(std::move(o_sixtyfour)) , o_sixtyfour(std::move(o_sixtyfour))
, o_fsixtyfour(std::move(o_fsixtyfour))
{} {}
}; };
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#pragma once #pragma once
#include "assorted_integers.hpp" #include "assorted_primitives.hpp"
#include "color.hpp" #include "color.hpp"
#include "map_list_record.hpp" #include "map_list_record.hpp"
#include "nested_collection.hpp" #include "nested_collection.hpp"
...@@ -68,7 +68,7 @@ public: ...@@ -68,7 +68,7 @@ public:
static std::experimental::optional<int32_t> return_none(); static std::experimental::optional<int32_t> return_none();
/** Ensures that we generate integer translation code */ /** Ensures that we generate integer translation code */
static AssortedIntegers assorted_integers_id(const AssortedIntegers & i); static AssortedPrimitives assorted_primitives_id(const AssortedPrimitives & i);
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);
}; };
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from inttypes.djinni // This file generated by Djinni from primtypes.djinni
package com.dropbox.djinni.test; package com.dropbox.djinni.test;
import javax.annotation.CheckForNull; import javax.annotation.CheckForNull;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
public final class AssortedIntegers { public final class AssortedPrimitives {
/*package*/ final boolean mB;
/*package*/ final byte mEight; /*package*/ final byte mEight;
/*package*/ final short mSixteen; /*package*/ final short mSixteen;
...@@ -17,6 +19,10 @@ public final class AssortedIntegers { ...@@ -17,6 +19,10 @@ public final class AssortedIntegers {
/*package*/ final long mSixtyfour; /*package*/ final long mSixtyfour;
/*package*/ final double mFsixtyfour;
/*package*/ final Boolean mOB;
/*package*/ final Byte mOEight; /*package*/ final Byte mOEight;
/*package*/ final Short mOSixteen; /*package*/ final Short mOSixteen;
...@@ -25,23 +31,37 @@ public final class AssortedIntegers { ...@@ -25,23 +31,37 @@ public final class AssortedIntegers {
/*package*/ final Long mOSixtyfour; /*package*/ final Long mOSixtyfour;
public AssortedIntegers( /*package*/ final Double mOFsixtyfour;
public AssortedPrimitives(
boolean b,
byte eight, byte eight,
short sixteen, short sixteen,
int thirtytwo, int thirtytwo,
long sixtyfour, long sixtyfour,
double fsixtyfour,
@CheckForNull Boolean oB,
@CheckForNull Byte oEight, @CheckForNull Byte oEight,
@CheckForNull Short oSixteen, @CheckForNull Short oSixteen,
@CheckForNull Integer oThirtytwo, @CheckForNull Integer oThirtytwo,
@CheckForNull Long oSixtyfour) { @CheckForNull Long oSixtyfour,
@CheckForNull Double oFsixtyfour) {
this.mB = b;
this.mEight = eight; this.mEight = eight;
this.mSixteen = sixteen; this.mSixteen = sixteen;
this.mThirtytwo = thirtytwo; this.mThirtytwo = thirtytwo;
this.mSixtyfour = sixtyfour; this.mSixtyfour = sixtyfour;
this.mFsixtyfour = fsixtyfour;
this.mOB = oB;
this.mOEight = oEight; this.mOEight = oEight;
this.mOSixteen = oSixteen; this.mOSixteen = oSixteen;
this.mOThirtytwo = oThirtytwo; this.mOThirtytwo = oThirtytwo;
this.mOSixtyfour = oSixtyfour; this.mOSixtyfour = oSixtyfour;
this.mOFsixtyfour = oFsixtyfour;
}
public boolean getB() {
return mB;
} }
public byte getEight() { public byte getEight() {
...@@ -60,6 +80,15 @@ public final class AssortedIntegers { ...@@ -60,6 +80,15 @@ public final class AssortedIntegers {
return mSixtyfour; return mSixtyfour;
} }
public double getFsixtyfour() {
return mFsixtyfour;
}
@CheckForNull
public Boolean getOB() {
return mOB;
}
@CheckForNull @CheckForNull
public Byte getOEight() { public Byte getOEight() {
return mOEight; return mOEight;
...@@ -80,19 +109,28 @@ public final class AssortedIntegers { ...@@ -80,19 +109,28 @@ public final class AssortedIntegers {
return mOSixtyfour; return mOSixtyfour;
} }
@CheckForNull
public Double getOFsixtyfour() {
return mOFsixtyfour;
}
@Override @Override
public boolean equals(@CheckForNull Object obj) { public boolean equals(@CheckForNull Object obj) {
if (!(obj instanceof AssortedIntegers)) { if (!(obj instanceof AssortedPrimitives)) {
return false; return false;
} }
AssortedIntegers other = (AssortedIntegers) obj; AssortedPrimitives other = (AssortedPrimitives) obj;
return this.mEight == other.mEight && return this.mB == other.mB &&
this.mEight == other.mEight &&
this.mSixteen == other.mSixteen && this.mSixteen == other.mSixteen &&
this.mThirtytwo == other.mThirtytwo && this.mThirtytwo == other.mThirtytwo &&
this.mSixtyfour == other.mSixtyfour && this.mSixtyfour == other.mSixtyfour &&
this.mFsixtyfour == other.mFsixtyfour &&
((this.mOB == null && other.mOB == null) || (this.mOB != null && this.mOB.equals(other.mOB))) &&
((this.mOEight == null && other.mOEight == null) || (this.mOEight != null && this.mOEight.equals(other.mOEight))) && ((this.mOEight == null && other.mOEight == null) || (this.mOEight != null && this.mOEight.equals(other.mOEight))) &&
((this.mOSixteen == null && other.mOSixteen == null) || (this.mOSixteen != null && this.mOSixteen.equals(other.mOSixteen))) && ((this.mOSixteen == null && other.mOSixteen == null) || (this.mOSixteen != null && this.mOSixteen.equals(other.mOSixteen))) &&
((this.mOThirtytwo == null && other.mOThirtytwo == null) || (this.mOThirtytwo != null && this.mOThirtytwo.equals(other.mOThirtytwo))) && ((this.mOThirtytwo == null && other.mOThirtytwo == null) || (this.mOThirtytwo != null && this.mOThirtytwo.equals(other.mOThirtytwo))) &&
((this.mOSixtyfour == null && other.mOSixtyfour == null) || (this.mOSixtyfour != null && this.mOSixtyfour.equals(other.mOSixtyfour))); ((this.mOSixtyfour == null && other.mOSixtyfour == null) || (this.mOSixtyfour != null && this.mOSixtyfour.equals(other.mOSixtyfour))) &&
((this.mOFsixtyfour == null && other.mOFsixtyfour == null) || (this.mOFsixtyfour != null && this.mOFsixtyfour.equals(other.mOFsixtyfour)));
} }
} }
...@@ -64,7 +64,7 @@ public abstract class TestHelpers { ...@@ -64,7 +64,7 @@ public abstract class TestHelpers {
/** Ensures that we generate integer translation code */ /** Ensures that we generate integer translation code */
@Nonnull @Nonnull
public static native AssortedIntegers assortedIntegersId(AssortedIntegers i); public static native AssortedPrimitives assortedPrimitivesId(AssortedPrimitives i);
@Nonnull @Nonnull
public static native byte[] idBinary(byte[] b); public static native byte[] idBinary(byte[] b);
......
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from inttypes.djinni // This file generated by Djinni from primtypes.djinni
#include "NativeAssortedIntegers.hpp" // my header #include "NativeAssortedPrimitives.hpp" // my header
#include "Marshal.hpp" #include "Marshal.hpp"
namespace djinni_generated { namespace djinni_generated {
NativeAssortedIntegers::NativeAssortedIntegers() = default; NativeAssortedPrimitives::NativeAssortedPrimitives() = default;
NativeAssortedIntegers::~NativeAssortedIntegers() = default; NativeAssortedPrimitives::~NativeAssortedPrimitives() = default;
auto NativeAssortedIntegers::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni::LocalRef<JniType> { auto NativeAssortedPrimitives::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni::LocalRef<JniType> {
const auto& data = ::djinni::JniClass<NativeAssortedIntegers>::get(); const auto& data = ::djinni::JniClass<NativeAssortedPrimitives>::get();
auto r = ::djinni::LocalRef<JniType>{jniEnv->NewObject(data.clazz.get(), data.jconstructor, auto r = ::djinni::LocalRef<JniType>{jniEnv->NewObject(data.clazz.get(), data.jconstructor,
::djinni::Bool::fromCpp(jniEnv, c.b),
::djinni::I8::fromCpp(jniEnv, c.eight), ::djinni::I8::fromCpp(jniEnv, c.eight),
::djinni::I16::fromCpp(jniEnv, c.sixteen), ::djinni::I16::fromCpp(jniEnv, c.sixteen),
::djinni::I32::fromCpp(jniEnv, c.thirtytwo), ::djinni::I32::fromCpp(jniEnv, c.thirtytwo),
::djinni::I64::fromCpp(jniEnv, c.sixtyfour), ::djinni::I64::fromCpp(jniEnv, c.sixtyfour),
::djinni::F64::fromCpp(jniEnv, c.fsixtyfour),
::djinni::Optional<std::experimental::optional, ::djinni::Bool>::fromCpp(jniEnv, c.o_b).get(),
::djinni::Optional<std::experimental::optional, ::djinni::I8>::fromCpp(jniEnv, c.o_eight).get(), ::djinni::Optional<std::experimental::optional, ::djinni::I8>::fromCpp(jniEnv, c.o_eight).get(),
::djinni::Optional<std::experimental::optional, ::djinni::I16>::fromCpp(jniEnv, c.o_sixteen).get(), ::djinni::Optional<std::experimental::optional, ::djinni::I16>::fromCpp(jniEnv, c.o_sixteen).get(),
::djinni::Optional<std::experimental::optional, ::djinni::I32>::fromCpp(jniEnv, c.o_thirtytwo).get(), ::djinni::Optional<std::experimental::optional, ::djinni::I32>::fromCpp(jniEnv, c.o_thirtytwo).get(),
::djinni::Optional<std::experimental::optional, ::djinni::I64>::fromCpp(jniEnv, c.o_sixtyfour).get())}; ::djinni::Optional<std::experimental::optional, ::djinni::I64>::fromCpp(jniEnv, c.o_sixtyfour).get(),
::djinni::Optional<std::experimental::optional, ::djinni::F64>::fromCpp(jniEnv, c.o_fsixtyfour).get())};
::djinni::jniExceptionCheck(jniEnv); ::djinni::jniExceptionCheck(jniEnv);
return r; return r;
} }
auto NativeAssortedIntegers::toCpp(JNIEnv* jniEnv, JniType j) -> CppType { auto NativeAssortedPrimitives::toCpp(JNIEnv* jniEnv, JniType j) -> CppType {
::djinni::JniLocalScope jscope(jniEnv, 9); ::djinni::JniLocalScope jscope(jniEnv, 13);
assert(j != nullptr); assert(j != nullptr);
const auto& data = ::djinni::JniClass<NativeAssortedIntegers>::get(); const auto& data = ::djinni::JniClass<NativeAssortedPrimitives>::get();
return {::djinni::I8::toCpp(jniEnv, jniEnv->GetByteField(j, data.field_mEight)), return {::djinni::Bool::toCpp(jniEnv, jniEnv->GetBooleanField(j, data.field_mB)),
::djinni::I8::toCpp(jniEnv, jniEnv->GetByteField(j, data.field_mEight)),
::djinni::I16::toCpp(jniEnv, jniEnv->GetShortField(j, data.field_mSixteen)), ::djinni::I16::toCpp(jniEnv, jniEnv->GetShortField(j, data.field_mSixteen)),
::djinni::I32::toCpp(jniEnv, jniEnv->GetIntField(j, data.field_mThirtytwo)), ::djinni::I32::toCpp(jniEnv, jniEnv->GetIntField(j, data.field_mThirtytwo)),
::djinni::I64::toCpp(jniEnv, jniEnv->GetLongField(j, data.field_mSixtyfour)), ::djinni::I64::toCpp(jniEnv, jniEnv->GetLongField(j, data.field_mSixtyfour)),
::djinni::F64::toCpp(jniEnv, jniEnv->GetDoubleField(j, data.field_mFsixtyfour)),
::djinni::Optional<std::experimental::optional, ::djinni::Bool>::toCpp(jniEnv, jniEnv->GetObjectField(j, data.field_mOB)),
::djinni::Optional<std::experimental::optional, ::djinni::I8>::toCpp(jniEnv, jniEnv->GetObjectField(j, data.field_mOEight)), ::djinni::Optional<std::experimental::optional, ::djinni::I8>::toCpp(jniEnv, jniEnv->GetObjectField(j, data.field_mOEight)),
::djinni::Optional<std::experimental::optional, ::djinni::I16>::toCpp(jniEnv, jniEnv->GetObjectField(j, data.field_mOSixteen)), ::djinni::Optional<std::experimental::optional, ::djinni::I16>::toCpp(jniEnv, jniEnv->GetObjectField(j, data.field_mOSixteen)),
::djinni::Optional<std::experimental::optional, ::djinni::I32>::toCpp(jniEnv, jniEnv->GetObjectField(j, data.field_mOThirtytwo)), ::djinni::Optional<std::experimental::optional, ::djinni::I32>::toCpp(jniEnv, jniEnv->GetObjectField(j, data.field_mOThirtytwo)),
::djinni::Optional<std::experimental::optional, ::djinni::I64>::toCpp(jniEnv, jniEnv->GetObjectField(j, data.field_mOSixtyfour))}; ::djinni::Optional<std::experimental::optional, ::djinni::I64>::toCpp(jniEnv, jniEnv->GetObjectField(j, data.field_mOSixtyfour)),
::djinni::Optional<std::experimental::optional, ::djinni::F64>::toCpp(jniEnv, jniEnv->GetObjectField(j, data.field_mOFsixtyfour))};
} }
} // namespace djinni_generated } // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from inttypes.djinni // This file generated by Djinni from primtypes.djinni
#pragma once #pragma once
#include "assorted_integers.hpp" #include "assorted_primitives.hpp"
#include "djinni_support.hpp" #include "djinni_support.hpp"
namespace djinni_generated { namespace djinni_generated {
class NativeAssortedIntegers final { class NativeAssortedPrimitives final {
public: public:
using CppType = ::AssortedIntegers; using CppType = ::AssortedPrimitives;
using JniType = jobject; using JniType = jobject;
using Boxed = NativeAssortedIntegers; using Boxed = NativeAssortedPrimitives;
~NativeAssortedIntegers(); ~NativeAssortedPrimitives();
static CppType toCpp(JNIEnv* jniEnv, JniType j); static CppType toCpp(JNIEnv* jniEnv, JniType j);
static ::djinni::LocalRef<JniType> fromCpp(JNIEnv* jniEnv, const CppType& c); static ::djinni::LocalRef<JniType> fromCpp(JNIEnv* jniEnv, const CppType& c);
private: private:
NativeAssortedIntegers(); NativeAssortedPrimitives();
friend ::djinni::JniClass<NativeAssortedIntegers>; friend ::djinni::JniClass<NativeAssortedPrimitives>;
const ::djinni::GlobalRef<jclass> clazz { ::djinni::jniFindClass("com/dropbox/djinni/test/AssortedIntegers") }; const ::djinni::GlobalRef<jclass> clazz { ::djinni::jniFindClass("com/dropbox/djinni/test/AssortedPrimitives") };
const jmethodID jconstructor { ::djinni::jniGetMethodID(clazz.get(), "<init>", "(BSIJLjava/lang/Byte;Ljava/lang/Short;Ljava/lang/Integer;Ljava/lang/Long;)V") }; const jmethodID jconstructor { ::djinni::jniGetMethodID(clazz.get(), "<init>", "(ZBSIJDLjava/lang/Boolean;Ljava/lang/Byte;Ljava/lang/Short;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Double;)V") };
const jfieldID field_mB { ::djinni::jniGetFieldID(clazz.get(), "mB", "Z") };
const jfieldID field_mEight { ::djinni::jniGetFieldID(clazz.get(), "mEight", "B") }; const jfieldID field_mEight { ::djinni::jniGetFieldID(clazz.get(), "mEight", "B") };
const jfieldID field_mSixteen { ::djinni::jniGetFieldID(clazz.get(), "mSixteen", "S") }; const jfieldID field_mSixteen { ::djinni::jniGetFieldID(clazz.get(), "mSixteen", "S") };
const jfieldID field_mThirtytwo { ::djinni::jniGetFieldID(clazz.get(), "mThirtytwo", "I") }; const jfieldID field_mThirtytwo { ::djinni::jniGetFieldID(clazz.get(), "mThirtytwo", "I") };
const jfieldID field_mSixtyfour { ::djinni::jniGetFieldID(clazz.get(), "mSixtyfour", "J") }; const jfieldID field_mSixtyfour { ::djinni::jniGetFieldID(clazz.get(), "mSixtyfour", "J") };
const jfieldID field_mFsixtyfour { ::djinni::jniGetFieldID(clazz.get(), "mFsixtyfour", "D") };
const jfieldID field_mOB { ::djinni::jniGetFieldID(clazz.get(), "mOB", "Ljava/lang/Boolean;") };
const jfieldID field_mOEight { ::djinni::jniGetFieldID(clazz.get(), "mOEight", "Ljava/lang/Byte;") }; const jfieldID field_mOEight { ::djinni::jniGetFieldID(clazz.get(), "mOEight", "Ljava/lang/Byte;") };
const jfieldID field_mOSixteen { ::djinni::jniGetFieldID(clazz.get(), "mOSixteen", "Ljava/lang/Short;") }; const jfieldID field_mOSixteen { ::djinni::jniGetFieldID(clazz.get(), "mOSixteen", "Ljava/lang/Short;") };
const jfieldID field_mOThirtytwo { ::djinni::jniGetFieldID(clazz.get(), "mOThirtytwo", "Ljava/lang/Integer;") }; const jfieldID field_mOThirtytwo { ::djinni::jniGetFieldID(clazz.get(), "mOThirtytwo", "Ljava/lang/Integer;") };
const jfieldID field_mOSixtyfour { ::djinni::jniGetFieldID(clazz.get(), "mOSixtyfour", "Ljava/lang/Long;") }; const jfieldID field_mOSixtyfour { ::djinni::jniGetFieldID(clazz.get(), "mOSixtyfour", "Ljava/lang/Long;") };
const jfieldID field_mOFsixtyfour { ::djinni::jniGetFieldID(clazz.get(), "mOFsixtyfour", "Ljava/lang/Double;") };
}; };
} // namespace djinni_generated } // namespace djinni_generated
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include "NativeTestHelpers.hpp" // my header #include "NativeTestHelpers.hpp" // my header
#include "Marshal.hpp" #include "Marshal.hpp"
#include "NativeAssortedIntegers.hpp" #include "NativeAssortedPrimitives.hpp"
#include "NativeClientInterface.hpp" #include "NativeClientInterface.hpp"
#include "NativeColor.hpp" #include "NativeColor.hpp"
#include "NativeMapListRecord.hpp" #include "NativeMapListRecord.hpp"
...@@ -220,12 +220,12 @@ CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_returnNone(J ...@@ -220,12 +220,12 @@ CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_returnNone(J
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */) } JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
} }
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_assortedIntegersId(JNIEnv* jniEnv, jobject /*this*/, jobject j_i) CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_assortedPrimitivesId(JNIEnv* jniEnv, jobject /*this*/, jobject j_i)
{ {
try { try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv); DJINNI_FUNCTION_PROLOGUE0(jniEnv);
auto r = ::TestHelpers::assorted_integers_id(::djinni_generated::NativeAssortedIntegers::toCpp(jniEnv, j_i)); auto r = ::TestHelpers::assorted_primitives_id(::djinni_generated::NativeAssortedPrimitives::toCpp(jniEnv, j_i));
return ::djinni_generated::NativeAssortedIntegers::fromCpp(jniEnv, r).release(); return ::djinni_generated::NativeAssortedPrimitives::fromCpp(jniEnv, r).release();
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */) } JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
} }
......
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from inttypes.djinni
#import "DBAssortedIntegers+Private.h"
#import "DJIMarshal+Private.h"
#include <cassert>
namespace djinni_generated {
auto AssortedIntegers::toCpp(ObjcType obj) -> CppType
{
assert(obj);
return {::djinni::I8::toCpp(obj.eight),
::djinni::I16::toCpp(obj.sixteen),
::djinni::I32::toCpp(obj.thirtytwo),
::djinni::I64::toCpp(obj.sixtyfour),
::djinni::Optional<std::experimental::optional, ::djinni::I8>::toCpp(obj.oEight),
::djinni::Optional<std::experimental::optional, ::djinni::I16>::toCpp(obj.oSixteen),
::djinni::Optional<std::experimental::optional, ::djinni::I32>::toCpp(obj.oThirtytwo),
::djinni::Optional<std::experimental::optional, ::djinni::I64>::toCpp(obj.oSixtyfour)};
}
auto AssortedIntegers::fromCpp(const CppType& cpp) -> ObjcType
{
return [[DBAssortedIntegers alloc] initWithEight:(::djinni::I8::fromCpp(cpp.eight))
sixteen:(::djinni::I16::fromCpp(cpp.sixteen))
thirtytwo:(::djinni::I32::fromCpp(cpp.thirtytwo))
sixtyfour:(::djinni::I64::fromCpp(cpp.sixtyfour))
oEight:(::djinni::Optional<std::experimental::optional, ::djinni::I8>::fromCpp(cpp.o_eight))
oSixteen:(::djinni::Optional<std::experimental::optional, ::djinni::I16>::fromCpp(cpp.o_sixteen))
oThirtytwo:(::djinni::Optional<std::experimental::optional, ::djinni::I32>::fromCpp(cpp.o_thirtytwo))
oSixtyfour:(::djinni::Optional<std::experimental::optional, ::djinni::I64>::fromCpp(cpp.o_sixtyfour))];
}
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from inttypes.djinni // This file generated by Djinni from primtypes.djinni
#import "DBAssortedIntegers.h" #import "DBAssortedPrimitives.h"
#include "assorted_integers.hpp" #include "assorted_primitives.hpp"
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file"); static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@class DBAssortedIntegers; @class DBAssortedPrimitives;
namespace djinni_generated { namespace djinni_generated {
struct AssortedIntegers struct AssortedPrimitives
{ {
using CppType = ::AssortedIntegers; using CppType = ::AssortedPrimitives;
using ObjcType = DBAssortedIntegers*; using ObjcType = DBAssortedPrimitives*;
using Boxed = AssortedIntegers; using Boxed = AssortedPrimitives;
static CppType toCpp(ObjcType objc); static CppType toCpp(ObjcType objc);
static ObjcType fromCpp(const CppType& cpp); static ObjcType fromCpp(const CppType& cpp);
......
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from primtypes.djinni
#import "DBAssortedPrimitives+Private.h"
#import "DJIMarshal+Private.h"
#include <cassert>
namespace djinni_generated {
auto AssortedPrimitives::toCpp(ObjcType obj) -> CppType
{
assert(obj);
return {::djinni::Bool::toCpp(obj.b),
::djinni::I8::toCpp(obj.eight),
::djinni::I16::toCpp(obj.sixteen),
::djinni::I32::toCpp(obj.thirtytwo),
::djinni::I64::toCpp(obj.sixtyfour),
::djinni::F64::toCpp(obj.fsixtyfour),
::djinni::Optional<std::experimental::optional, ::djinni::Bool>::toCpp(obj.oB),
::djinni::Optional<std::experimental::optional, ::djinni::I8>::toCpp(obj.oEight),
::djinni::Optional<std::experimental::optional, ::djinni::I16>::toCpp(obj.oSixteen),
::djinni::Optional<std::experimental::optional, ::djinni::I32>::toCpp(obj.oThirtytwo),
::djinni::Optional<std::experimental::optional, ::djinni::I64>::toCpp(obj.oSixtyfour),
::djinni::Optional<std::experimental::optional, ::djinni::F64>::toCpp(obj.oFsixtyfour)};
}
auto AssortedPrimitives::fromCpp(const CppType& cpp) -> ObjcType
{
return [[DBAssortedPrimitives alloc] initWithB:(::djinni::Bool::fromCpp(cpp.b))
eight:(::djinni::I8::fromCpp(cpp.eight))
sixteen:(::djinni::I16::fromCpp(cpp.sixteen))
thirtytwo:(::djinni::I32::fromCpp(cpp.thirtytwo))
sixtyfour:(::djinni::I64::fromCpp(cpp.sixtyfour))
fsixtyfour:(::djinni::F64::fromCpp(cpp.fsixtyfour))
oB:(::djinni::Optional<std::experimental::optional, ::djinni::Bool>::fromCpp(cpp.o_b))
oEight:(::djinni::Optional<std::experimental::optional, ::djinni::I8>::fromCpp(cpp.o_eight))
oSixteen:(::djinni::Optional<std::experimental::optional, ::djinni::I16>::fromCpp(cpp.o_sixteen))
oThirtytwo:(::djinni::Optional<std::experimental::optional, ::djinni::I32>::fromCpp(cpp.o_thirtytwo))
oSixtyfour:(::djinni::Optional<std::experimental::optional, ::djinni::I64>::fromCpp(cpp.o_sixtyfour))
oFsixtyfour:(::djinni::Optional<std::experimental::optional, ::djinni::F64>::fromCpp(cpp.o_fsixtyfour))];
}
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from inttypes.djinni // This file generated by Djinni from primtypes.djinni
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@interface DBAssortedIntegers : NSObject @interface DBAssortedPrimitives : NSObject
- (nonnull id)initWithEight:(int8_t)eight - (nonnull id)initWithB:(BOOL)b
eight:(int8_t)eight
sixteen:(int16_t)sixteen sixteen:(int16_t)sixteen
thirtytwo:(int32_t)thirtytwo thirtytwo:(int32_t)thirtytwo
sixtyfour:(int64_t)sixtyfour sixtyfour:(int64_t)sixtyfour
fsixtyfour:(double)fsixtyfour
oB:(nullable NSNumber *)oB
oEight:(nullable NSNumber *)oEight oEight:(nullable NSNumber *)oEight
oSixteen:(nullable NSNumber *)oSixteen oSixteen:(nullable NSNumber *)oSixteen
oThirtytwo:(nullable NSNumber *)oThirtytwo oThirtytwo:(nullable NSNumber *)oThirtytwo
oSixtyfour:(nullable NSNumber *)oSixtyfour; oSixtyfour:(nullable NSNumber *)oSixtyfour
oFsixtyfour:(nullable NSNumber *)oFsixtyfour;
@property (nonatomic, readonly) BOOL b;
@property (nonatomic, readonly) int8_t eight; @property (nonatomic, readonly) int8_t eight;
...@@ -21,6 +27,10 @@ ...@@ -21,6 +27,10 @@
@property (nonatomic, readonly) int64_t sixtyfour; @property (nonatomic, readonly) int64_t sixtyfour;
@property (nonatomic, readonly) double fsixtyfour;
@property (nonatomic, readonly, nullable) NSNumber * oB;
@property (nonatomic, readonly, nullable) NSNumber * oEight; @property (nonatomic, readonly, nullable) NSNumber * oEight;
@property (nonatomic, readonly, nullable) NSNumber * oSixteen; @property (nonatomic, readonly, nullable) NSNumber * oSixteen;
...@@ -29,4 +39,6 @@ ...@@ -29,4 +39,6 @@
@property (nonatomic, readonly, nullable) NSNumber * oSixtyfour; @property (nonatomic, readonly, nullable) NSNumber * oSixtyfour;
@property (nonatomic, readonly, nullable) NSNumber * oFsixtyfour;
@end @end
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from inttypes.djinni // This file generated by Djinni from primtypes.djinni
#import "DBAssortedIntegers.h" #import "DBAssortedPrimitives.h"
@implementation DBAssortedIntegers @implementation DBAssortedPrimitives
- (id)initWithEight:(int8_t)eight - (id)initWithB:(BOOL)b
eight:(int8_t)eight
sixteen:(int16_t)sixteen sixteen:(int16_t)sixteen
thirtytwo:(int32_t)thirtytwo thirtytwo:(int32_t)thirtytwo
sixtyfour:(int64_t)sixtyfour sixtyfour:(int64_t)sixtyfour
fsixtyfour:(double)fsixtyfour
oB:(nullable NSNumber *)oB
oEight:(nullable NSNumber *)oEight oEight:(nullable NSNumber *)oEight
oSixteen:(nullable NSNumber *)oSixteen oSixteen:(nullable NSNumber *)oSixteen
oThirtytwo:(nullable NSNumber *)oThirtytwo oThirtytwo:(nullable NSNumber *)oThirtytwo
oSixtyfour:(nullable NSNumber *)oSixtyfour oSixtyfour:(nullable NSNumber *)oSixtyfour
oFsixtyfour:(nullable NSNumber *)oFsixtyfour
{ {
if (self = [super init]) { if (self = [super init]) {
_b = b;
_eight = eight; _eight = eight;
_sixteen = sixteen; _sixteen = sixteen;
_thirtytwo = thirtytwo; _thirtytwo = thirtytwo;
_sixtyfour = sixtyfour; _sixtyfour = sixtyfour;
_fsixtyfour = fsixtyfour;
_oB = oB;
_oEight = oEight; _oEight = oEight;
_oSixteen = oSixteen; _oSixteen = oSixteen;
_oThirtytwo = oThirtytwo; _oThirtytwo = oThirtytwo;
_oSixtyfour = oSixtyfour; _oSixtyfour = oSixtyfour;
_oFsixtyfour = oFsixtyfour;
} }
return self; return self;
} }
- (BOOL)isEqual:(id)other - (BOOL)isEqual:(id)other
{ {
if (![other isKindOfClass:[DBAssortedIntegers class]]) { if (![other isKindOfClass:[DBAssortedPrimitives class]]) {
return NO; return NO;
} }
DBAssortedIntegers *typedOther = (DBAssortedIntegers *)other; DBAssortedPrimitives *typedOther = (DBAssortedPrimitives *)other;
return self.eight == typedOther.eight && return self.b == typedOther.b &&
self.eight == typedOther.eight &&
self.sixteen == typedOther.sixteen && self.sixteen == typedOther.sixteen &&
self.thirtytwo == typedOther.thirtytwo && self.thirtytwo == typedOther.thirtytwo &&
self.sixtyfour == typedOther.sixtyfour && self.sixtyfour == typedOther.sixtyfour &&
self.fsixtyfour == typedOther.fsixtyfour &&
((self.oB == nil && typedOther.oB == nil) || (self.oB != nil && [self.oB isEqual:typedOther.oB])) &&
((self.oEight == nil && typedOther.oEight == nil) || (self.oEight != nil && [self.oEight isEqual:typedOther.oEight])) && ((self.oEight == nil && typedOther.oEight == nil) || (self.oEight != nil && [self.oEight isEqual:typedOther.oEight])) &&
((self.oSixteen == nil && typedOther.oSixteen == nil) || (self.oSixteen != nil && [self.oSixteen isEqual:typedOther.oSixteen])) && ((self.oSixteen == nil && typedOther.oSixteen == nil) || (self.oSixteen != nil && [self.oSixteen isEqual:typedOther.oSixteen])) &&
((self.oThirtytwo == nil && typedOther.oThirtytwo == nil) || (self.oThirtytwo != nil && [self.oThirtytwo isEqual:typedOther.oThirtytwo])) && ((self.oThirtytwo == nil && typedOther.oThirtytwo == nil) || (self.oThirtytwo != nil && [self.oThirtytwo isEqual:typedOther.oThirtytwo])) &&
((self.oSixtyfour == nil && typedOther.oSixtyfour == nil) || (self.oSixtyfour != nil && [self.oSixtyfour isEqual:typedOther.oSixtyfour])); ((self.oSixtyfour == nil && typedOther.oSixtyfour == nil) || (self.oSixtyfour != nil && [self.oSixtyfour isEqual:typedOther.oSixtyfour])) &&
((self.oFsixtyfour == nil && typedOther.oFsixtyfour == nil) || (self.oFsixtyfour != nil && [self.oFsixtyfour isEqual:typedOther.oFsixtyfour]));
} }
- (NSUInteger)hash - (NSUInteger)hash
{ {
return NSStringFromClass([self class]).hash ^ return NSStringFromClass([self class]).hash ^
(NSUInteger)self.b ^
(NSUInteger)self.eight ^ (NSUInteger)self.eight ^
(NSUInteger)self.sixteen ^ (NSUInteger)self.sixteen ^
(NSUInteger)self.thirtytwo ^ (NSUInteger)self.thirtytwo ^
(NSUInteger)self.sixtyfour ^ (NSUInteger)self.sixtyfour ^
(NSUInteger)self.fsixtyfour ^
self.oB.hash ^
self.oEight.hash ^ self.oEight.hash ^
self.oSixteen.hash ^ self.oSixteen.hash ^
self.oThirtytwo.hash ^ self.oThirtytwo.hash ^
self.oSixtyfour.hash; self.oSixtyfour.hash ^
self.oFsixtyfour.hash;
} }
@end @end
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#import "DBTestHelpers+Private.h" #import "DBTestHelpers+Private.h"
#import "DBTestHelpers.h" #import "DBTestHelpers.h"
#import "DBAssortedIntegers+Private.h" #import "DBAssortedPrimitives+Private.h"
#import "DBClientInterface+Private.h" #import "DBClientInterface+Private.h"
#import "DBMapListRecord+Private.h" #import "DBMapListRecord+Private.h"
#import "DBNestedCollection+Private.h" #import "DBNestedCollection+Private.h"
...@@ -186,10 +186,10 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -186,10 +186,10 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nonnull DBAssortedIntegers *)assortedIntegersId:(nonnull DBAssortedIntegers *)i { + (nonnull DBAssortedPrimitives *)assortedPrimitivesId:(nonnull DBAssortedPrimitives *)i {
try { try {
auto r = ::TestHelpers::assorted_integers_id(::djinni_generated::AssortedIntegers::toCpp(i)); auto r = ::TestHelpers::assorted_primitives_id(::djinni_generated::AssortedPrimitives::toCpp(i));
return ::djinni_generated::AssortedIntegers::fromCpp(r); return ::djinni_generated::AssortedPrimitives::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
......
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from test.djinni // This file generated by Djinni from test.djinni
#import "DBAssortedIntegers.h" #import "DBAssortedPrimitives.h"
#import "DBColor.h" #import "DBColor.h"
#import "DBMapListRecord.h" #import "DBMapListRecord.h"
#import "DBNestedCollection.h" #import "DBNestedCollection.h"
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
+ (nullable NSNumber *)returnNone; + (nullable NSNumber *)returnNone;
/** Ensures that we generate integer translation code */ /** Ensures that we generate integer translation code */
+ (nonnull DBAssortedIntegers *)assortedIntegersId:(nonnull DBAssortedIntegers *)i; + (nonnull DBAssortedPrimitives *)assortedPrimitivesId:(nonnull DBAssortedPrimitives *)i;
+ (nonnull NSData *)idBinary:(nonnull NSData *)b; + (nonnull NSData *)idBinary:(nonnull NSData *)b;
......
...@@ -135,8 +135,8 @@ void TestHelpers::check_enum_map(const std::unordered_map<color, std::string> & ...@@ -135,8 +135,8 @@ void TestHelpers::check_enum_map(const std::unordered_map<color, std::string> &
void TestHelpers::check_enum(color) {} // stub void TestHelpers::check_enum(color) {} // stub
AssortedIntegers TestHelpers::assorted_integers_id(const AssortedIntegers & i) { AssortedPrimitives TestHelpers::assorted_primitives_id(const AssortedPrimitives & p) {
return i; return p;
} }
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) {
......
...@@ -15,7 +15,7 @@ public class AllTests extends TestSuite { ...@@ -15,7 +15,7 @@ public class AllTests extends TestSuite {
mySuite.addTestSuite(CppExceptionTest.class); mySuite.addTestSuite(CppExceptionTest.class);
mySuite.addTestSuite(ClientInterfaceTest.class); mySuite.addTestSuite(ClientInterfaceTest.class);
mySuite.addTestSuite(EnumTest.class); mySuite.addTestSuite(EnumTest.class);
mySuite.addTestSuite(IntegerTest.class); mySuite.addTestSuite(PrimitivesTest.class);
mySuite.addTestSuite(TokenTest.class); mySuite.addTestSuite(TokenTest.class);
return mySuite; return mySuite;
} }
......
package com.dropbox.djinni.test; package com.dropbox.djinni.test;
import static junit.framework.Assert.assertTrue;
public class ClientInterfaceImpl extends ClientInterface { public class ClientInterfaceImpl extends ClientInterface {
@Override @Override
public ClientReturnedRecord getRecord(long id, String utf8string, String misc) { public ClientReturnedRecord getRecord(long id, String utf8string, String misc) {
......
package com.dropbox.djinni.test;
import junit.framework.TestCase;
public class IntegerTest extends TestCase {
public void testIntegers() {
AssortedIntegers i = new AssortedIntegers((byte)123, (short)20000, 1000000000, 1234567890123456789L,
(byte)123, (short)20000, 1000000000, 1234567890123456789L);
assertEquals(i, TestHelpers.assortedIntegersId(i));
}
}
package com.dropbox.djinni.test;
import junit.framework.TestCase;
public class PrimitivesTest extends TestCase {
public void testPrimitives() {
AssortedPrimitives p = new AssortedPrimitives(true, (byte)123, (short)20000, 1000000000, 1234567890123456789L, 1.23d,
true, (byte)123, (short)20000, 1000000000, 1234567890123456789L, 1.23d);
assertEquals(p, TestHelpers.assortedPrimitivesId(p));
}
}
#import <Foundation/Foundation.h>
#import <XCTest/XCTest.h>
#import "DBAssortedPrimitives.h"
#import "DBTestHelpers.h"
@interface DBPrimitivesTests : XCTestCase
@end
@implementation DBPrimitivesTests
- (void)setUp
{
[super setUp];
}
- (void)tearDown
{
[super tearDown];
}
- (void)testPrimitives
{
DBAssortedPrimitives * p = [[DBAssortedPrimitives alloc]
initWithB:YES
eight:(int8_t)123
sixteen:(int16_t)20000
thirtytwo:(int32_t)1000000000
sixtyfour:(int64_t)1234567890123456789L
fsixtyfour:1.23L
oB:[NSNumber numberWithBool:YES]
oEight:[NSNumber numberWithChar:123]
oSixteen:[NSNumber numberWithShort:20000]
oThirtytwo:[NSNumber numberWithInt:1000000000]
oSixtyfour:[NSNumber numberWithLongLong:1234567890123456789L]
oFsixtyfour:[NSNumber numberWithDouble:123L]];
XCTAssertEqualObjects(p, [DBTestHelpers assortedPrimitivesId:p]);
}
- (void)testObjcToCppConverter
{
}
- (void)testCppToObjcConverter
{
}
@end
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