From dc44a078148926c67c0d3e7cc8fff7d55a990417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Thu, 31 May 2012 23:45:53 +0200 Subject: add eiotas_particle_match tests --- tests/particle.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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); -- cgit v1.1-2-g2b99