exip  Alpha 0.5.4
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
check_exip.c File Reference

Tests the whole EXIP library with some test input data. More...

#include <stdio.h>
#include <stdlib.h>
#include <check.h>
#include "procTypes.h"
#include "EXISerializer.h"
#include "EXIParser.h"
#include "stringManipulate.h"
#include "grammarGenerator.h"

Go to the source code of this file.

Data Structures

struct  senml_elem
 
struct  senml
 
struct  AppData
 

Macros

#define MAX_PATH_LEN   200
 
#define OUTPUT_BUFFER_SIZE   2000
 
#define TRY_CATCH_ENCODE(func)   TRY_CATCH(func, serialize.closeEXIStream(&testStrm))
 
#define OUTPUT_BUFFER_SIZE_LARGE_DOC   20000
 
#define MAX_XSD_FILES_COUNT   10
 
#define INPUT_BUFFER_SIZE   200
 
#define BN_STR_SIZE   50
 
#define ALL_STR_SIZE   20
 
#define E_ELEM_COUNT   7
 

Enumerations

enum  Attr {
  BN = 0, BT = 1, BU = 2, VER = 3,
  BV = 4, N = 5, S = 6, SV = 7,
  T = 8, U = 9, UT = 10, V = 11,
  NON = 12
}
 
enum  Elem { ELEM_SEN_ML = 0, ELEM_E = 1, ELEM_NON = 2 }
 

Functions

 START_TEST (test_default_options)
 
END_TEST START_TEST (test_fragment_option)
 
END_TEST START_TEST (test_value_part_zero)
 
END_TEST START_TEST (test_recursive_defs)
 
END_TEST errorCode encodeWithDynamicTypes (char *buf, int buf_size, int *strmSize)
 
 START_TEST (test_built_in_dynamic_types)
 Example use of the xsi:type switch for dynamic typing of element and attribute values. More...
 
 START_TEST (test_large_doc_str_pattern)
 
 START_TEST (test_substitution_groups)
 
END_TEST errorCode encodeNonBlockingStreaming (EXIPSchema *schema, char *flushBuf, int buf_size, int *strmSize, unsigned char alignment)
 
 START_TEST (test_non_blocking_streaming)
 
END_TEST START_TEST (test_non_blocking_streaming_bytealigned)
 
errorCode encodeSenML (EXIPSchema *schema, senml senmlData, char *buf, int buflen, size_t *size)
 Given an input of senmlData, it encodes an EXI stream (using default EXI options) in buf and returns the size of the resultion stream in size. More...
 
errorCode decodeSenML (EXIPSchema *schema, char *buf, int buflen, senml *senmlData)
 Given an input EXI stream of SenML data (using default EXI options), it decodes the data from the stream into senmlData output argument. More...
 
 START_TEST (test_various_senml)
 
Suiteexip_suite (void)
 
int main (int argc, char *argv[])
 

Variables

const String NS_SENML_STR = {"urn:ietf:params:xml:ns:senml", 28}
 
const String NS_EMPTY_STR = {NULL, 0}
 
const String ELEM_E_STR = {"e", 1}
 
const String ELEM_SENML_STR = {"senml", 5}
 
const String ATTR_BN_STR = {"bn", 2}
 
const String ATTR_BT_STR = {"bt", 2}
 
const String ATTR_BU_STR = {"bu", 2}
 
const String ATTR_VER_STR = {"ver", 3}
 
const String ATTR_N_STR = {"n", 1}
 
const String ATTR_U_STR = {"u", 1}
 
const String ATTR_V_STR = {"v", 1}
 
const String ATTR_SV_STR = {"sv", 2}
 
const String ATTR_BV_STR = {"bv", 2}
 
const String ATTR_S_STR = {"s", 1}
 
const String ATTR_T_STR = {"t", 1}
 
const String ATTR_UT_STR = {"ut", 2}
 

Detailed Description

Date
Nov 4, 2011
Author
Rumen Kyusakov
Version
0.5
[Revision] $Id: check_exip.c 350 2014-11-24 14:32:23Z kjussakov $

Definition in file check_exip.c.

Macro Definition Documentation

#define ALL_STR_SIZE   20

Definition at line 1967 of file check_exip.c.

#define BN_STR_SIZE   50

Definition at line 1966 of file check_exip.c.

#define E_ELEM_COUNT   7

Definition at line 2498 of file check_exip.c.

#define INPUT_BUFFER_SIZE   200

Definition at line 1225 of file check_exip.c.

#define MAX_PATH_LEN   200

Definition at line 27 of file check_exip.c.

#define MAX_XSD_FILES_COUNT   10

Definition at line 856 of file check_exip.c.

