Commit d47163a4 authored by j4cbo's avatar j4cbo

Merge pull request #98 from dropbox/AT/IntelliJ

IntelliJ and Primitives Tests
parents 5a0a374b 0f9fcd4f
......@@ -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.
## 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
- Kannan Goundan
......
......@@ -14,5 +14,4 @@
return self;
}
@end
......@@ -3,3 +3,4 @@
/project/target
/test/result
/.idea/workspace.xml
/classes
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="HighlightingAdvisor">
<option name="SUGGEST_TYPE_AWARE_HIGHLIGHTING" value="false" />
<option name="TYPE_AWARE_HIGHLIGHTING_ENABLED" value="true" />
</component>
</project>
<project version="4" />
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/classes" />
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="masterDetails">
<states>
<state key="ProjectJDKs.UI">
<settings>
<last-edited>1.6</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/classes" />
</component>
</project>
\ No newline at end of file
......@@ -4,7 +4,8 @@
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/modules/src.iml" filepath="$PROJECT_DIR$/.idea/modules/src.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/src-build.iml" filepath="$PROJECT_DIR$/.idea/modules/src-build.iml" />
<module fileurl="file://$PROJECT_DIR$/../support-lib/support-lib.iml" filepath="$PROJECT_DIR$/../support-lib/support-lib.iml" />
<module fileurl="file://$PROJECT_DIR$/../test-suite/test-suite.iml" filepath="$PROJECT_DIR$/../test-suite/test-suite.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.path="$MODULE_DIR$/../../project" external.root.project.path="$MODULE_DIR$/../.." external.system.id="SBT" sbt.imports="sbt._, Keys._, _root_.com.typesafe.sbt.SbtStartScript._, _root_.sbt.plugins.IvyPlugin, _root_.sbt.plugins.JvmPlugin, _root_.sbt.plugins.CorePlugin, _root_.sbt.plugins.JUnitXmlReportPlugin" type="SBT_MODULE" version="4">
<module external.linked.project.id="src-build" external.linked.project.path="$MODULE_DIR$/../../project" external.root.project.path="$MODULE_DIR$/../.." external.system.id="SBT" sbt.imports="sbt._, Keys._, _root_.com.typesafe.sbt.SbtStartScript._, _root_.sbt.plugins.IvyPlugin, _root_.sbt.plugins.JvmPlugin, _root_.sbt.plugins.CorePlugin, _root_.sbt.plugins.JUnitXmlReportPlugin" sbt.resolvers="http://repo1.maven.org/maven2/|maven|public, /Users/atwyman/.ivy2/cache|ivy|Local cache" type="SBT_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/../../project/target/idea-classes" />
<output-test url="file://$MODULE_DIR$/../../project/target/idea-test-classes" />
......@@ -66,4 +66,3 @@
</orderEntry>
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="SBT" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="scala" name="Scala">
<configuration>
<option name="compilerLibraryLevel" value="Project" />
<option name="compilerLibraryName" value="SBT:: scala-compiler-bundle:2.11.0" />
<option name="compilerOptions" value="-feature -Xmax-classfile-name 143" />
<option name="deprecationWarnings" value="true" />
<option name="uncheckedWarnings" value="true" />
</configuration>
</facet>
</component>
<module external.linked.project.id="src" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="SBT" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/../../target/scala-2.11/classes" />
<output-test url="file://$MODULE_DIR$/../../target/scala-2.11/test-classes" />
<exclude-output />
<content url="file://$MODULE_DIR$/../..">
<sourceFolder url="file://$MODULE_DIR$/../../target/scala-2.11/src_managed/main" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../source" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../target/scala-2.11/src_managed/main" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/../../target/scala-2.11/src_managed/test" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/../../src/test/scala" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/../../target/scala-2.11/resource_managed/main" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/../../target/scala-2.11/src_managed/test" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/../../src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/../../target/scala-2.11/resource_managed/test" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/../../target/scala-2.11/resource_managed/main" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/../../src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/../../target/scala-2.11/resource_managed/test" type="java-test-resource" />
<excludeFolder url="file://$MODULE_DIR$/../../target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="SBT: com.github.scopt:scopt_2.11:3.2.0" level="project" />
<orderEntry type="library" name="SBT: org.scala-lang:scala-library:2.11.0" level="project" />
<orderEntry type="library" name="SBT: org.scala-lang.modules:scala-parser-combinators_2.11:1.0.1" level="project" />
<orderEntry type="library" name="SBT: com.github.scopt:scopt_2.11:3.2.0:jar" level="project" />
<orderEntry type="library" name="SBT: org.scala-lang:scala-library:2.11.0:jar" level="project" />
<orderEntry type="library" name="SBT: org.scala-lang.modules:scala-parser-combinators_2.11:1.0.1:jar" level="project" />
</component>
</module>
\ No newline at end of file
......@@ -10,9 +10,10 @@
<option value="$PROJECT_DIR$/project" />
</set>
</option>
<option name="sbtVersion" value="0.13.5" />
<option name="useAutoImport" value="true" />
<option name="useOurOwnAutoImport" value="true" />
</SbtProjectSettings>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ScalaCompilerConfiguration">
<option name="deprecationWarnings" value="true" />
<option name="uncheckedWarnings" value="true" />
<parameters>
<parameter value="-feature" />
<parameter value="-Xmax-classfile-name" />
<parameter value="143" />
</parameters>
<profile name="SBT 1" modules="src">
<option name="deprecationWarnings" value="true" />
<option name="uncheckedWarnings" value="true" />
<option name="featureWarnings" value="true" />
<parameters>
<parameter value="-Xmax-classfile-name" />
<parameter value="143" />
</parameters>
</profile>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>
\ No newline at end of file
......@@ -2,7 +2,6 @@
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="" />
<mapping directory="$PROJECT_DIR$/../../.." vcs="Git" />
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
......@@ -11,3 +11,7 @@ like to be generated. After input files are changed, run ./run_djinni.sh to rege
Testing
-------
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 @@
@import "enum.djinni"
@import "token.djinni"
@import "test.djinni"
@import "inttypes.djinni"
@import "primtypes.djinni"
@import "constants.djinni"
@import "date.djinni"
assorted_integers = record {
assorted_primitives = record {
b: bool;
eight: i8;
sixteen: i16;
thirtytwo: i32;
sixtyfour: i64;
fsixtyfour: f64;
o_b: optional<bool>;
o_eight: optional<i8>;
o_sixteen: optional<i16>;
o_thirtytwo: optional<i32>;
o_sixtyfour: optional<i64>;
o_fsixtyfour: optional<f64>;
} deriving (eq)
......@@ -30,7 +30,7 @@ test_helpers = interface +c {
static return_none(): optional<i32>;
# 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;
}
// 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) {
return lhs.eight == rhs.eight &&
bool operator==(const AssortedPrimitives& lhs, const AssortedPrimitives& rhs) {
return lhs.b == rhs.b &&
lhs.eight == rhs.eight &&
lhs.sixteen == rhs.sixteen &&
lhs.thirtytwo == rhs.thirtytwo &&
lhs.sixtyfour == rhs.sixtyfour &&
lhs.fsixtyfour == rhs.fsixtyfour &&
lhs.o_b == rhs.o_b &&
lhs.o_eight == rhs.o_eight &&
lhs.o_sixteen == rhs.o_sixteen &&
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);
}
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from inttypes.djinni
// This file generated by Djinni from primtypes.djinni
#pragma once
......@@ -7,34 +7,46 @@
#include <experimental/optional>
#include <utility>
struct AssortedIntegers final {
struct AssortedPrimitives final {
bool b;
int8_t eight;
int16_t sixteen;
int32_t thirtytwo;
int64_t sixtyfour;
double fsixtyfour;
std::experimental::optional<bool> o_b;
std::experimental::optional<int8_t> o_eight;
std::experimental::optional<int16_t> o_sixteen;
std::experimental::optional<int32_t> o_thirtytwo;
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 AssortedIntegers& lhs, const AssortedIntegers& rhs);
friend bool operator==(const AssortedPrimitives& lhs, const AssortedPrimitives& rhs);
friend bool operator!=(const AssortedPrimitives& lhs, const AssortedPrimitives& rhs);
AssortedIntegers(int8_t eight,
AssortedPrimitives(bool b,
int8_t eight,
int16_t sixteen,
int32_t thirtytwo,
int64_t sixtyfour,
double fsixtyfour,
std::experimental::optional<bool> o_b,
std::experimental::optional<int8_t> o_eight,
std::experimental::optional<int16_t> o_sixteen,
std::experimental::optional<int32_t> o_thirtytwo,
std::experimental::optional<int64_t> o_sixtyfour)
: eight(std::move(eight))
std::experimental::optional<int64_t> o_sixtyfour,
std::experimental::optional<double> o_fsixtyfour)
: b(std::move(b))
, eight(std::move(eight))
, sixteen(std::move(sixteen))
, thirtytwo(std::move(thirtytwo))
, sixtyfour(std::move(sixtyfour))
, fsixtyfour(std::move(fsixtyfour))
, o_b(std::move(o_b))
, o_eight(std::move(o_eight))
, o_sixteen(std::move(o_sixteen))
, o_thirtytwo(std::move(o_thirtytwo))
, o_sixtyfour(std::move(o_sixtyfour))
, o_fsixtyfour(std::move(o_fsixtyfour))
{}
};
......@@ -3,7 +3,7 @@
#pragma once
#include "assorted_integers.hpp"
#include "assorted_primitives.hpp"
#include "color.hpp"
#include "map_list_record.hpp"
#include "nested_collection.hpp"
......@@ -68,7 +68,7 @@ public:
static std::experimental::optional<int32_t> return_none();
/** 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);
};
// 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;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
public final class AssortedIntegers {
public final class AssortedPrimitives {
/*package*/ final boolean mB;
/*package*/ final byte mEight;
/*package*/ final short mSixteen;
......@@ -17,6 +19,10 @@ public final class AssortedIntegers {
/*package*/ final long mSixtyfour;
/*package*/ final double mFsixtyfour;
/*package*/ final Boolean mOB;
/*package*/ final Byte mOEight;
/*package*/ final Short mOSixteen;
......@@ -25,23 +31,37 @@ public final class AssortedIntegers {
/*package*/ final Long mOSixtyfour;
public AssortedIntegers(
/*package*/ final Double mOFsixtyfour;
public AssortedPrimitives(
boolean b,
byte eight,
short sixteen,
int thirtytwo,
long sixtyfour,
double fsixtyfour,
@CheckForNull Boolean oB,
@CheckForNull Byte oEight,
@CheckForNull Short oSixteen,
@CheckForNull Integer oThirtytwo,
@CheckForNull Long oSixtyfour) {
@CheckForNull Long oSixtyfour,
@CheckForNull Double oFsixtyfour) {
this.mB = b;
this.mEight = eight;
this.mSixteen = sixteen;
this.mThirtytwo = thirtytwo;
this.mSixtyfour = sixtyfour;
this.mFsixtyfour = fsixtyfour;
this.mOB = oB;
this.mOEight = oEight;
this.mOSixteen = oSixteen;
this.mOThirtytwo = oThirtytwo;
this.mOSixtyfour = oSixtyfour;
this.mOFsixtyfour = oFsixtyfour;
}
public boolean getB() {
return mB;
}
public byte getEight() {
......@@ -60,6 +80,15 @@ public final class AssortedIntegers {
return mSixtyfour;
}
public double getFsixtyfour() {
return mFsixtyfour;
}
@CheckForNull
public Boolean getOB() {
return mOB;
}
@CheckForNull
public Byte getOEight() {
return mOEight;
......@@ -80,19 +109,28 @@ public final class AssortedIntegers {
return mOSixtyfour;
}
@CheckForNull
public Double getOFsixtyfour() {
return mOFsixtyfour;
}
@Override
public boolean equals(@CheckForNull Object obj) {
if (!(obj instanceof AssortedIntegers)) {
if (!(obj instanceof AssortedPrimitives)) {
return false;
}
AssortedIntegers other = (AssortedIntegers) obj;
return this.mEight == other.mEight &&
AssortedPrimitives other = (AssortedPrimitives) obj;
return this.mB == other.mB &&
this.mEight == other.mEight &&
this.mSixteen == other.mSixteen &&
this.mThirtytwo == other.mThirtytwo &&
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.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.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 {
/** Ensures that we generate integer translation code */
@Nonnull
public static native AssortedIntegers assortedIntegersId(AssortedIntegers i);
public static native AssortedPrimitives assortedPrimitivesId(AssortedPrimitives i);
@Nonnull
public static native byte[] idBinary(byte[] b);
......
// 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"
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> {
const auto& data = ::djinni::JniClass<NativeAssortedIntegers>::get();
auto NativeAssortedPrimitives::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni::LocalRef<JniType> {
const auto& data = ::djinni::JniClass<NativeAssortedPrimitives>::get();
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::I16::fromCpp(jniEnv, c.sixteen),
::djinni::I32::fromCpp(jniEnv, c.thirtytwo),
::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::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::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);
return r;
}
auto NativeAssortedIntegers::toCpp(JNIEnv* jniEnv, JniType j) -> CppType {
::djinni::JniLocalScope jscope(jniEnv, 9);
auto NativeAssortedPrimitives::toCpp(JNIEnv* jniEnv, JniType j) -> CppType {
::djinni::JniLocalScope jscope(jniEnv, 13);
assert(j != nullptr);
const auto& data = ::djinni::JniClass<NativeAssortedIntegers>::get();
return {::djinni::I8::toCpp(jniEnv, jniEnv->GetByteField(j, data.field_mEight)),
const auto& data = ::djinni::JniClass<NativeAssortedPrimitives>::get();
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::I32::toCpp(jniEnv, jniEnv->GetIntField(j, data.field_mThirtytwo)),
::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::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::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
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from inttypes.djinni
// This file generated by Djinni from primtypes.djinni
#pragma once
#include "assorted_integers.hpp"
#include "assorted_primitives.hpp"
#include "djinni_support.hpp"
namespace djinni_generated {
class NativeAssortedIntegers final {
class NativeAssortedPrimitives final {
public:
using CppType = ::AssortedIntegers;
using CppType = ::AssortedPrimitives;
using JniType = jobject;
using Boxed = NativeAssortedIntegers;
using Boxed = NativeAssortedPrimitives;
~NativeAssortedIntegers();
~NativeAssortedPrimitives();
static CppType toCpp(JNIEnv* jniEnv, JniType j);
static ::djinni::LocalRef<JniType> fromCpp(JNIEnv* jniEnv, const CppType& c);
private:
NativeAssortedIntegers();
friend ::djinni::JniClass<NativeAssortedIntegers>;
NativeAssortedPrimitives();
friend ::djinni::JniClass<NativeAssortedPrimitives>;
const ::djinni::GlobalRef<jclass> clazz { ::djinni::jniFindClass("com/dropbox/djinni/test/AssortedIntegers") };
const jmethodID jconstructor { ::djinni::jniGetMethodID(clazz.get(), "<init>", "(BSIJLjava/lang/Byte;Ljava/lang/Short;Ljava/lang/Integer;Ljava/lang/Long;)V") };
const ::djinni::GlobalRef<jclass> clazz { ::djinni::jniFindClass("com/dropbox/djinni/test/AssortedPrimitives") };
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_mSixteen { ::djinni::jniGetFieldID(clazz.get(), "mSixteen", "S") };
const jfieldID field_mThirtytwo { ::djinni::jniGetFieldID(clazz.get(), "mThirtytwo", "I") };
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_mOSixteen { ::djinni::jniGetFieldID(clazz.get(), "mOSixteen", "Ljava/lang/Short;") };
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_mOFsixtyfour { ::djinni::jniGetFieldID(clazz.get(), "mOFsixtyfour", "Ljava/lang/Double;") };
};
} // namespace djinni_generated
......@@ -3,7 +3,7 @@
#include "NativeTestHelpers.hpp" // my header
#include "Marshal.hpp"
#include "NativeAssortedIntegers.hpp"
#include "NativeAssortedPrimitives.hpp"
#include "NativeClientInterface.hpp"
#include "NativeColor.hpp"
#include "NativeMapListRecord.hpp"
......@@ -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 */)
}
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 {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
auto r = ::TestHelpers::assorted_integers_id(::djinni_generated::NativeAssortedIntegers::toCpp(jniEnv, j_i));
return ::djinni_generated::NativeAssortedIntegers::fromCpp(jniEnv, r).release();
auto r = ::TestHelpers::assorted_primitives_id(::djinni_generated::NativeAssortedPrimitives::toCpp(jniEnv, j_i));
return ::djinni_generated::NativeAssortedPrimitives::fromCpp(jniEnv, r).release();
} 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!
// This file generated by Djinni from inttypes.djinni
// This file generated by Djinni from primtypes.djinni
#import "DBAssortedIntegers.h"
#include "assorted_integers.hpp"
#import "DBAssortedPrimitives.h"
#include "assorted_primitives.hpp"
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@class DBAssortedIntegers;
@class DBAssortedPrimitives;
namespace djinni_generated {
struct AssortedIntegers
struct AssortedPrimitives
{
using CppType = ::AssortedIntegers;
using ObjcType = DBAssortedIntegers*;
using CppType = ::AssortedPrimitives;
using ObjcType = DBAssortedPrimitives*;
using Boxed = AssortedIntegers;
using Boxed = AssortedPrimitives;
static CppType toCpp(ObjcType objc);
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!
// This file generated by Djinni from inttypes.djinni
// This file generated by Djinni from primtypes.djinni
#import <Foundation/Foundation.h>
@interface DBAssortedIntegers : NSObject
- (nonnull id)initWithEight:(int8_t)eight
@interface DBAssortedPrimitives : NSObject
- (nonnull id)initWithB:(BOOL)b
eight:(int8_t)eight
sixteen:(int16_t)sixteen
thirtytwo:(int32_t)thirtytwo
sixtyfour:(int64_t)sixtyfour
fsixtyfour:(double)fsixtyfour
oB:(nullable NSNumber *)oB
oEight:(nullable NSNumber *)oEight
oSixteen:(nullable NSNumber *)oSixteen
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;
......@@ -21,6 +27,10 @@
@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 * oSixteen;
......@@ -29,4 +39,6 @@
@property (nonatomic, readonly, nullable) NSNumber * oSixtyfour;
@property (nonatomic, readonly, nullable) NSNumber * oFsixtyfour;
@end
// 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
thirtytwo:(int32_t)thirtytwo
sixtyfour:(int64_t)sixtyfour
fsixtyfour:(double)fsixtyfour
oB:(nullable NSNumber *)oB
oEight:(nullable NSNumber *)oEight
oSixteen:(nullable NSNumber *)oSixteen
oThirtytwo:(nullable NSNumber *)oThirtytwo
oSixtyfour:(nullable NSNumber *)oSixtyfour
oFsixtyfour:(nullable NSNumber *)oFsixtyfour
{
if (self = [super init]) {
_b = b;
_eight = eight;
_sixteen = sixteen;
_thirtytwo = thirtytwo;
_sixtyfour = sixtyfour;
_fsixtyfour = fsixtyfour;
_oB = oB;
_oEight = oEight;
_oSixteen = oSixteen;
_oThirtytwo = oThirtytwo;
_oSixtyfour = oSixtyfour;
_oFsixtyfour = oFsixtyfour;
}
return self;
}
- (BOOL)isEqual:(id)other
{
if (![other isKindOfClass:[DBAssortedIntegers class]]) {
if (![other isKindOfClass:[DBAssortedPrimitives class]]) {
return NO;
}
DBAssortedIntegers *typedOther = (DBAssortedIntegers *)other;
return self.eight == typedOther.eight &&
DBAssortedPrimitives *typedOther = (DBAssortedPrimitives *)other;
return self.b == typedOther.b &&
self.eight == typedOther.eight &&
self.sixteen == typedOther.sixteen &&
self.thirtytwo == typedOther.thirtytwo &&
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.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.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
{
return NSStringFromClass([self class]).hash ^
(NSUInteger)self.b ^
(NSUInteger)self.eight ^
(NSUInteger)self.sixteen ^
(NSUInteger)self.thirtytwo ^
(NSUInteger)self.sixtyfour ^
(NSUInteger)self.fsixtyfour ^
self.oB.hash ^
self.oEight.hash ^
self.oSixteen.hash ^
self.oThirtytwo.hash ^
self.oSixtyfour.hash;
self.oSixtyfour.hash ^
self.oFsixtyfour.hash;
}
@end
......@@ -3,7 +3,7 @@
#import "DBTestHelpers+Private.h"
#import "DBTestHelpers.h"
#import "DBAssortedIntegers+Private.h"
#import "DBAssortedPrimitives+Private.h"
#import "DBClientInterface+Private.h"
#import "DBMapListRecord+Private.h"
#import "DBNestedCollection+Private.h"
......@@ -186,10 +186,10 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
} DJINNI_TRANSLATE_EXCEPTIONS()
}
+ (nonnull DBAssortedIntegers *)assortedIntegersId:(nonnull DBAssortedIntegers *)i {
+ (nonnull DBAssortedPrimitives *)assortedPrimitivesId:(nonnull DBAssortedPrimitives *)i {
try {
auto r = ::TestHelpers::assorted_integers_id(::djinni_generated::AssortedIntegers::toCpp(i));
return ::djinni_generated::AssortedIntegers::fromCpp(r);
auto r = ::TestHelpers::assorted_primitives_id(::djinni_generated::AssortedPrimitives::toCpp(i));
return ::djinni_generated::AssortedPrimitives::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS()
}
......
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from test.djinni
#import "DBAssortedIntegers.h"
#import "DBAssortedPrimitives.h"
#import "DBColor.h"
#import "DBMapListRecord.h"
#import "DBNestedCollection.h"
......@@ -60,7 +60,7 @@
+ (nullable NSNumber *)returnNone;
/** 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;
......
......@@ -135,8 +135,8 @@ void TestHelpers::check_enum_map(const std::unordered_map<color, std::string> &
void TestHelpers::check_enum(color) {} // stub
AssortedIntegers TestHelpers::assorted_integers_id(const AssortedIntegers & i) {
return i;
AssortedPrimitives TestHelpers::assorted_primitives_id(const AssortedPrimitives & p) {
return p;
}
std::vector<uint8_t> TestHelpers::id_binary(const std::vector<uint8_t> & v) {
......
......@@ -15,7 +15,7 @@ public class AllTests extends TestSuite {
mySuite.addTestSuite(CppExceptionTest.class);
mySuite.addTestSuite(ClientInterfaceTest.class);
mySuite.addTestSuite(EnumTest.class);
mySuite.addTestSuite(IntegerTest.class);
mySuite.addTestSuite(PrimitivesTest.class);
mySuite.addTestSuite(TokenTest.class);
return mySuite;
}
......
package com.dropbox.djinni.test;
import static junit.framework.Assert.assertTrue;
public class ClientInterfaceImpl extends ClientInterface {
@Override
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
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/generated-src/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/java/classes" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/handwritten-src/java" isTestSource="true" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/java/hamcrest-core-1.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/java/junit-4.11.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
</module>
\ No newline at end of file
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