Changeset 3428
- Timestamp:
- 07/10/08 08:54:28 (2 months ago)
- Files:
-
- trunk/tests/merger-tests/check_xmlformat.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/tests/merger-tests/check_xmlformat.c
r3370 r3428 3 3 #include <opensync/opensync-xmlformat.h> 4 4 5 #include "opensync/xmlformat/opensync _xmlformat_internals.h"5 #include "opensync/xmlformat/opensync-xmlformat_internals.h" 6 6 7 7 START_TEST (xmlformat_new) … … 276 276 unsigned int size; 277 277 OSyncError *error = NULL; 278 OSyncXMLFormatSchema *schema = NULL; 278 279 279 280 fail_unless(osync_file_read("event.xml", &buffer, &size, &error), NULL); … … 284 285 285 286 g_free(buffer); 286 287 fail_unless(_osync_xmlformat_validate(xmlformat, testbed) != FALSE, NULL); 288 287 schema = osync_xmlformat_schema_new(xmlformat, testbed, &error); 288 fail_if( schema == NULL ); 289 fail_unless( osync_xmlformat_schema_validate(schema, xmlformat, &error) ); 290 291 osync_xmlformat_schema_unref(schema); 292 289 293 osync_xmlformat_unref(xmlformat); 290 294 … … 362 366 363 367 destroy_testbed(testbed); 368 } 369 END_TEST 370 371 START_TEST (xmlformat_schema_get_instance) 372 { 373 OSyncError *error = NULL; 374 OSyncXMLFormat *xmlformat = osync_xmlformat_new("contact", &error); 375 fail_unless(xmlformat != NULL, NULL); 376 fail_unless(error == NULL, NULL); 377 378 OSyncXMLFormatSchema *schema1 = osync_xmlformat_schema_get_instance(xmlformat, &error); 379 OSyncXMLFormatSchema *schema2 = osync_xmlformat_schema_get_instance(xmlformat, &error); 380 381 fail_unless( schema1 == schema2 ); 382 fail_unless( schema1->ref_count == 2 ); 383 384 osync_xmlformat_schema_unref(schema1); 385 osync_xmlformat_schema_unref(schema2); 386 364 387 } 365 388 END_TEST … … 380 403 create_case(s, "xmlformat_event_schema", xmlformat_event_schema); 381 404 405 // xmlformat schema 406 create_case(s, "xmlformat_schema_get_instance", xmlformat_schema_get_instance); 407 382 408 // xmlfield 383 409 create_case(s, "xmlfield_new", xmlfield_new);
