|
libsheepy
|
#include <stdlib.h>#include <stdio.h>#include <check.h>#include "../libsheepy.h"#include "../libsheepyObject.h"
Go to the source code of this file.
Macros | |
| #define | UNUSED |
Functions | |
| createSmallDict (obj) | |
| ck_assert_str_eq (obj.type, "smallDict") | |
| createAllocateSmallDict (obj2) | |
| ck_assert_str_eq (obj2->type, "smallDict") | |
| ck_assert_str_eq (s, "{}") | |
| free (s) | |
| createAllocateSmallBool (oBool2) | |
| oBool2 f | set (oBool2, true) |
| obj2 f | set (obj2, "lib",(baset *) oBool2) |
| finishO (oBool2) | |
| ck_assert_ptr_ne (oBool3, NULL) | |
| ck_assert (oBool3->value->value==true) | |
| finishO (oBool3) | |
| terminateO (o) | |
| createAllocateUndefined (oU) | |
| obj2 f | set (obj2, "u",(baset *) oU) |
| finishO (oU) | |
| createAllocateSmallString (oStr) | |
| oStr f | set (oStr, "sheepy") |
| obj2 f | set (obj2, "str",(baset *) oStr) |
| finishO (oStr) | |
| ck_assert_str_eq (s, "{\ib\true,\\null,\tr\\heepy\") | |
| sFree (data) | |
| o f | dispose (o) |
| ck_assert_uint_eq (o->f->len(o), 0) | |
| terminateO (u) | |
| smashO (st) | |
| smashO (oBool2) | |
| ck_assert_ptr_eq (o, NULL) | |
| obj2 f | set (obj2, NULL, NULL) |
| obj2 f | set (obj2, "no", NULL) |
| ck_assert_uint_eq (obj2->f->len(obj2), 3) | |
| ck_assert_ptr_eq (oBool3, NULL) | |
| ck_assert_ptr_eq (obj2->f->get(obj2, NULL), NULL) | |
| obj2 f | del (obj2, "lib") |
| obj2 f | del (obj2, NULL) |
| obj2 f | del (obj2, "non existing") |
| ck_assert (!obj2->f->has(obj2, "qwe")) | |
| ck_assert (!obj2->f->has(obj2, NULL)) | |
| ck_assert (obj2->f->has(obj2, "u")) | |
| ck_assert_uint_eq (len, 2) | |
| ck_assert_str_eq (keys[0], "u") | |
| ck_assert_str_eq (keys[1], "str") | |
| listFreeS (keys) | |
| ck_assert_ptr_eq (keys, NULL) | |
| ck_assert_str_eq (s, "[null,\heepy\") | |
| ck_assert_ptr_eq (values, NULL) | |
| st f | set (st, "SHEEPY MERGED") |
| oM f | set (oM, "str",(baset *) st) |
| finishO (st) | |
| ck_assert_str_eq (s, "{\\null,\tr\\heepy\") | |
| o f | merge (o, oM) |
| ck_assert_str_eq (s, "{\\null,\tr\\HEEPY MERGED\") | |
| o f | merge (o, NULL) |
| oM f | set (oM, "u2",(baset *) oU) |
| o f | append (o, oM) |
| ck_assert_str_eq (s, "{\\null,\tr\\heepy\\2\null}") | |
| o f | append (o, NULL) |
| ck_assert_uint_eq (obj2->f->len(obj2), 2) | |
| o f | empty (o) |
| o f | set (o, "u",(baset *) oU) |
| o f | set (o, "str",(baset *) st) |
| o f | set (o, "b",(baset *) oBool2) |
| o f | set (o, "B",(baset *) oBool2) |
| o f | del (o, "B") |
| ck_assert_str_eq (s, "bool") | |
| ck_assert_ptr_eq (o->f->typeString(o, "B"), NULL) | |
| ck_assert_ptr_eq (oM->f->typeString(oM, "B"), NULL) | |
| ck_assert_uint_eq (c, STRING) | |
| ck_assert (!o->f->type(o, "B")) | |
| ck_assert (!oM->f->type(oM, "B")) | |
| ck_assert_str_eq (s, "{\\\ndefined\\tr\\tring\\\\ool\") | |
| terminateO (oT) | |
| ck_assert_ptr_eq (oT, NULL) | |
| terminateO (oM) | |
| ck_assert_ptr_eq (obj2, NULL) | |
| END_TEST | createSmallJson (obj) |
| ck_assert_str_eq (obj.type, "smallJson") | |
| createAllocateSmallJson (obj2) | |
| ck_assert_str_eq (obj2->type, "smallJson") | |
| createAllocateSmallInt (oInt) | |
| oInt f | set (oInt, 123) |
| obj2 f | set (obj2, "int",(baset *) oInt) |
| finishO (oInt) | |
| obj2 f | set (obj2, "int2",(baset *) oInt) |
| obj2 f | push (obj2,(baset *) oInt) |
| ck_assert_str_eq (s, "{\nt\123,\nt2\123}") | |
| terminateO (obj2) | |
| createAllocateSmallInt (oInt2) | |
| oInt2 f | set (oInt2, 123) |
| finishO (oInt2) | |
| obj2 f | set (obj2, "noEffect",(baset *) oInt2) |
| ck_assert_str_eq (s, "[123,123]") | |
| createAllocateSmallInt (oInt3) | |
| oInt3 f | set (oInt3, 123) |
| finishO (oInt3) | |
| ck_assert_str_eq (s, "{\nt\123}") | |
| o f | push (o,(baset *) oInt) |
| ck_assert_uint_eq (o->topA->count, 1) | |
| ck_assert_ptr_eq (o->topA, NULL) | |
| sFree (i) | |
| o f | set (o, "in",(baset *) oInt) |
| ck_assert_uint_eq (o->top->count, 1) | |
| o f | setTypeUndefined (o) |
| ck_assert_str_eq (o->f->getTopType(o), "undefined") | |
| o f | setTypeBool (o) |
| ck_assert_str_eq (o->f->getTopType(o), "bool") | |
| o f | setTypeDouble (o) |
| ck_assert_str_eq (o->f->getTopType(o), "double") | |
| o f | setTypeInt (o) |
| ck_assert_str_eq (o->f->getTopType(o), "int") | |
| o f | setTypeString (o) |
| ck_assert_str_eq (o->f->getTopType(o), "string") | |
| o f | setTypeDict (o) |
| ck_assert_str_eq (o->f->getTopType(o), "dict") | |
| o f | setTypeArray (o) |
| ck_assert_str_eq (o->f->getTopType(o), "array") | |
| ck_assert_ptr_eq (o->f->getTopType(o), NULL) | |
| createAllocateSmallContainer (jcontainer) | |
| o f | setTop (o,(baset *) jcontainer) |
| terminateO (jcontainer) | |
| ck_assert_ptr_eq (b, NULL) | |
| createAllocateUndefined (jUndef) | |
| finishO (jUndef) | |
| ck_assert_str_eq (b->type, "undefined") | |
| finishO (b) | |
| ck_assert_str_eq (s, "null") | |
| ck_assert_str_eq (s, "---\ null") | |
| freeO (o) | |
| createAllocateSmallBool (jBool) | |
| finishO (jBool) | |
| ck_assert_str_eq (b->type, "smallBool") | |
| ck_assert_str_eq (s, "false") | |
| ck_assert_str_eq (s, "---\ false") | |
| createAllocateSmallDouble (jDouble) | |
| finishO (jDouble) | |
| ck_assert_str_eq (b->type, "smallDouble") | |
| ck_assert_str_eq (s, "0.000000e+00") | |
| ck_assert_str_eq (s, "---\ 0.000000e+00") | |
| createAllocateSmallInt (jInt) | |
| finishO (jInt) | |
| ck_assert_str_eq (b->type, "smallInt") | |
| ck_assert_str_eq (s, "0") | |
| ck_assert_str_eq (s, "---\ 0") | |
| createAllocateSmallString (jString) | |
| jString f | set (jString, "sheepy") |
| finishO (jString) | |
| ck_assert_str_eq (b->type, "smallString") | |
| ck_assert_str_eq (s, "sheepy") | |
| ck_assert_str_eq (s, "\heepy\) | |
| ck_assert_str_eq (s, "---\ \heepy\) | |
| createAllocateSmallDict (jdict) | |
| finishO (jdict) | |
| ck_assert_str_eq (b->type, "smallDict") | |
| ck_assert_str_eq (s, "{}\) | |
| ck_assert_str_eq (s, "---\ {}\) | |
| createAllocateSmallArray (jArray) | |
| finishO (jArray) | |
| ck_assert_str_eq (b->type, "smallArray") | |
| ck_assert_str_eq (s, "[]") | |
| ck_assert_str_eq (s, "[]\) | |
| ck_assert_str_eq (s, "---\ []\) | |
| ck_assert (in->value->value==123) | |
| createAllocateSmallDict (oD2) | |
| oD2 f | set (oD2, "int",(baset *) in2) |
| finishO (in2) | |
| oD2 f | set (oD2, "int2",(baset *) in2) |
| obj2 f | set (obj2, "dict",(baset *) oD2) |
| finishO (oD2) | |
| createAllocateSmallArray (oTA2) | |
| oTA2 f | push (oTA2,(baset *) in2) |
| smashO (in) | |
| obj2 f | set (obj2, "array",(baset *) oTA2) |
| finishO (oTA2) | |
| ck_assert_ptr_eq (in, NULL) | |
| createAllocateSmallJson (json) | |
| createAllocateSmallInt (oInt4) | |
| oInt4 f | set (oInt4, 345) |
| json f | push (json,(baset *) oInt4) |
| finishO (oInt4) | |
| createSmallJson (jpath) | |
| createSmallBool (ba) | |
| jpath f set & | jpath (&ba) |
| ck_assert (jBool->value->value==false) | |
| createSmallBool (bb) | |
| jpath f set & | jpath (baset *)&bb |
| ck_assert_str_eq (jArray->type, "smallArray") | |
| ck_assert_uint_eq (lenO(jArray), 1) | |
| finishG (jArray) | |
| ck_assert_uint_eq (in->value->value, 11) | |
| finishG (in) | |
| createSmallBool (be) | |
| finishG (jBool) | |
| createSmallBool (b2) | |
| ck_assert_ptr_ne (o2, NULL) | |
| createSmallBool (b3) | |
| ck_assert_str_eq (ks, "\\\\\\") | |
| createSmallBool (b4) | |
| pErrorNULL (iPrependS(&ks, "[1]")) | |
| free (ks) | |
| finishG (b) | |
| createSmallBool (b0) | |
| ck_assert_ptr_eq (o2, NULL) | |
| ck_assert_uint_eq (o->f->len(o), 1) | |
| sFree ((smallt *) o->topS) | |
| o f | set (o, "wer",(baset *) in) |
| finishO (in) | |
| jdict f | set (jdict, "string",(baset *) jString) |
| jdict f | set (jdict, "container",(baset *) jcontainer) |
| finishO (jcontainer) | |
| jArray f | push (jArray,(baset *) jString) |
| ck_assert_str_eq (s, "[\ 345,\ \heepy\\ {},\ [],\ {\ \tring\ \heepy\\ \ontainer\ \data container>\ },\ [\ \heepy\\ \data container>\ ]\\) | |
| createAllocateSmallJson (json2) | |
| json2 f | set (json2, "s",(baset *) jString) |
| json2 f | set (json2, "d",(baset *) jdict) |
| json2 f | set (json2, "a",(baset *) jArray) |
| json2 f | set (json2, "d2",(baset *) jdict) |
| json2 f | set (json2, "a2",(baset *) jArray) |
| json2 f | set (json2, "int",(baset *) oInt4) |
| ck_assert_str_eq (s, "{\ \\ \heepy\\ \\ {},\ \\ [],\ \2\ {\ \tring\ \heepy\\ \ontainer\ \data container>\ },\ \2\ [\ \heepy\\ \data container>\ ],\ \nt\ 345\\) | |
| ck_assert_str_eq (s, "---\ - 345\ - sheepy\ - {}\ - []\ - string: sheepy\ container: \data container>\ - - sheepy\ - \data container>\") | |
| createAllocateSmallJson (json3) | |
| terminateO (json3) | |
| ck_assert_str_eq (s, "---\ s: sheepy\ d:\ {}\ a:\ []\ d2:\ string: sheepy\ container: \data container>\ a2:\ - sheepy\ - \data container>\ int: 345\) | |
| terminateO (json2) | |
| terminateO (json) | |
| json f | parse (json, "null") |
| ck_assert_str_eq (json->f->getTopType(json), "undefined") | |
| json f | parse (json, "true") |
| ck_assert_str_eq (json->f->getTopType(json), "bool") | |
| json f | parse (json, "0.01") |
| ck_assert_str_eq (json->f->getTopType(json), "double") | |
| json f | parse (json, "10") |
| ck_assert_str_eq (json->f->getTopType(json), "int") | |
| json f | parse (json, "\ef\) |
| ck_assert_str_eq (json->f->getTopType(json), "string") | |
| createAllocateSmallJson (jsOfromF) | |
| jsOfromF f | parse (jsOfromF, jsonText) |
| ck_assert_str_eq (s, "{\asd\\sd\\sd\234,\ict\{\rray\[1,1],\sd\true,\loat\3.434000e+01},\ool\false,\zz\null}") | |
| free (jsonText) | |
| listFreeS (file) | |
| terminateO (jsOfromF) | |
| ck_assert_str_eq (s, "[\sd\234,{\rray\[1,1],\sd\true,\loat\3.434000e+01}]") | |
| json f | parse (json, "{\ef\ {") |
| json f | parse (json, "[\ef") |
| json f | parse (json, "\ef") |
| jsOfromF f | parseYML (jsOfromF, jsonText) |
| ck_assert_str_eq (s, "{\ict\{\rray\[1,1],\loat\3.434000e+01,\sd\true},\asd\\sd\\sd\234,\ool\false,\zz\null}") | |
| ck_assert_str_eq (s, "[{\ict\\ello\\rray\[1,1],\loat\3.434000e+01,\sd\true},\sd\234]") | |
| ck_assert_str_eq (s, "[0x01]") | |
| o f | deserial (o, B) |
| terminateO (B) | |
| finishO (oBool) | |
| ck_assert_str_eq (s, "[0x02,0x01]") | |
| ck_assert_str_eq (s, "true") | |
| finishO (od) | |
| ck_assert_str_eq (s, "[0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x40]") | |
| ck_assert_str_eq (s, "1.000000e+01") | |
| ck_assert_str_eq (s, "[0x07,0x55,0x00,0x00,0x00,0x00,0x00,0x00,0x00]") | |
| ck_assert_str_eq (s, "85") | |
| ck_assert_str_eq (s, "[0x08,0x73,0x68,0x65,0x65,0x70,0x79,0x00]") | |
| finishO (sDD) | |
| ck_assert_str_eq (s, "[0x04,0x00,0x00,0x00,0x00]") | |
| finishO (sAA) | |
| ck_assert_str_eq (s, "[0x0a,0x00,0x00,0x00,0x00]") | |
| sFree ((smallt *) c) | |
| ck_assert_uint_eq (o->topIsA, 0) | |
| o f | deserial (o, NULL) |
| END_TEST | createSmallArray (obj) |
| ck_assert_str_eq (obj.type, "smallArray") | |
| createAllocateSmallArray (obj2) | |
| ck_assert_str_eq (obj2->type, "smallArray") | |
| ck_assert_str_eq (s, "[null,123,\heepy\") | |
| o2 f | delElem (o2, 0) |
| ck_assert_str_eq (s, "[123,\heepy\") | |
| terminateO (o2) | |
| ck_assert (isOType(u, "undefined")) | |
| ck_assert (r) | |
| o f | fromArray (o,(void *) array, 3) |
| ck_assert_uint_eq (o->f->len(o), 3) | |
| ck_assert_str_eq (strFrom->f->get(strFrom), "1") | |
| smashO (strFrom) | |
| ck_assert_str_eq (strFrom->f->get(strFrom), "22") | |
| ck_assert_str_eq (strFrom->f->get(strFrom), "333") | |
| ck_assert_ptr_eq (strFrom, NULL) | |
| o f | fromArray (o, shpList, 0) |
| ck_assert_uint_eq (o->f->len(o), 2) | |
| listFreeS (shpList) | |
| o f | fromArray (o, NULL, 3) |
| in f | set (in, 654) |
| ck_assert_uint_eq (o->f->len(o), 4) | |
| ck_assert_uint_eq (in->value->value, 654) | |
| o f | push (o, NULL) |
| ck_assert_str_eq (st->f->get(st), "sheepy") | |
| terminateO (st) | |
| ck_assert_uint_eq (in->value->value, 123) | |
| terminateO (in) | |
| ck_assert_ptr_eq (u, NULL) | |
| o f | free (o) |
| o2 f | setAt (o2, 1,(baset *) in) |
| o f | append (o, o2) |
| ck_assert_str_eq (s, "[null,123,\heepy\null,789,\heepy\") | |
| o f | append (o, o) |
| ck_assert_str_eq (s, "[null,789,\heepy\") | |
| o2 f | dispose (o2) |
| in f | set (in, 5345) |
| o f | slice (o, 1,-1) |
| o f | slice (o, 20,-1) |
| o f | slice (o,-20, 1) |
| ck_assert_str_eq (s, "[null]") | |
| o f | slice (o, 2, 40) |
| ck_assert_str_eq (s, "[\heepy\5345]") | |
| o f | slice (o, 2,-40) |
| o f | slice (o, 3, 2) |
| o f | slice (o,-1, 0) |
| ck_assert_str_eq (s, "[5345]") | |
| o f | slice (o, 1, 1) |
| o f | slice (o, 0, 0) |
| o f | insert (o, 0, o2) |
| ck_assert_str_eq (s, "[null,789,\heepy\null,123,\heepy\") | |
| o f | insert (o, -1, o2) |
| o f | insert (o, 3, o2) |
| o f | insert (o, 4, o2) |
| o f | delElem (o, 1) |
| o f | delElem (o, 2) |
| o f | trim (o) |
| ck_assert_str_eq (s, "[null,null,789,\heepy\") | |
| o f | insert (o, 0, NULL) |
| o f | del (o, 1,-1) |
| ck_assert_str_eq (s, "[null,5345]") | |
| o f | del (o, 20,-1) |
| ck_assert_str_eq (s, "[null,123,\heepy\5345]") | |
| o f | del (o,-20, 1) |
| ck_assert_str_eq (s, "[123,\heepy\5345]") | |
| o f | del (o, 2, 40) |
| ck_assert_str_eq (s, "[null,123]") | |
| o f | del (o, 2,-40) |
| o f | del (o, 3, 2) |
| o f | del (o,-1, 0) |
| o f | del (o, 1, 1) |
| o f | del (o, 0, 0) |
| o f | delElem (o, 0) |
| ck_assert_str_eq (s, "[123]") | |
| ck_assert_str_eq (u->type, "undefined") | |
| ck_assert_str_eq (st->type, "smallString") | |
| o f | setAt (o, 0,(baset *) in) |
| ck_assert_str_eq (s, "[0,123,\heepy\") | |
| o f | setAt (o, -1,(baset *) in) |
| ck_assert_str_eq (s, "[0,123,0]") | |
| o f | setAt (o, 4,(baset *) in) |
| ck_assert (o->f->isEmpty(o)) | |
| ck_assert (!o->f->isEmpty(o)) | |
| ck_assert_str_eq (s, "undefined") | |
| ck_assert_uint_eq (c, INT) | |
| ck_assert (!o->f->type(o, 10)) | |
| ck_assert (!o->f->type(o, -14)) | |
| ck_assert_uint_eq (c, UNDEFINED) | |
| ck_assert (!o2->f->type(o2, 0)) | |
| ck_assert_str_eq (s, "undefined,int,string") | |
| free (l) | |
| ck_assert_ptr_eq (o2->f->typeStrings(o2), NULL) | |
| ck_assert_str_eq (s, "[0x01,0x07,0x08]") | |
| initiateAllocateSmallArray (NULL) | |
| END_TEST | createUndefined (obj) |
| ck_assert_str_eq (obj.type, "undefined") | |
| createAllocateUndefined (obj2) | |
| ck_assert_str_eq (obj2->type, "undefined") | |
| END_TEST | createSmallBytes (obj) |
| ck_assert_str_eq (obj.type, "smallBytes") | |
| createAllocateSmallBytes (obj2) | |
| ck_assert_str_eq (obj2->type, "smallBytes") | |
| terminateO (obj3) | |
| ck_assert_uint_eq (obj3->B->data, 2) | |
| obj3 f | push (obj3, 4) |
| ck_assert_uint_eq (r[1], 4) | |
| ck_assert_uint_eq (c, 2) | |
| ck_assert_uint_eq (c, 0) | |
| END_TEST | createAllocateSmallArray (l) |
| putsO (l) | |
| putsO (NULL) | |
| terminateO (l) | |
| execO ("ls libsheepyObjectTest.c", l, NULL) | |
| ck_assert_uint_eq (l->f->len(l), 1) | |
| ck_assert_str_eq (l->f->getAtS(l, 0), "libsheepyObjectTest.c") | |
| freeO (l) | |
| execO ("randomComand", l, NULL) | |
| ck_assert_uint_eq (l->f->len(l), 0) | |
| ck_assert_int_eq (execO(NULL, NULL, NULL), 0) | |
| ck_assert_uint_eq (l->f->len(l), 3) | |
| ck_assert_str_eq (l->f->getAtS(l, 0), "../dirTest.null/one") | |
| ck_assert_str_eq (l->f->getAtS(l, 1), "../dirTest.null/two/four") | |
| ck_assert_str_eq (l->f->getAtS(l, 2), "../dirTest.null/two/three") | |
| ck_assert_ptr_eq (walkDirO(""), NULL) | |
| ck_assert (l->f->isEmpty(l)) | |
| ck_assert_ptr_eq (walkDirO(NULL), NULL) | |
| END_TEST | createAllocateSmallString (v) |
| v f | set (v, "sheepy") |
| expandHomeO (v) | |
| ck_assert (v->f->equalS(v, "sheepy")) | |
| terminateO (v) | |
| expandHomeO (NULL) | |
| v f | set (v, "../dirTest.null") |
| ck_assert (chDirO(v)) | |
| chDirO (c) | |
| terminateO (c) | |
| createAllocateSmallString (n) | |
| n f | set (n, "RandomNonExistingDir") |
| ck_assert (!chDirO(n)) | |
| ck_assert (!chDirO(NULL)) | |
| terminateO (n) | |
| END_TEST | createAllocateSmallArray (sA) |
| sA f | fromArrayNFree (sA, l, 0) |
| ck_assert (fileExistsO(S)) | |
| finishO (S) | |
| ck_assert (!fileExistsO(S)) | |
| terminateO (sA) | |
| v f | set (v, "../chmodTest.null") |
| ck_assert (fileChmodO(v, S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)) | |
| ck_assert (fileChmodO(v, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)) | |
| n f | set (n, "qweqwe_null") |
| ck_assert (!fileChmodO(n, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)) | |
| createAllocateSmallString (e) | |
| e f | set (e, "") |
| ck_assert (!fileChmodO(e, 0)) | |
| ck_assert (!fileChmodO(NULL, 0)) | |
| terminateO (e) | |
| END_TEST | createAllocateSmallString (s) |
| s f | set (s, "../sizeTest.null") |
| ck_assert_uint_eq (fileSizeO(s), 743) | |
| ck_assert_uint_eq (fileSizeO(v), 0) | |
| ck_assert_int_eq (fileSizeO(n), -1) | |
| ck_assert_int_eq (fileSizeO(e), -1) | |
| ck_assert_int_eq (fileSizeO(NULL), -1) | |
| terminateO (s) | |
| END_TEST | pError0 (rmAll("mkdirTest.null/null")) |
| s f | set (s, "mkdirTest.null/null") |
| ck_assert_int_eq (mkdirParentsO(s), 1) | |
| v f | set (v, "/usr/null") |
| ck_assert_int_eq (mkdirParentsO(v), 0) | |
| ck_assert_int_eq (mkdirParentsO(e), 0) | |
| ck_assert_int_eq (mkdirParentsO(NULL), 0) | |
| s f | set (s, "rmAllTest.null/null") |
| pError0 (mkdirParents("rmAllTest.null/null")) | |
| ck_assert_int_eq (rmAllO(s), 1) | |
| ck_assert_int_eq (rmAllO(e), 0) | |
| v f | set (v,"/var/lock") |
| ck_assert_int_eq (rmAllO(v), 0) | |
| ck_assert_int_eq (rmAllO(NULL), 0) | |
| createAllocateSmallString (d) | |
| s f | set (s, "../chmodTest.null") |
| d f | set (d, "../copyTest.null") |
| ck_assert_int_eq (copyO(s, d), 1) | |
| pError0 (fileChmod("../copyTest.null", 1)) | |
| ck_assert_int_eq (copyO(d, d), 0) | |
| pError0 (fileChmod("../copyTest.null", 777)) | |
| pError0 (rmAll("../copyTest.null")) | |
| ck_assert_int_eq (copyO(e, d), 0) | |
| ck_assert (!fileExists("copyTest.null")) | |
| ck_assert_int_eq (copyO(s, e), 0) | |
| ck_assert_int_eq (copyO(NULL, d), 0) | |
| ck_assert_int_eq (copyO(s, NULL), 0) | |
| ck_assert_int_eq (copyO(NULL, NULL), 0) | |
| terminateO (d) | |
| ck_assert_ptr_ne (s, NULL) | |
| ck_assert_ptr_eq (randomSO(0), NULL) | |
| randomUrandomClose () | |
| close /dev/urandom in libsheepy call this function when random are not needed anymore More... | |
| ck_assert_ptr_eq (randomAlphaNumSO(0), NULL) | |
| fclose (fp) | |
| ck_assert_str_eq (s->f->get(s), "LINE 1") | |
| ck_assert_str_eq (ssGet(s), "") | |
| ck_assert_ptr_eq (readLineO(NULL), NULL) | |
| createAllocateUndefined (u) | |
| finishO (u) | |
| ck_assert (isSType(su, UNDEFINED)) | |
| createAllocateSmallArray (a) | |
| s f | set (s, "sheepy") |
| a f | push (a,(baset *) s) |
| finishO (s) | |
| i f | set (i, 20) |
| finishO (i) | |
| finishO (a) | |
| ck_assert_uint_eq (sa->count, 2) | |
| ck_assert_str_eq (S, "[\heepy\20]") | |
| free (S) | |
| createAllocateSmallDict (d) | |
| d f | set (d, "s",(baset *) s) |
| d f | set (d, "i",(baset *) i) |
| finishO (d) | |
| ck_assert_uint_eq (sd->count, 2) | |
| ck_assert_str_eq (S, "{\\\heepy\\\20}") | |
| createAllocateSmallJson (j) | |
| ck_assert_ptr_ne (so, NULL) | |
| ck_assert_int_eq (so->type, CONTAINER) | |
| ck_assert_ptr_eq (((sContainert *) so) ->data, j) | |
| sFree (so) | |
| ck_assert_ptr_eq (toSmallt(NULL), NULL) | |
| ck_assert (b->value->value) | |
| terminateO (b) | |
| ck_assert_str_eq (c->data->data, "sheepy") | |
| free (c->data->data) | |
| ck_assert_uint_eq ((uint) D->value->value, 10) | |
| terminateO (D) | |
| ck_assert_uint_eq (i->value->value, 10) | |
| terminateO (i) | |
| ck_assert_str_eq (r, "sheepy") | |
| sArrayPushTiny & | sa (smallt *) ss |
| ck_assert_uint_eq (a->a->count, 2) | |
| terminateO (a) | |
| sDictPushTiny & | sd (smallt *) ss |
| ck_assert_uint_eq (d->d->count, 2) | |
| ck_assert_ptr_eq (toBaset(NULL), NULL) | |
| END_TEST Suite * | libsheepySuite (void) |
| int | main (int ARGC UNUSED, char **ARGV UNUSED) |
| #define UNUSED |
Definition at line 13 of file libsheepyObjectTest.c.
| createSmallDict | ( | obj | ) |
| ck_assert_str_eq | ( | obj. | type, |
| "smallDict" | |||
| ) |
| createAllocateSmallDict | ( | obj2 | ) |
| ck_assert_str_eq | ( | obj2-> | type, |
| "smallDict" | |||
| ) |
| ck_assert_str_eq | ( | s | , |
| "{}" | |||
| ) |
| free | ( | s | ) |

| createAllocateSmallBool | ( | oBool2 | ) |
| finishO | ( | oBool2 | ) |
| ck_assert_ptr_ne | ( | oBool3 | , |
| NULL | |||
| ) |
| finishO | ( | oBool3 | ) |
| terminateO | ( | o | ) |
| createAllocateUndefined | ( | oU | ) |
| finishO | ( | oU | ) |
| createAllocateSmallString | ( | oStr | ) |
| finishO | ( | oStr | ) |
| ck_assert_str_eq | ( | s | ) |
| sFree | ( | data | ) |
| ck_assert_uint_eq | ( | o->f-> | leno, |
| 0 | |||
| ) |
| terminateO | ( | u | ) |
| smashO | ( | st | ) |
| smashO | ( | oBool2 | ) |
| ck_assert_ptr_eq | ( | o | , |
| NULL | |||
| ) |
| ck_assert_uint_eq | ( | obj2->f-> | lenobj2, |
| 3 | |||
| ) |
| ck_assert_ptr_eq | ( | oBool3 | , |
| NULL | |||
| ) |
| ck_assert_ptr_eq | ( | obj2->f-> | getobj2, NULL, |
| NULL | |||
| ) |
| ck_assert | ( | !obj2->f-> | hasobj2, "qwe" | ) |
| ck_assert | ( | !obj2->f-> | hasobj2, NULL | ) |
| ck_assert | ( | obj2->f-> | hasobj2, "u" | ) |
| ck_assert_uint_eq | ( | len | , |
| 2 | |||
| ) |
| ck_assert_str_eq | ( | keys | [0], |
| "u" | |||
| ) |
| ck_assert_str_eq | ( | keys | [1], |
| "str" | |||
| ) |
| listFreeS | ( | keys | ) |
| ck_assert_ptr_eq | ( | keys | , |
| NULL | |||
| ) |
| ck_assert_str_eq | ( | s | , |
| "[ | null, | ||
| \heepy\" | |||
| ) |
| ck_assert_ptr_eq | ( | values | , |
| NULL | |||
| ) |
| finishO | ( | st | ) |
| ck_assert_str_eq | ( | s | ) |
| ck_assert_str_eq | ( | s | ) |
| ck_assert_str_eq | ( | s | , |
| "{\ull,\\eepy\\ll}" | |||
| ) |
| ck_assert_uint_eq | ( | obj2->f-> | lenobj2, |
| 2 | |||
| ) |
| ck_assert_str_eq | ( | s | , |
| "bool" | |||
| ) |
| ck_assert_ptr_eq | ( | o->f-> | typeStringo, "B", |
| NULL | |||
| ) |
| ck_assert_ptr_eq | ( | oM->f-> | typeStringoM, "B", |
| NULL | |||
| ) |
| ck_assert | ( | !o->f-> | typeo, "B" | ) |
| ck_assert | ( | !oM->f-> | typeoM, "B" | ) |
| ck_assert_str_eq | ( | s | ) |
| terminateO | ( | oT | ) |
| ck_assert_ptr_eq | ( | oT | , |
| NULL | |||
| ) |
| terminateO | ( | oM | ) |
| ck_assert_ptr_eq | ( | obj2 | , |
| NULL | |||
| ) |
| END_TEST createSmallJson | ( | obj | ) |
| ck_assert_str_eq | ( | obj. | type, |
| "smallJson" | |||
| ) |
| createAllocateSmallJson | ( | obj2 | ) |
| ck_assert_str_eq | ( | obj2-> | type, |
| "smallJson" | |||
| ) |
| createAllocateSmallInt | ( | oInt | ) |
| finishO | ( | oInt | ) |
| ck_assert_str_eq | ( | s | , |
| "{\\3,\2\3}" | |||
| ) |
| terminateO | ( | obj2 | ) |
| createAllocateSmallInt | ( | oInt2 | ) |
| finishO | ( | oInt2 | ) |
| ck_assert_str_eq | ( | s | , |
| "" | [123, 123] | ||
| ) |
| createAllocateSmallInt | ( | oInt3 | ) |
| oInt3 f set | ( | oInt3 | , |
| 123 | |||
| ) |
| finishO | ( | oInt3 | ) |
| ck_assert_str_eq | ( | s | , |
| "{\\3}" | |||
| ) |
| ck_assert_uint_eq | ( | o->topA-> | count, |
| 1 | |||
| ) |
| ck_assert_ptr_eq | ( | o-> | topA, |
| NULL | |||
| ) |
| sFree | ( | i | ) |
| ck_assert_uint_eq | ( | o->top-> | count, |
| 1 | |||
| ) |
| ck_assert_str_eq | ( | o->f-> | getTopTypeo, |
| "undefined" | |||
| ) |
| ck_assert_str_eq | ( | o->f-> | getTopTypeo, |
| "bool" | |||
| ) |
| ck_assert_str_eq | ( | o->f-> | getTopTypeo, |
| "double" | |||
| ) |
| ck_assert_str_eq | ( | o->f-> | getTopTypeo, |
| "int" | |||
| ) |
| ck_assert_str_eq | ( | o->f-> | getTopTypeo, |
| "string" | |||
| ) |
| ck_assert_str_eq | ( | o->f-> | getTopTypeo, |
| "dict" | |||
| ) |
| ck_assert_str_eq | ( | o->f-> | getTopTypeo, |
| "array" | |||
| ) |
| ck_assert_ptr_eq | ( | o->f-> | getTopTypeo, |
| NULL | |||
| ) |
| createAllocateSmallContainer | ( | jcontainer | ) |

| terminateO | ( | jcontainer | ) |
| ck_assert_ptr_eq | ( | b | , |
| NULL | |||
| ) |
| createAllocateUndefined | ( | jUndef | ) |
| finishO | ( | jUndef | ) |
| ck_assert_str_eq | ( | b-> | type, |
| "undefined" | |||
| ) |
| finishO | ( | b | ) |
| ck_assert_str_eq | ( | s | , |
| "null" | |||
| ) |
| ck_assert_str_eq | ( | s | , |
| "---\ull" | |||
| ) |
| freeO | ( | o | ) |
| createAllocateSmallBool | ( | jBool | ) |
| finishO | ( | jBool | ) |
| ck_assert_str_eq | ( | b-> | type, |
| "smallBool" | |||
| ) |
| ck_assert_str_eq | ( | s | , |
| "false" | |||
| ) |
| ck_assert_str_eq | ( | s | , |
| "---\alse" | |||
| ) |
| createAllocateSmallDouble | ( | jDouble | ) |

| finishO | ( | jDouble | ) |
| ck_assert_str_eq | ( | b-> | type, |
| "smallDouble" | |||
| ) |
| ck_assert_str_eq | ( | s | , |
| "0.000000e+00" | |||
| ) |
| ck_assert_str_eq | ( | s | , |
| "---\.000000e+00" | |||
| ) |
| createAllocateSmallInt | ( | jInt | ) |
| finishO | ( | jInt | ) |
| ck_assert_str_eq | ( | b-> | type, |
| "smallInt" | |||
| ) |
| ck_assert_str_eq | ( | s | , |
| "0" | |||
| ) |
| ck_assert_str_eq | ( | s | , |
| "---\" | |||
| ) |
| createAllocateSmallString | ( | jString | ) |
| finishO | ( | jString | ) |
| ck_assert_str_eq | ( | b-> | type, |
| "smallString" | |||
| ) |
| ck_assert_str_eq | ( | s | , |
| "sheepy" | |||
| ) |
| ck_assert_str_eq | ( | s | , |
| "\epy\ | |||
| ) |
| ck_assert_str_eq | ( | s | , |
| "---\eepy\ | |||
| ) |
| createAllocateSmallDict | ( | jdict | ) |
| finishO | ( | jdict | ) |
| ck_assert_str_eq | ( | b-> | type, |
| "smallDict" | |||
| ) |
| ck_assert_str_eq | ( | s | , |
| "{}\ | |||
| ) |
| ck_assert_str_eq | ( | s | , |
| "---\}\ | |||
| ) |
| createAllocateSmallArray | ( | jArray | ) |
| finishO | ( | jArray | ) |
| ck_assert_str_eq | ( | b-> | type, |
| "smallArray" | |||
| ) |
| ck_assert_str_eq | ( | s | , |
| "" | [] | ||
| ) |
| ck_assert_str_eq | ( | s | , |
| "\ | [] | ||
| ) |
| ck_assert_str_eq | ( | s | , |
| "---\ | [] | ||
| ) |
| createAllocateSmallDict | ( | oD2 | ) |
| oD2 f set | ( | oD2 | , |
| "int" | , | ||
| (baset *) | in2 | ||
| ) |
| finishO | ( | in2 | ) |
| oD2 f set | ( | oD2 | , |
| "int2" | , | ||
| (baset *) | in2 | ||
| ) |
| finishO | ( | oD2 | ) |
| createAllocateSmallArray | ( | oTA2 | ) |
| oTA2 f push | ( | oTA2 | , |
| (baset *) | in2 | ||
| ) |
| smashO | ( | in | ) |
| finishO | ( | oTA2 | ) |
| ck_assert_ptr_eq | ( | in | , |
| NULL | |||
| ) |
| createAllocateSmallJson | ( | json | ) |
| createAllocateSmallInt | ( | oInt4 | ) |
| finishO | ( | oInt4 | ) |
| createSmallJson | ( | jpath | ) |
| createSmallBool | ( | ba | ) |
| jpath f set& jpath | ( | & | ba | ) |
| createSmallBool | ( | bb | ) |
| ck_assert_str_eq | ( | jArray-> | type, |
| "smallArray" | |||
| ) |
| finishG | ( | jArray | ) |
| finishG | ( | in | ) |
| createSmallBool | ( | be | ) |
| finishG | ( | jBool | ) |
| createSmallBool | ( | b2 | ) |
| ck_assert_ptr_ne | ( | o2 | , |
| NULL | |||
| ) |
| createSmallBool | ( | b3 | ) |
| ck_assert_str_eq | ( | ks | , |
| "\\ | |||
| ) |
| createSmallBool | ( | b4 | ) |
| pErrorNULL | ( | iPrependS &, "[1]" | ks | ) |

| free | ( | ks | ) |
| finishG | ( | b | ) |
| createSmallBool | ( | b0 | ) |
| ck_assert_ptr_eq | ( | o2 | , |
| NULL | |||
| ) |
| ck_assert_uint_eq | ( | o->f-> | leno, |
| 1 | |||
| ) |
| finishO | ( | in | ) |
| finishO | ( | jcontainer | ) |
| ck_assert_str_eq | ( | s | , |
| " | [\ 345,\ \heepy\\ {},\ [], | ||
| \ {\ \tring\ \heepy\\ \ontainer\ \data container >\ } | , | ||
| \ \\ | [\ \heepy\\ \data container >\] | ||
| ) |
| createAllocateSmallJson | ( | json2 | ) |
| json2 f set | ( | json2 | , |
| "s" | , | ||
| (baset *) | jString | ||
| ) |
| json2 f set | ( | json2 | , |
| "d" | , | ||
| (baset *) | jdict | ||
| ) |
| json2 f set | ( | json2 | , |
| "a" | , | ||
| (baset *) | jArray | ||
| ) |
| json2 f set | ( | json2 | , |
| "d2" | , | ||
| (baset *) | jdict | ||
| ) |
| json2 f set | ( | json2 | , |
| "a2" | , | ||
| (baset *) | jArray | ||
| ) |
| json2 f set | ( | json2 | , |
| "int" | , | ||
| (baset *) | oInt4 | ||
| ) |
| ck_assert_str_eq | ( | s | ) |
| ck_assert_str_eq | ( | s | , |
| "---\ 345\ sheepy\ {}\ \ []string: sheepy\ontainer: \ta | container, | ||
| \ - - sheepy\ - \data | container, | ||
| \" | |||
| ) |
| createAllocateSmallJson | ( | json3 | ) |
| terminateO | ( | json3 | ) |
| ck_assert_str_eq | ( | s | , |
| "---\: sheepy\:\}\:\ []d2:\tring: sheepy\ontainer: \ta | container, | ||
| \ a2:\ - sheepy\ - \data | container, | ||
| \ int:345\ | |||
| ) |
| terminateO | ( | json2 | ) |
| terminateO | ( | json | ) |
| ck_assert_str_eq | ( | json->f-> | getTopTypejson, |
| "undefined" | |||
| ) |
| ck_assert_str_eq | ( | json->f-> | getTopTypejson, |
| "bool" | |||
| ) |
| ck_assert_str_eq | ( | json->f-> | getTopTypejson, |
| "double" | |||
| ) |
| ck_assert_str_eq | ( | json->f-> | getTopTypejson, |
| "int" | |||
| ) |
| ck_assert_str_eq | ( | json->f-> | getTopTypejson, |
| "string" | |||
| ) |
| createAllocateSmallJson | ( | jsOfromF | ) |
| ck_assert_str_eq | ( | s | , |
| "{\d\d\d\4,\t\ray\,1],\\ue,\at\434000e+01},\l\lse,\\ll}" | |||
| ) |
| free | ( | jsonText | ) |
| listFreeS | ( | file | ) |
| terminateO | ( | jsOfromF | ) |
| ck_assert_str_eq | ( | s | , |
| " | [\sd\234,{\rray\[1, 1], | ||
| \sd\ | true, | ||
| \loat\3.434000e+01}]" | |||
| ) |
| ck_assert_str_eq | ( | s | , |
| "{\t\ray\,1],\at\434000e+01,\\ue},\d\d\d\4,\l\lse,\\ll}" | |||
| ) |
| ck_assert_str_eq | ( | s | , |
| " | [{\ict\\ello\\rray\[1, 1], | ||
| \loat\3.434000e+ | 01, | ||
| \sd\true} | , | ||
| \sd\234]" | |||
| ) |
| ck_assert_str_eq | ( | s | , |
| "" | [0x01] | ||
| ) |
| terminateO | ( | B | ) |
| finishO | ( | oBool | ) |
| ck_assert_str_eq | ( | s | , |
| "" | [0x02, 0x01] | ||
| ) |
| ck_assert_str_eq | ( | s | , |
| "true" | |||
| ) |
| finishO | ( | od | ) |
| ck_assert_str_eq | ( | s | , |
| "" | [0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40] | ||
| ) |
| ck_assert_str_eq | ( | s | , |
| "1.000000e+01" | |||
| ) |
| ck_assert_str_eq | ( | s | , |
| "" | [0x07, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] | ||
| ) |
| ck_assert_str_eq | ( | s | , |
| "85" | |||
| ) |
| ck_assert_str_eq | ( | s | , |
| "" | [0x08, 0x73, 0x68, 0x65, 0x65, 0x70, 0x79, 0x00] | ||
| ) |
| finishO | ( | sDD | ) |
| ck_assert_str_eq | ( | s | , |
| "" | [0x04, 0x00, 0x00, 0x00, 0x00] | ||
| ) |
| finishO | ( | sAA | ) |
| ck_assert_str_eq | ( | s | , |
| "" | [0x0a, 0x00, 0x00, 0x00, 0x00] | ||
| ) |
| sFree | ( | (smallt *) | c | ) |
| ck_assert_uint_eq | ( | o-> | topIsA, |
| 0 | |||
| ) |
| END_TEST createSmallArray | ( | obj | ) |

| ck_assert_str_eq | ( | obj. | type, |
| "smallArray" | |||
| ) |
| createAllocateSmallArray | ( | obj2 | ) |
| ck_assert_str_eq | ( | obj2-> | type, |
| "smallArray" | |||
| ) |
| ck_assert_str_eq | ( | s | , |
| "[ | null, | ||
| 123 | , | ||
| \heepy\" | |||
| ) |
| ck_assert_str_eq | ( | s | , |
| "[ | 123, | ||
| \heepy\" | |||
| ) |
| terminateO | ( | o2 | ) |
| ck_assert | ( | r | ) |
| ck_assert_uint_eq | ( | o->f-> | leno, |
| 3 | |||
| ) |
| ck_assert_str_eq | ( | strFrom->f-> | getstrFrom, |
| "1" | |||
| ) |
| smashO | ( | strFrom | ) |
| ck_assert_str_eq | ( | strFrom->f-> | getstrFrom, |
| "22" | |||
| ) |
| ck_assert_str_eq | ( | strFrom->f-> | getstrFrom, |
| "333" | |||
| ) |
| ck_assert_ptr_eq | ( | strFrom | , |
| NULL | |||
| ) |
| ck_assert_uint_eq | ( | o->f-> | leno, |
| 2 | |||
| ) |
| listFreeS | ( | shpList | ) |
| ck_assert_uint_eq | ( | o->f-> | leno, |
| 4 | |||
| ) |
| ck_assert_str_eq | ( | st->f-> | getst, |
| "sheepy" | |||
| ) |
| terminateO | ( | st | ) |
| terminateO | ( | in | ) |
| ck_assert_ptr_eq | ( | u | , |
| NULL | |||
| ) |
| ck_assert_str_eq | ( | s | , |
| "[ | null, | ||
| 123 | , | ||
| \heepy\ | null, | ||
| 789 | , | ||
| \heepy\" | |||
| ) |
| ck_assert_str_eq | ( | s | , |
| "[ | null, | ||
| 789 | , | ||
| \heepy\" | |||
| ) |
| ck_assert_str_eq | ( | s | , |
| "" | [null] | ||
| ) |
| ck_assert_str_eq | ( | s | , |
| "" | [\heepy\5345] | ||
| ) |
| ck_assert_str_eq | ( | s | , |
| "" | [5345] | ||
| ) |
| ck_assert_str_eq | ( | s | , |
| "[ | null, | ||
| 789 | , | ||
| \heepy\ | null, | ||
| 123 | , | ||
| \heepy\" | |||
| ) |
| ck_assert_str_eq | ( | s | , |
| "" | [null, 5345] | ||
| ) |
| ck_assert_str_eq | ( | s | , |
| "" | [null, 123,\heepy\5345] | ||
| ) |
| ck_assert_str_eq | ( | s | , |
| "" | [123,\heepy\5345] | ||
| ) |
| ck_assert_str_eq | ( | s | , |
| "" | [null, 123] | ||
| ) |
| ck_assert_str_eq | ( | s | , |
| "" | [123] | ||
| ) |
| ck_assert_str_eq | ( | u-> | type, |
| "undefined" | |||
| ) |
| ck_assert_str_eq | ( | st-> | type, |
| "smallString" | |||
| ) |
| ck_assert_str_eq | ( | s | , |
| "[ | 0, | ||
| 123 | , | ||
| \heepy\" | |||
| ) |
| ck_assert_str_eq | ( | s | , |
| "" | [0, 123, 0] | ||
| ) |
| ck_assert | ( | o->f-> | isEmptyo | ) |
| ck_assert | ( | !o->f-> | isEmptyo | ) |
| ck_assert_str_eq | ( | s | , |
| "undefined" | |||
| ) |
| ck_assert | ( | !o->f-> | typeo, 10 | ) |
| ck_assert | ( | !o->f-> | typeo, -14 | ) |
| ck_assert | ( | !o2->f-> | typeo2, 0 | ) |
| ck_assert_str_eq | ( | s | , |
| " | undefined, | ||
| int | , | ||
| string" | |||
| ) |
| free | ( | l | ) |
| ck_assert_ptr_eq | ( | o2->f-> | typeStringso2, |
| NULL | |||
| ) |
| ck_assert_str_eq | ( | s | , |
| "" | [0x01, 0x07, 0x08] | ||
| ) |
| initiateAllocateSmallArray | ( | NULL | ) |
| END_TEST createUndefined | ( | obj | ) |
| ck_assert_str_eq | ( | obj. | type, |
| "undefined" | |||
| ) |
| createAllocateUndefined | ( | obj2 | ) |
| ck_assert_str_eq | ( | obj2-> | type, |
| "undefined" | |||
| ) |
| END_TEST createSmallBytes | ( | obj | ) |
| ck_assert_str_eq | ( | obj. | type, |
| "smallBytes" | |||
| ) |
| createAllocateSmallBytes | ( | obj2 | ) |

| ck_assert_str_eq | ( | obj2-> | type, |
| "smallBytes" | |||
| ) |
| terminateO | ( | obj3 | ) |
| ck_assert_uint_eq | ( | r | [1], |
| 4 | |||
| ) |
| ck_assert_uint_eq | ( | c | , |
| 2 | |||
| ) |
| ck_assert_uint_eq | ( | c | , |
| 0 | |||
| ) |
| END_TEST createAllocateSmallArray | ( | l | ) |
| putsO | ( | l | ) |
| putsO | ( | NULL | ) |
| terminateO | ( | l | ) |
| execO | ( | "ls libsheepyObjectTest.c" | , |
| l | , | ||
| NULL | |||
| ) |
| ck_assert_uint_eq | ( | l->f-> | lenl, |
| 1 | |||
| ) |
| ck_assert_str_eq | ( | l->f-> | getAtSl, 0, |
| "libsheepyObjectTest.c" | |||
| ) |
| freeO | ( | l | ) |
| execO | ( | "randomComand" | , |
| l | , | ||
| NULL | |||
| ) |
| ck_assert_uint_eq | ( | l->f-> | lenl, |
| 0 | |||
| ) |
| ck_assert_int_eq | ( | execO(NULL, NULL, NULL) | , |
| 0 | |||
| ) |
| ck_assert_uint_eq | ( | l->f-> | lenl, |
| 3 | |||
| ) |
| ck_assert_str_eq | ( | l->f-> | getAtSl, 0, |
| "../dirTest.null/one" | |||
| ) |
| ck_assert_str_eq | ( | l->f-> | getAtSl, 1, |
| "../dirTest.null/two/four" | |||
| ) |
| ck_assert_str_eq | ( | l->f-> | getAtSl, 2, |
| "../dirTest.null/two/three" | |||
| ) |
| ck_assert_ptr_eq | ( | walkDirO("") | , |
| NULL | |||
| ) |
| ck_assert | ( | l->f-> | isEmptyl | ) |
| ck_assert_ptr_eq | ( | walkDirO(NULL) | , |
| NULL | |||
| ) |
| createAllocateSmallString | ( | v | ) |
| v f set | ( | v | , |
| "sheepy" | |||
| ) |
| expandHomeO | ( | v | ) |
| ck_assert | ( | v->f-> | equalSv, "sheepy" | ) |
| terminateO | ( | v | ) |
| expandHomeO | ( | NULL | ) |
| v f set | ( | v | , |
| "../dirTest.null" | |||
| ) |
| ck_assert | ( | chDirO(v) | ) |
| chDirO | ( | c | ) |
| terminateO | ( | c | ) |
| createAllocateSmallString | ( | n | ) |
| n f set | ( | n | , |
| "RandomNonExistingDir" | |||
| ) |
| ck_assert | ( | ! | chDirOn | ) |
| ck_assert | ( | ! | chDirONULL | ) |
| terminateO | ( | n | ) |
| END_TEST createAllocateSmallArray | ( | sA | ) |
| sA f fromArrayNFree | ( | sA | , |
| l | , | ||
| 0 | |||
| ) |
| ck_assert | ( | fileExistsO(S) | ) |
| finishO | ( | S | ) |
| ck_assert | ( | ! | fileExistsOS | ) |
| terminateO | ( | sA | ) |
| v f set | ( | v | , |
| "../chmodTest.null" | |||
| ) |
| ck_assert | ( | fileChmodO(v, S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) | ) |
| ck_assert | ( | fileChmodO(v, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH) | ) |
| n f set | ( | n | , |
| "qweqwe_null" | |||
| ) |
| ck_assert | ( | ! | fileChmodOn, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH | ) |
| createAllocateSmallString | ( | e | ) |
| e f set | ( | e | , |
| "" | |||
| ) |
| ck_assert | ( | ! | fileChmodOe, 0 | ) |
| ck_assert | ( | ! | fileChmodONULL, 0 | ) |
| terminateO | ( | e | ) |
| END_TEST createAllocateSmallString | ( | s | ) |
| ck_assert_uint_eq | ( | fileSizeO(v) | , |
| 0 | |||
| ) |
| ck_assert_int_eq | ( | fileSizeO(n) | , |
| - | 1 | ||
| ) |
| ck_assert_int_eq | ( | fileSizeO(e) | , |
| - | 1 | ||
| ) |
| ck_assert_int_eq | ( | fileSizeO(NULL) | , |
| - | 1 | ||
| ) |
| terminateO | ( | s | ) |
| ck_assert_int_eq | ( | mkdirParentsO(s) | , |
| 1 | |||
| ) |
| v f set | ( | v | , |
| "/usr/null" | |||
| ) |
| ck_assert_int_eq | ( | mkdirParentsO(v) | , |
| 0 | |||
| ) |
| ck_assert_int_eq | ( | mkdirParentsO(e) | , |
| 0 | |||
| ) |
| ck_assert_int_eq | ( | mkdirParentsO(NULL) | , |
| 0 | |||
| ) |
| pError0 | ( | mkdirParents("rmAllTest.null/null") | ) |
| ck_assert_int_eq | ( | rmAllO(e) | , |
| 0 | |||
| ) |
| v f set | ( | v | , |
| "/var/lock" | |||
| ) |
| ck_assert_int_eq | ( | rmAllO(v) | , |
| 0 | |||
| ) |
| ck_assert_int_eq | ( | rmAllO(NULL) | , |
| 0 | |||
| ) |
| createAllocateSmallString | ( | d | ) |
| pError0 | ( | fileChmod("../copyTest.null", 1) | ) |
| pError0 | ( | fileChmod("../copyTest.null", 777) | ) |
| pError0 | ( | rmAll("../copyTest.null") | ) |
| ck_assert | ( | ! | fileExists"copyTest.null" | ) |
| ck_assert_int_eq | ( | copyO(NULL, NULL) | , |
| 0 | |||
| ) |
| terminateO | ( | d | ) |
| ck_assert_ptr_ne | ( | s | , |
| NULL | |||
| ) |
| ck_assert_ptr_eq | ( | randomSO(0) | , |
| NULL | |||
| ) |
| randomUrandomClose | ( | ) |
close /dev/urandom in libsheepy call this function when random are not needed anymore
Definition at line 5916 of file libsheepy.c.
| ck_assert_ptr_eq | ( | randomAlphaNumSO(0) | , |
| NULL | |||
| ) |
| fclose | ( | fp | ) |

| ck_assert_str_eq | ( | s->f-> | gets, |
| "LINE 1" | |||
| ) |
| ck_assert_ptr_eq | ( | readLineO(NULL) | , |
| NULL | |||
| ) |
| createAllocateUndefined | ( | u | ) |
| finishO | ( | u | ) |
| createAllocateSmallArray | ( | a | ) |
| finishO | ( | s | ) |
| finishO | ( | i | ) |
| finishO | ( | a | ) |
| ck_assert_uint_eq | ( | sa-> | count, |
| 2 | |||
| ) |
| ck_assert_str_eq | ( | S | , |
| "" | [\heepy\20] | ||
| ) |
| free | ( | S | ) |
| createAllocateSmallDict | ( | d | ) |
| finishO | ( | d | ) |
| ck_assert_uint_eq | ( | sd-> | count, |
| 2 | |||
| ) |
| ck_assert_str_eq | ( | S | , |
| "{\eepy\0}" | |||
| ) |
| createAllocateSmallJson | ( | j | ) |
| ck_assert_ptr_ne | ( | so | , |
| NULL | |||
| ) |
| ck_assert_ptr_eq | ( | ((sContainert *) so) -> | data, |
| j | |||
| ) |
| sFree | ( | so | ) |
| ck_assert_ptr_eq | ( | toSmallt(NULL) | , |
| NULL | |||
| ) |
| terminateO | ( | b | ) |
| terminateO | ( | D | ) |
| terminateO | ( | i | ) |
| ck_assert_str_eq | ( | r | , |
| "sheepy" | |||
| ) |
| sArrayPushTiny& sa | ( | smallt * | ) |
| terminateO | ( | a | ) |
| sDictPushTiny& sd | ( | smallt * | ) |
| ck_assert_ptr_eq | ( | toBaset(NULL) | , |
| NULL | |||
| ) |
| END_TEST Suite* libsheepySuite | ( | void | ) |
Definition at line 2343 of file libsheepyObjectTest.c.


| int main | ( | int ARGC | UNUSED, |
| char **ARGV | UNUSED | ||
| ) |
| smallStringt * s = obj2->f->toString(obj2) |
Definition at line 27 of file libsheepyObjectTest.c.
| undefinedt * o = obj2->f->duplicate(obj2) |
Definition at line 31 of file libsheepyObjectTest.c.
| oBool3 = (smallBoolt *)o->f->get(o, "lib") |
Definition at line 37 of file libsheepyObjectTest.c.
| undefinedt * u = (undefinedt *) o->f->get(o, "u") |
Definition at line 56 of file libsheepyObjectTest.c.
| smallStringt * st = (smallStringt *) o->f->get(o, "str") |
Definition at line 57 of file libsheepyObjectTest.c.
| oBool2 = (smallBoolt *) o->f->get(o, "lib") |
Definition at line 58 of file libsheepyObjectTest.c.
| data = sDictGetTiny(o->d, "u") |
Definition at line 59 of file libsheepyObjectTest.c.
Definition at line 107 of file libsheepyObjectTest.c.
| size_t len = listLengthS(keys) |
Definition at line 108 of file libsheepyObjectTest.c.
Definition at line 119 of file libsheepyObjectTest.c.
Definition at line 130 of file libsheepyObjectTest.c.
| undefinedt * oU = allocUndefined() |
Definition at line 172 of file libsheepyObjectTest.c.
| smallContainert * c = o->f->type(o, "str") |
Definition at line 246 of file libsheepyObjectTest.c.
Definition at line 254 of file libsheepyObjectTest.c.
| obj f free & obj |
Definition at line 265 of file libsheepyObjectTest.c.
| obj2 f terminate & obj2 |
Definition at line 268 of file libsheepyObjectTest.c.
| initiateAllocateSmallInt & oInt = allocSmallInt(85) |
Definition at line 290 of file libsheepyObjectTest.c.
| initiateAllocateSmallInt & oInt2 |
Definition at line 307 of file libsheepyObjectTest.c.
| smallIntt * i = sArrayGetTiny(o->topA, 0) |
Definition at line 344 of file libsheepyObjectTest.c.
| smallBoolt * b = o->f->getTop(o) |
Definition at line 402 of file libsheepyObjectTest.c.
| initiateAllocateSmallArray & o2 = duplicateO(o) |
Definition at line 403 of file libsheepyObjectTest.c.
| initiateAllocateSmallInt & in = (smallIntt *) obj2->f->get(obj2, "int") |
Definition at line 640 of file libsheepyObjectTest.c.
| in2 = duplicateO(in) |
Definition at line 643 of file libsheepyObjectTest.c.
| freeO & jpath |
Definition at line 690 of file libsheepyObjectTest.c.
| jBool = (smallBoolt*)jpath.f->get(&jpath,"b\\\\") |
Definition at line 698 of file libsheepyObjectTest.c.
| bb f set& bb |
Definition at line 703 of file libsheepyObjectTest.c.
| initiateAllocateSmallArray & jArray = (smallArrayt*)jpath.f->get(&jpath,"[2][0]") |
Definition at line 720 of file libsheepyObjectTest.c.
| char* ks = jpath.f->makeKey(&jpath, "\\\\\\\"\"") |
Definition at line 750 of file libsheepyObjectTest.c.
| o topS = allocSStringTiny("er") |
Definition at line 797 of file libsheepyObjectTest.c.
| initiateAllocateSmallString & jString |
Definition at line 815 of file libsheepyObjectTest.c.
| initiateAllocateSmallDict & jdict |
Definition at line 819 of file libsheepyObjectTest.c.
| initiateAllocateSmallContainer & jcontainer |
Definition at line 830 of file libsheepyObjectTest.c.
| initiateAllocateSmallInt& oInt4 |
Definition at line 885 of file libsheepyObjectTest.c.
| initiateAllocateSmallJson & json |
Definition at line 911 of file libsheepyObjectTest.c.
| file = readText("file.json") |
Definition at line 936 of file libsheepyObjectTest.c.
Definition at line 937 of file libsheepyObjectTest.c.
| initiateAllocateSmallJson & jsOfromF |
Definition at line 950 of file libsheepyObjectTest.c.
Definition at line 1026 of file libsheepyObjectTest.c.
| smallBoolt* oBool = allocSmallBool(true) |
Definition at line 1051 of file libsheepyObjectTest.c.
| smallDoublet* od = allocSmallDouble(10) |
Definition at line 1066 of file libsheepyObjectTest.c.
| smallDictt* sDD = allocSmallDict() |
Definition at line 1111 of file libsheepyObjectTest.c.
| smallArrayt* sAA = allocSmallArray() |
Definition at line 1126 of file libsheepyObjectTest.c.
| o topU = NULL |
Definition at line 1160 of file libsheepyObjectTest.c.
Definition at line 1259 of file libsheepyObjectTest.c.
| char* array[] = {"1", "22", "333"} |
Definition at line 1278 of file libsheepyObjectTest.c.
| char* arrayNULL[] = {"1", NULL, "333"} |
Definition at line 1279 of file libsheepyObjectTest.c.
| strFrom = (smallStringt*) o->f->getAt(o,0) |
Definition at line 1283 of file libsheepyObjectTest.c.
| char** shpList = listCreateS("lib", "sheepy") |
Definition at line 1305 of file libsheepyObjectTest.c.
| in value value = 789 |
Definition at line 1363 of file libsheepyObjectTest.c.
| oStr = allocSmallString("sheepy") |
Definition at line 1774 of file libsheepyObjectTest.c.
Definition at line 1796 of file libsheepyObjectTest.c.
| initiateAllocateSmallBytes & obj3 = allocSmallBytes(NULL, 0) |
Definition at line 1861 of file libsheepyObjectTest.c.
| char * S = sA->f->getAtSmallString(sA, 0) |
Definition at line 2009 of file libsheepyObjectTest.c.
| fp = fopen("../textTest.null", "r") |
Definition at line 2195 of file libsheepyObjectTest.c.
| sUndefinedt * su = (sUndefinedt *) toSmallt((baset *)u) |
Definition at line 2224 of file libsheepyObjectTest.c.
| sArrayPushTiny & sa = (sArrayt *) toSmallt((baset *)a) |
Definition at line 2238 of file libsheepyObjectTest.c.
| sDictPushTiny & sd = (sDictt *) toSmallt((baset *)d) |
Definition at line 2255 of file libsheepyObjectTest.c.
Definition at line 2264 of file libsheepyObjectTest.c.
| END_TEST sBoolt* sb = allocSBool(true) |
Definition at line 2278 of file libsheepyObjectTest.c.
| sContainert* sc = allocSContainer(strdup("sheepy")) |
Definition at line 2283 of file libsheepyObjectTest.c.
| sDoublet* sD = allocSDouble(10) |
Definition at line 2289 of file libsheepyObjectTest.c.
| smallDoublet* D = (smallDoublet *) toBaset((smallt *)sD) |
Definition at line 2290 of file libsheepyObjectTest.c.
| si = allocSInt(10) |
Definition at line 2294 of file libsheepyObjectTest.c.
| ss = allocSStringTiny("sheepy") |
Definition at line 2299 of file libsheepyObjectTest.c.
| smallArrayt* a = (smallArrayt *) toBaset((smallt *)sa) |
Definition at line 2316 of file libsheepyObjectTest.c.
| smallDictt* d = (smallDictt *) toBaset((smallt *)sd) |
Definition at line 2328 of file libsheepyObjectTest.c.
1.8.13