diff options
| author | Ganesh Viswanathan <dev@genotrance.com> | 2020-04-05 23:55:44 -0500 |
|---|---|---|
| committer | Ganesh Viswanathan <dev@genotrance.com> | 2020-04-05 23:55:44 -0500 |
| commit | e911a9ee92a92beeb66bc716949c4f417fb0f816 (patch) | |
| tree | ca94471353e6ebc2ce39f3a8b595bcb7f8462c2d /tests | |
| parent | 534acf9259a233eb5cf0e59ae754b4c036893f81 (diff) | |
| download | nimterop-newalgo-3.tar.gz nimterop-newalgo-3.zip | |
ast2 multiple array type blocknewalgo-3
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/include/tast2.h | 37 | ||||
| -rw-r--r-- | tests/tast2.nim | 26 |
2 files changed, 54 insertions, 9 deletions
diff --git a/tests/include/tast2.h b/tests/include/tast2.h index 3f46849..75e9446 100644 --- a/tests/include/tast2.h +++ b/tests/include/tast2.h @@ -27,7 +27,7 @@ struct A4 { float f1; }; -typedef char *A9p[3]; //, A9[4]; +typedef char *A9p[3], A9[4]; typedef char *A10[3][6]; typedef char *(*A11)[3]; typedef struct A0 *A111[12]; @@ -113,6 +113,16 @@ void (*pcre_free)(void *), *(*pcre_stack_malloc)(size_t); +typedef int ImageView, MagickBooleanType; +typedef MagickBooleanType + (*DuplexTransferImageViewMethod)(const ImageView *,const ImageView *, + ImageView *,const size_t,const int,void *), + (*GetImageViewMethod)(const ImageView *,const size_t,const int,void *), + (*SetImageViewMethod)(ImageView *,const size_t,const int,void *), + (*TransferImageViewMethod)(const ImageView *,ImageView *,const size_t, + const int,void *), +(*UpdateImageViewMethod)(ImageView *,const size_t,const int,void *); + @@ -145,12 +155,15 @@ struct A4 { float f1; }; -typedef char *A9p[3]; //, A9[4]; +typedef char *A9p[3], A9[4]; typedef char *A10[3][6]; typedef char *(*A11)[3]; -typedef struct A1 *A111[12]; +typedef struct A0 *A111[12]; -typedef int **(*A12)(int, int b, int *c, int *, int *count[4], int (*func)(int, int)); +typedef int + **(*A12)(int, int b, int *c, int *, int *count[4], int (*func)(int, int)), + **(*A121)(float, float b, float *c, float *, float *count[4], float (*func)(float, float)), + **(*A122)(char, char b, char *c, char *, char *count[4], char (*func)(char, char)); typedef int A13(int, int, void (*func)(void)); struct A14 { volatile char a1; }; @@ -222,6 +235,22 @@ typedef enum VSPresetFormat { //struct A2 test_proc1(struct A0 a); +// Proc vars +void + *(*pcre_malloc)(size_t), + (*pcre_free)(void *), + *(*pcre_stack_malloc)(size_t); + +typedef MagickBooleanType + (*DuplexTransferImageViewMethod)(const ImageView *,const ImageView *, + ImageView *,const size_t,const int,void *), + (*GetImageViewMethod)(const ImageView *,const size_t,const int,void *), + (*SetImageViewMethod)(ImageView *,const size_t,const int,void *), + (*TransferImageViewMethod)(const ImageView *,ImageView *,const size_t, + const int,void *), +(*UpdateImageViewMethod)(ImageView *,const size_t,const int,void *); + + #endif #ifdef __cplusplus diff --git a/tests/tast2.nim b/tests/tast2.nim index 28ea7c5..4e60172 100644 --- a/tests/tast2.nim +++ b/tests/tast2.nim @@ -165,10 +165,10 @@ var a9p: A9p a9p[1] = nil a9p[2] = "hello".cstring -#Not implemented yet -#assert A9 is array[4, cchar] -#checkPragmas(A9, pHeaderImp) -#var a9: A9 +assert A9 is array[4, cchar] +checkPragmas(A9, pHeaderImp) +var a9: A9 +a9[2] = 'c' assert A10 is array[3, array[6, cstring]] checkPragmas(A10, pHeaderImp) @@ -308,4 +308,20 @@ assert pcre_free is proc(a1: pointer) {.cdecl.} checkPragmas(pcre_free, @["importc", "cdecl"] & pHeader) assert pcre_stack_malloc is proc(a1: uint): pointer {.cdecl.} -checkPragmas(pcre_stack_malloc, @["importc", "cdecl"] & pHeader)
\ No newline at end of file +checkPragmas(pcre_stack_malloc, @["importc", "cdecl"] & pHeader) + +assert DuplexTransferImageViewMethod is + proc (a1: ptr ImageView; a2: ptr ImageView; a3: ptr ImageView; a4: uint; + a5: cint; a6: pointer): MagickBooleanType {.cdecl.} + +assert GetImageViewMethod is + proc (a1: ptr ImageView; a2: uint; a3: cint; a4: pointer): MagickBooleanType {.cdecl.} + +assert SetImageViewMethod is + proc (a1: ptr ImageView; a2: uint; a3: cint; a4: pointer): MagickBooleanType {.cdecl.} + +assert TransferImageViewMethod is + proc (a1: ptr ImageView; a2: ptr ImageView; a3: uint; a4: cint; a5: pointer): MagickBooleanType {.cdecl.} + +assert UpdateImageViewMethod is + proc (a1: ptr ImageView; a2: uint; a3: cint; a4: pointer): MagickBooleanType {.cdecl.}
\ No newline at end of file |