#define OUTPUT_BUFFER_SIZE   2000

Definition at line 28 of file check_exip.c.

#define OUTPUT_BUFFER_SIZE_LARGE_DOC   20000

Definition at line 855 of file check_exip.c.

#define TRY_CATCH_ENCODE (   func)    TRY_CATCH(func, serialize.closeEXIStream(&testStrm))

Definition at line 36 of file check_exip.c.

Enumeration Type Documentation

enum Attr
Enumerator
BN 
BT 
BU 
VER 
BV 
N 
S 
SV 
T 
U 
UT 
V 
NON 

Definition at line 2189 of file check_exip.c.

enum Elem
Enumerator
ELEM_SEN_ML 
ELEM_E 
ELEM_NON 

Definition at line 2205 of file check_exip.c.

Function Documentation

errorCode decodeSenML ( EXIPSchema schema,
char *  buf,
int  buflen,
senml senmlData 
)

Definition at line 2227 of file check_exip.c.

END_TEST errorCode encodeNonBlockingStreaming ( EXIPSchema schema,
char *  flushBuf,
int  buf_size,
int *  strmSize,
unsigned char  alignment 
)

Definition at line 1441 of file check_exip.c.

errorCode encodeSenML ( EXIPSchema schema,
senml  senmlData,
char *  buf,
int  buflen,
size_t *  size 
)

Definition at line 2025 of file check_exip.c.

END_TEST errorCode encodeWithDynamicTypes ( char *  buf,
int  buf_size,
int *  strmSize 
)

Definition at line 760 of file check_exip.c.

Suite* exip_suite ( void  )

Definition at line 2692 of file check_exip.c.

int main ( int  argc,
char *  argv[] 
)

Definition at line 2719 of file check_exip.c.

START_TEST ( test_default_options  )

Definition at line 40 of file check_exip.c.

END_TEST START_TEST ( test_fragment_option  )

Definition at line 149 of file check_exip.c.

END_TEST START_TEST ( test_value_part_zero  )

Definition at line 280 of file check_exip.c.

END_TEST START_TEST ( test_recursive_defs  )

Definition at line 475 of file check_exip.c.

START_TEST ( test_built_in_dynamic_types  )

Note that schemaId must be set to SCHEMA_ID_EMPTY in order to use the built-in schema types. Encodes the following XML:

<trivial xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <anElement xsi:type="xsd:date">2014-01-31T16:15:25+02:00</anElement> </trivial>

Definition at line 712 of file check_exip.c.

START_TEST ( test_large_doc_str_pattern  )

Definition at line 859 of file check_exip.c.

START_TEST ( test_substitution_groups  )

Definition at line 1228 of file check_exip.c.

START_TEST ( test_non_blocking_streaming  )

Definition at line 1295 of file check_exip.c.

END_TEST START_TEST ( test_non_blocking_streaming_bytealigned  )

Definition at line 1368 of file check_exip.c.

START_TEST ( test_various_senml  )

Definition at line 2500 of file check_exip.c.

Variable Documentation

const String ATTR_BN_STR = {"bn", 2}

Definition at line 2011 of file check_exip.c.

const String ATTR_BT_STR = {"bt", 2}

Definition at line 2012 of file check_exip.c.

const String ATTR_BU_STR = {"bu", 2}

Definition at line 2013 of file check_exip.c.

const String ATTR_BV_STR = {"bv", 2}

Definition at line 2020 of file check_exip.c.

const String ATTR_N_STR = {"n", 1}

Definition at line 2016 of file check_exip.c.

const String ATTR_S_STR = {"s", 1}

Definition at line 2021 of file check_exip.c.

const String ATTR_SV_STR = {"sv", 2}

Definition at line 2019 of file check_exip.c.

const String ATTR_T_STR = {"t", 1}

Definition at line 2022 of file check_exip.c.

const String ATTR_U_STR = {"u", 1}

Definition at line 2017 of file check_exip.c.

const String ATTR_UT_STR = {"ut", 2}

Definition at line 2023 of file check_exip.c.

const String ATTR_V_STR = {"v", 1}

Definition at line 2018 of file check_exip.c.

const String ATTR_VER_STR = {"ver", 3}

Definition at line 2014 of file check_exip.c.

const String ELEM_E_STR = {"e", 1}

Definition at line 2008 of file check_exip.c.

const String ELEM_SENML_STR = {"senml", 5}

Definition at line 2009 of file check_exip.c.

const String NS_EMPTY_STR = {NULL, 0}

Definition at line 2006 of file check_exip.c.

const String NS_SENML_STR = {"urn:ietf:params:xml:ns:senml", 28}

Definition at line 2005 of file check_exip.c.