X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=core%2FBasetype.hh;h=6c7e77b1b51b0bb5911bb8958fc8c7471e16bf27;hb=3f84031e48520efb2cbc931692210e5de7fa5919;hp=9eb970c7d30815d5636fc752b0e0218f5e25dea1;hpb=3abe9331b564f65690bdf2ebe001271a7011b0e2;p=deliverable%2Ftitan.core.git diff --git a/core/Basetype.hh b/core/Basetype.hh index 9eb970c..6c7e77b 100644 --- a/core/Basetype.hh +++ b/core/Basetype.hh @@ -375,6 +375,7 @@ public: virtual ASN_BER_TLV_t* BER_encode_negtest_raw() const; virtual int encode_raw(TTCN_Buffer& p_buf) const; virtual int RAW_encode_negtest_raw(RAW_enc_tree& p_myleaf) const; + virtual int JSON_encode_negtest_raw(JSON_Tokenizer&) const; #endif /** Examines whether this message corresponds the tags in the @@ -575,6 +576,17 @@ public: * @note Basetype::JSON_encode throws an error. */ VIRTUAL_IF_RUNTIME_2 int JSON_encode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer&) const; +#ifdef TITAN_RUNTIME_2 + /** Encode with JSON encoding negative test. + * @return the length of the encoding + * @param p_err_descr erroneous type descriptor + * @param p_td type descriptor + * @param p_tok JSON tokenizer for the encoded data + * @note Basetype::JSON_encode_negtest throws an error. */ + virtual int JSON_encode_negtest(const Erroneous_descriptor_t* p_err_descr, const TTCN_Typedescriptor_t& p_td, + JSON_Tokenizer& p_tok) const; +#endif + /** Decode JSON. * @return decoded length * @note Basetype::JSON_decode throws an error. */ @@ -800,6 +812,11 @@ public: * Returns the length of the encoded data. */ int JSON_encode(const TTCN_Typedescriptor_t&, JSON_Tokenizer&) const; + /** Negative testing for the JSON encoder + * Encodes this value according to the JSON encoding rules, but with the + * modifications (errors) specified in the erroneous descriptor parameter. */ + int JSON_encode_negtest(const Erroneous_descriptor_t*, const TTCN_Typedescriptor_t&, JSON_Tokenizer&) const; + /** Decodes accordingly to the JSON encoding rules. * Returns the length of the decoded data. */ int JSON_decode(const TTCN_Typedescriptor_t&, JSON_Tokenizer&, boolean); @@ -943,6 +960,11 @@ public: * Returns the length of the encoded data. */ int JSON_encode(const TTCN_Typedescriptor_t&, JSON_Tokenizer&) const; + /** Negative testing for the JSON encoder + * Encodes this value according to the JSON encoding rules, but with the + * modifications (errors) specified in the erroneous descriptor parameter. */ + int JSON_encode_negtest(const Erroneous_descriptor_t*, const TTCN_Typedescriptor_t&, JSON_Tokenizer&) const; + /** Decodes accordingly to the JSON encoding rules. * Returns the length of the decoded data. */ int JSON_decode(const TTCN_Typedescriptor_t&, JSON_Tokenizer&, boolean);