diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-05-31 23:45:53 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-05-31 23:45:53 +0200 |
commit | dc44a078148926c67c0d3e7cc8fff7d55a990417 (patch) | |
tree | f98c18403e518faeb0575fd00040cef1825e6ab1 /tests | |
parent | c7b2ae9a97612e3ee32ae0837a6da9d091c5487c (diff) | |
download | edoors-dc44a078148926c67c0d3e7cc8fff7d55a990417.zip edoors-dc44a078148926c67c0d3e7cc8fff7d55a990417.tar.gz |
add eiotas_particle_match tests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/particle.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/particle.c b/tests/particle.c index a6d2d17..d5aa000 100644 --- a/tests/particle.c +++ b/tests/particle.c @@ -77,6 +77,15 @@ void test_particle() eiotas_particle_data_del(p0,"key0"); if(eiotas_particle_data_get(p0,"key0")!=NULL) fprintf(stderr,"ERROR\n"); check_str((char*)p0->link_value,"val2val1","!!!!! link_value is wrong"); + + p1 = eiotas_require_particle(dom0); + check_cond(!eiotas_particle_match(p0,p1),"!!!!! link_value is not the same"); + eiotas_particle_link_fields_set(p1," k0,k1"); + eiotas_particle_data_set(p1,"k0","val2"); + eiotas_particle_data_set(p1,"k1","val1"); + check_str((char*)p1->link_value,"val2val1","!!!!! link_value is wrong"); + check_cond(eiotas_particle_match(p0,p1),"!!!!! link_value is the same"); + eiotas_particle_data_del(p0,"key2"); if(eiotas_particle_data_get(p0,"key2")!=NULL) fprintf(stderr,"ERROR\n"); check_str((char*)p0->link_value,"val1","!!!!! link_value is wrong"); @@ -84,7 +93,7 @@ void test_particle() if(eiotas_particle_data_get(p0,"key1")!=NULL) fprintf(stderr,"ERROR\n"); check_cond((p0->link_value==NULL),"!!!!! link_value should be NULL"); - p1 = eiotas_require_particle(dom0); + p2 = eiotas_require_particle(dom0); p3 = eiotas_require_particle(dom0); p4 = eiotas_require_particle(dom0); |