Commit 805c1eda authored by Jacob Potter's avatar Jacob Potter

Add some test comments to the test suite's Djinni files

parent c871d91e
......@@ -139,7 +139,6 @@ class ObjcGenerator(spec: Spec) extends Generator(spec) {
}
writeObjcFile(marshal.headerName(ident), origin, refs.header, w => {
writeDoc(w, doc)
for (c <- i.consts) {
writeDoc(w, c.doc)
w.w(s"extern ")
......@@ -147,6 +146,7 @@ class ObjcGenerator(spec: Spec) extends Generator(spec) {
w.wl(s";")
}
w.wl
writeDoc(w, doc)
if (i.ext.objc) w.wl(s"@protocol $self") else w.wl(s"@interface $self : NSObject")
for (m <- i.methods) {
w.wl
......
# Record returned by a client
client_returned_record = record {
record_id: i64;
content: string;
misc: optional<string>;
}
# Client interface
client_interface = interface +j +o {
# Returns record of given string
get_record(record_id: i64, utf8string: string, misc: optional<string>): client_returned_record;
......
......@@ -2,12 +2,16 @@ constants = record {
some_integer: i32;
some_string: string;
# bool_constant has documentation.
const bool_constant: bool = true;
const i8_constant: i8 = 1;
const i16_constant: i16 = 2;
const i32_constant: i32 = 3;
const i64_constant: i64 = 4;
const f32_constant: f32 = 5.0;
# f64_constant has long documentation.
# (Second line of multi-line documentation.
# Indented third line of multi-line documentation.)
const f64_constant: f64 = 5.0;
const string_constant: string = "string-constant";
const optional_integer_constant: optional<i32> = 1;
......@@ -18,11 +22,16 @@ constants = record {
};
}
# Interface containing constants
constants_interface = interface +c {
const bool_constant: bool = true;
const i8_constant: i8 = 1;
const i16_constant: i16 = 2;
# i32_constant has documentation.
const i32_constant: i32 = 3;
# i64_constant has long documentation.
# (Second line of multi-line documentation.
# Indented third line of multi-line documentation.)
const i64_constant: i64 = 4;
const f32_constant: f32 = 5.0;
const f64_constant: f64 = 5.0;
......
# Helper methods used by various different tests.
# (Second line of multi-line documentation.
# Indented third line of multi-line documentation.)
test_helpers = interface +c {
# Method with documentation
static get_set_record(): set_record;
# Method with long documentation
# (Second line of multi-line documentation.
# Indented third line of multi-line documentation.)
static check_set_record(rec: set_record): bool;
static get_primitive_list(): primitive_list;
......@@ -35,6 +42,9 @@ test_helpers = interface +c {
static id_binary(b: binary): binary;
}
# Empty record
# (Second line of multi-line documentation.
# Indented third line of multi-line documentation.)
empty_record = record {
}
......@@ -9,6 +9,7 @@
#include <string>
#include <vector>
/** Client interface */
class ClientInterface {
public:
virtual ~ClientInterface() {}
......
......@@ -8,6 +8,7 @@
#include <string>
#include <utility>
/** Record returned by a client */
struct ClientReturnedRecord final {
int64_t record_id;
std::string content;
......
......@@ -10,6 +10,7 @@
struct Constants final {
/** bool_constant has documentation. */
static bool const BOOL_CONSTANT;
static int8_t const I8_CONSTANT;
......@@ -22,6 +23,11 @@ struct Constants final {
static float const F32_CONSTANT;
/**
* f64_constant has long documentation.
* (Second line of multi-line documentation.
* Indented third line of multi-line documentation.)
*/
static double const F64_CONSTANT;
static std::string const STRING_CONSTANT;
......
......@@ -5,6 +5,7 @@
#include <cstdint>
/** Interface containing constants */
class ConstantsInterface {
public:
virtual ~ConstantsInterface() {}
......@@ -15,8 +16,14 @@ public:
static int16_t const I16_CONSTANT;
/** i32_constant has documentation. */
static int32_t const I32_CONSTANT;
/**
* i64_constant has long documentation.
* (Second line of multi-line documentation.
* Indented third line of multi-line documentation.)
*/
static int64_t const I64_CONSTANT;
static float const F32_CONSTANT;
......
......@@ -5,5 +5,10 @@
#include <utility>
/**
* Empty record
* (Second line of multi-line documentation.
* Indented third line of multi-line documentation.)
*/
struct EmptyRecord final {
};
......@@ -19,12 +19,23 @@
class ClientInterface;
class UserToken;
/**
* Helper methods used by various different tests.
* (Second line of multi-line documentation.
* Indented third line of multi-line documentation.)
*/
class TestHelpers {
public:
virtual ~TestHelpers() {}
/** Method with documentation */
static SetRecord get_set_record();
/**
* Method with long documentation
* (Second line of multi-line documentation.
* Indented third line of multi-line documentation.)
*/
static bool check_set_record(const SetRecord & rec);
static PrimitiveList get_primitive_list();
......
......@@ -6,6 +6,7 @@ package com.dropbox.djinni.test;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
/** Client interface */
public abstract class ClientInterface {
/** Returns record of given string */
@Nonnull
......
......@@ -6,6 +6,7 @@ package com.dropbox.djinni.test;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
/** Record returned by a client */
public final class ClientReturnedRecord {
......
......@@ -8,6 +8,7 @@ import javax.annotation.Nonnull;
public final class Constants {
/** bool_constant has documentation. */
public static final boolean BOOL_CONSTANT = true;
public static final byte I8_CONSTANT = 1;
......@@ -20,6 +21,11 @@ public final class Constants {
public static final float F32_CONSTANT = 5.0f;
/**
* f64_constant has long documentation.
* (Second line of multi-line documentation.
* Indented third line of multi-line documentation.)
*/
public static final double F64_CONSTANT = 5.0;
@Nonnull
......
......@@ -7,6 +7,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
/** Interface containing constants */
public abstract class ConstantsInterface {
public static final boolean BOOL_CONSTANT = true;
......@@ -14,8 +15,14 @@ public abstract class ConstantsInterface {
public static final short I16_CONSTANT = 2;
/** i32_constant has documentation. */
public static final int I32_CONSTANT = 3;
/**
* i64_constant has long documentation.
* (Second line of multi-line documentation.
* Indented third line of multi-line documentation.)
*/
public static final long I64_CONSTANT = 4;
public static final float F32_CONSTANT = 5.0f;
......
......@@ -6,6 +6,11 @@ package com.dropbox.djinni.test;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
/**
* Empty record
* (Second line of multi-line documentation.
* Indented third line of multi-line documentation.)
*/
public final class EmptyRecord {
......
......@@ -8,10 +8,21 @@ import java.util.concurrent.atomic.AtomicBoolean;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
/**
* Helper methods used by various different tests.
* (Second line of multi-line documentation.
* Indented third line of multi-line documentation.)
*/
public abstract class TestHelpers {
/** Method with documentation */
@Nonnull
public static native SetRecord getSetRecord();
/**
* Method with long documentation
* (Second line of multi-line documentation.
* Indented third line of multi-line documentation.)
*/
public static native boolean checkSetRecord(@Nonnull SetRecord rec);
@Nonnull
......
......@@ -5,6 +5,7 @@
#import <Foundation/Foundation.h>
/** Client interface */
@protocol DBClientInterface
/** Returns record of given string */
......
......@@ -3,6 +3,7 @@
#import <Foundation/Foundation.h>
/** Record returned by a client */
@interface DBClientReturnedRecord : NSObject
- (nonnull instancetype)initWithRecordId:(int64_t)recordId
content:(nonnull NSString *)content
......
......@@ -16,12 +16,18 @@
@end
/** bool_constant has documentation. */
extern BOOL const DBConstantsBoolConstant;
extern int8_t const DBConstantsI8Constant;
extern int16_t const DBConstantsI16Constant;
extern int32_t const DBConstantsI32Constant;
extern int64_t const DBConstantsI64Constant;
extern float const DBConstantsF32Constant;
/**
* f64_constant has long documentation.
* (Second line of multi-line documentation.
* Indented third line of multi-line documentation.)
*/
extern double const DBConstantsF64Constant;
extern NSString * __nonnull const DBConstantsStringConstant;
extern NSNumber * __nullable const DBConstantsOptionalIntegerConstant;
......
......@@ -6,11 +6,18 @@
extern BOOL const DBConstantsInterfaceBoolConstant;
extern int8_t const DBConstantsInterfaceI8Constant;
extern int16_t const DBConstantsInterfaceI16Constant;
/** i32_constant has documentation. */
extern int32_t const DBConstantsInterfaceI32Constant;
/**
* i64_constant has long documentation.
* (Second line of multi-line documentation.
* Indented third line of multi-line documentation.)
*/
extern int64_t const DBConstantsInterfaceI64Constant;
extern float const DBConstantsInterfaceF32Constant;
extern double const DBConstantsInterfaceF64Constant;
/** Interface containing constants */
@interface DBConstantsInterface : NSObject
- (void)dummy;
......
......@@ -3,6 +3,11 @@
#import <Foundation/Foundation.h>
/**
* Empty record
* (Second line of multi-line documentation.
* Indented third line of multi-line documentation.)
*/
@interface DBEmptyRecord : NSObject
- (nonnull instancetype)init;
+ (nonnull instancetype)emptyRecord;
......
......@@ -12,10 +12,21 @@
@protocol DBUserToken;
/**
* Helper methods used by various different tests.
* (Second line of multi-line documentation.
* Indented third line of multi-line documentation.)
*/
@interface DBTestHelpers : NSObject
/** Method with documentation */
+ (nonnull DBSetRecord *)getSetRecord;
/**
* Method with long documentation
* (Second line of multi-line documentation.
* Indented third line of multi-line documentation.)
*/
+ (BOOL)checkSetRecord:(nonnull DBSetRecord *)rec;
+ (nonnull DBPrimitiveList *)getPrimitiveList;
......
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