Changeset 4696

Show
Ignore:
Timestamp:
02/23/07 17:10:29 (2 years ago)
Author:
morris
Message:

Do away with spec ids, use a name and a version number together instead

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • libwired/trunk/Makefile.in

    r4661 r4696  
    107107clean: 
    108108        rm -f $(objdir)/libwired/*.o 
     109        rm -f $(objdir)/libwired/*.d 
    109110        rm -f $(headerdir)/*.h 
    110111        rm -f $(rundir)/lib/libwired.a 
  • libwired/trunk/libwired/p7/wi-p7-message.c

    r4687 r4696  
    11081108        uint32_t                field_size, field_id; 
    11091109         
     1110        if(!string) 
     1111                string = WI_STR(""); 
     1112         
    11101113        if(p7_message->serialization == WI_P7_BINARY) { 
    11111114                field_size = wi_string_length(string) + 1; 
     
    11531156        uint32_t                field_size, field_id; 
    11541157         
     1158        if(!data) 
     1159                data = wi_data(); 
     1160         
    11551161        if(p7_message->serialization == WI_P7_BINARY) { 
    11561162                field_size = wi_data_length(data); 
     
    11951201 
    11961202wi_boolean_t wi_p7_message_set_number_for_name(wi_p7_message_t *p7_message, wi_number_t *number, wi_string_t *field_name) { 
     1203        if(!number) 
     1204                number = wi_number_with_int32(0); 
     1205         
    11971206        if(wi_number_type(number) == WI_NUMBER_BOOL) { 
    11981207                return wi_p7_message_set_bool_for_name(p7_message, wi_number_bool(number), field_name); 
     
    12701279        uint32_t                field_id; 
    12711280         
     1281        if(!uuid) 
     1282                return false; 
     1283         
    12721284        if(p7_message->serialization == WI_P7_BINARY) { 
    12731285                if(!_wi_p7_message_get_binary_buffer_for_writing_for_name(p7_message, field_name, 0, &binary, &field_id)) 
     
    13161328        uint32_t                field_id, field_size; 
    13171329         
     1330        if(!date) 
     1331                date = wi_date(); 
     1332         
    13181333        string = wi_date_iso8601_string(date); 
    13191334         
  • libwired/trunk/libwired/p7/wi-p7-private.h

    r4687 r4696  
    6161WI_EXPORT void                                          wi_p7_message_deserialize(wi_p7_message_t *); 
    6262 
     63WI_EXPORT wi_boolean_t                          wi_p7_spec_is_compatible_with_protocol(wi_p7_spec_t *, wi_string_t *, double); 
     64 
    6365WI_EXPORT wi_string_t *                         wi_p7_xml_string_for_attribute(xmlNodePtr, wi_string_t *); 
    6466WI_EXPORT wi_integer_t                          wi_p7_xml_integer_for_attribute(xmlNodePtr, wi_string_t *); 
  • libwired/trunk/libwired/p7/wi-p7-socket.c

    r4691 r4696  
    5151 
    5252#define _WI_P7_SOCKET_XML_MAGIC                         0x3C3F786D 
    53 #define _WI_P7_SOCKET_BINARY_MAGIC_SIZE         52 
     53#define _WI_P7_SOCKET_BINARY_MAGIC_SIZE         58 
    5454 
    5555#define _WI_P7_SOCKET_OPTIONS_ENCRYPTION_ENABLED(options)       \ 
     
    242242 
    243243static wi_boolean_t _wi_p7_socket_connect_handshake(wi_p7_socket_t *p7_socket, wi_time_interval_t timeout, wi_p7_options_t options) { 
    244         wi_uuid_t                      *protocol
     244        wi_string_t                    *protocol_name
    245245        wi_p7_message_t         *p7_message; 
    246         wi_p7_uint32_t         version; 
     246        wi_p7_double_t         version, protocol_version; 
    247247        wi_p7_uint32_t          compression, encryption; 
    248248         
     
    255255        } 
    256256 
    257         wi_p7_message_set_uint32_for_name(p7_message, WI_P7_VERSION, WI_STR("p7.handshake.version")); 
    258         wi_p7_message_set_uuid_for_name(p7_message, wi_p7_spec_id(p7_socket->spec), WI_STR("p7.handshake.protocol")); 
     257        wi_p7_message_set_double_for_name(p7_message, wi_p7_spec_version(wi_p7_spec_builtin_spec()), WI_STR("p7.handshake.version")); 
     258        wi_p7_message_set_string_for_name(p7_message, wi_p7_spec_name(p7_socket->spec), WI_STR("p7.handshake.protocol_name")); 
     259        wi_p7_message_set_double_for_name(p7_message, wi_p7_spec_version(p7_socket->spec), WI_STR("p7.handshake.protocol_version")); 
    259260         
    260261        if(p7_socket->serialization == WI_P7_BINARY) { 
     
    290291        } 
    291292         
    292         if(!wi_p7_message_get_uint32_for_name(p7_message, &version, WI_STR("p7.handshake.version")) || 
    293            !(protocol = wi_p7_message_uuid_for_name(p7_message, WI_STR("p7.handshake.protocol")))) { 
    294                 wi_log_warn(WI_STR("missing keys: version/protocol")); 
    295                  
    296                 return false; 
    297         } 
    298  
    299         if(version != WI_P7_VERSION) { 
    300                 wi_log_warn(WI_STR("version mismatch (%u != %u)"), version, WI_P7_VERSION); 
    301                  
    302                 return false; 
    303         } 
    304             
    305         p7_socket->local_compatibility_check = !wi_p7_spec_is_compatible_with_id(p7_socket->spec, protocol); 
     293        if(!wi_p7_message_get_double_for_name(p7_message, &version, WI_STR("p7.handshake.version"))) { 
     294                wi_log_warn(WI_STR("missing keys: version")); 
     295                 
     296                return false; 
     297        } 
     298 
     299        if(version != wi_p7_spec_version(wi_p7_spec_builtin_spec())) { 
     300                wi_log_warn(WI_STR("version mismatch (%.1f != %.1f)"), version, wi_p7_spec_version(wi_p7_spec_builtin_spec())); 
     301                 
     302                return false; 
     303        } 
     304         
     305        protocol_name = wi_p7_message_string_for_name(p7_message, WI_STR("p7.handshake.protocol_name")); 
     306         
     307        if(!protocol_name) { 
     308                wi_log_warn(WI_STR("missing keys: protocol_name")); 
     309                 
     310                return false; 
     311        } 
     312         
     313        if(!wi_p7_message_get_double_for_name(p7_message, &protocol_version, WI_STR("p7.handshake.protocol_version"))) { 
     314                wi_log_warn(WI_STR("missing keys: protocol_version")); 
     315                 
     316                return false; 
     317        } 
     318         
     319        p7_socket->local_compatibility_check = !wi_p7_spec_is_compatible_with_protocol(p7_socket->spec, protocol_name, protocol_version); 
    306320 
    307321        if(wi_p7_message_get_uint32_for_name(p7_message, &compression, WI_STR("p7.handshake.compression"))) { 
     
    345359 
    346360static wi_boolean_t _wi_p7_socket_accept_handshake(wi_p7_socket_t *p7_socket, wi_time_interval_t timeout, wi_p7_options_t options) { 
    347         wi_uuid_t                      *protocol
     361        wi_string_t                    *protocol_name
    348362        wi_p7_message_t         *p7_message; 
    349         wi_p7_uint32_t         version; 
     363        wi_p7_double_t         version, protocol_version; 
    350364        wi_p7_enum_t            compression, encryption; 
    351365         
     
    364378        } 
    365379         
    366         protocol = wi_p7_message_uuid_for_name(p7_message, WI_STR("p7.handshake.protocol")); 
    367                                                                                     
    368         if(!wi_p7_message_get_uint32_for_name(p7_message, &version, WI_STR("p7.handshake.version")) || 
    369            !protocol) { 
    370                 wi_log_warn(WI_STR("missing keys: version/protocol")); 
    371                  
    372                 return false; 
    373         } 
    374  
    375         if(version != WI_P7_VERSION) { 
    376                 wi_log_warn(WI_STR("version mismatch (%u != %u)"), version, WI_P7_VERSION); 
    377                  
    378                 return false; 
    379         } 
    380          
    381         p7_socket->local_compatibility_check = !wi_p7_spec_is_compatible_with_id(p7_socket->spec, protocol); 
     380        if(!wi_p7_message_get_double_for_name(p7_message, &version, WI_STR("p7.handshake.version"))) { 
     381                wi_log_warn(WI_STR("missing keys: version")); 
     382                 
     383                return false; 
     384        } 
     385 
     386        if(version != wi_p7_spec_version(wi_p7_spec_builtin_spec())) { 
     387                wi_log_warn(WI_STR("version mismatch (%u != %u)"), version, wi_p7_spec_version(wi_p7_spec_builtin_spec())); 
     388                 
     389                return false; 
     390        } 
     391         
     392        protocol_name = wi_p7_message_string_for_name(p7_message, WI_STR("p7.handshake.protocol_name")); 
     393         
     394        if(!protocol_name) { 
     395                wi_log_warn(WI_STR("missing keys: protocol_name")); 
     396                 
     397                return false; 
     398        } 
     399         
     400        if(!wi_p7_message_get_double_for_name(p7_message, &protocol_version, WI_STR("p7.handshake.protocol_version"))) { 
     401                wi_log_warn(WI_STR("missing keys: protocol_version")); 
     402                 
     403                return false; 
     404        } 
     405 
     406        p7_socket->local_compatibility_check = !wi_p7_spec_is_compatible_with_protocol(p7_socket->spec, protocol_name, protocol_version); 
    382407 
    383408        if(p7_socket->serialization == WI_P7_BINARY) { 
     
    405430        } 
    406431         
    407         wi_p7_message_set_uint32_for_name(p7_message, WI_P7_VERSION, WI_STR("p7.handshake.version")); 
    408         wi_p7_message_set_uuid_for_name(p7_message, wi_p7_spec_id(p7_socket->spec), WI_STR("p7.handshake.protocol")); 
     432        wi_p7_message_set_double_for_name(p7_message, wi_p7_spec_version(wi_p7_spec_builtin_spec()), WI_STR("p7.handshake.version")); 
     433        wi_p7_message_set_string_for_name(p7_message, wi_p7_spec_name(p7_socket->spec), WI_STR("p7.handshake.protocol_name")); 
     434        wi_p7_message_set_double_for_name(p7_message, wi_p7_spec_version(p7_socket->spec), WI_STR("p7.handshake.protocol_version")); 
    409435         
    410436        if(p7_socket->options & WI_P7_COMPRESSION_DEFLATE) 
     
    12451271        wi_p7_message_deserialize(p7_message); 
    12461272         
    1247         wi_log_info(WI_STR("data = %@"), wi_data_with_bytes(p7_message->binary_buffer, p7_message->binary_size)); 
    1248  
    12491273        wi_log_info(WI_STR("Received %@"), p7_message); 
    12501274 
  • libwired/trunk/libwired/p7/wi-p7-socket.h

    r4680 r4696  
    3434#include <wired/wi-runtime.h> 
    3535#include <wired/wi-socket.h> 
    36  
    37 #define WI_P7_VERSION                                                           1 
    3836 
    3937enum _wi_p7_options { 
  • libwired/trunk/libwired/p7/wi-p7-spec.c

    r4680 r4696  
    252252         
    253253        wi_string_t                                                             *filename; 
    254         wi_uuid_t                                                               *id; 
    255         wi_set_t                                                                *compatible_ids; 
     254        wi_string_t                                                             *name; 
     255        double                                                                  version; 
     256         
     257        wi_set_t                                                                *compatible_protocols; 
    256258         
    257259        wi_hash_t                                                               *messages_name, *messages_id; 
     
    290292        "                        xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"" 
    291293        "                        xsi:schemaLocation=\"http://www.zankasoftware.com/P7/Specification p7-specification.xsd\"" 
    292         "                        id=\"FC154842-628F-4CA1-854B-32A652C92882\">" 
     294        "                        name=\"P7\" version=\"1.0\">" 
    293295        "       <p7:types>" 
    294296        "               <p7:type name=\"bool\" id=\"1\" size=\"1\" />" 
     
    307309        "" 
    308310        "       <p7:fields>" 
    309         "               <p7:field name=\"p7.handshake.version\" type=\"uint32\" id=\"1\" />" 
    310         "               <p7:field name=\"p7.handshake.protocol\" type=\"uuid\" id=\"2\" />" 
    311         "               <p7:field name=\"p7.handshake.compression\" type=\"enum\" id=\"3\">" 
     311        "               <p7:field name=\"p7.handshake.version\" type=\"double\" id=\"1\" />" 
     312        "               <p7:field name=\"p7.handshake.protocol_name\" type=\"string\" id=\"2\" />" 
     313        "               <p7:field name=\"p7.handshake.protocol_version\" type=\"double\" id=\"3\" />" 
     314        "               <p7:field name=\"p7.handshake.compression\" type=\"enum\" id=\"4\">" 
    312315        "                       <p7:enum name=\"p7.handshake.compression.deflate\" value=\"0\" />" 
    313316        "               </p7:field>" 
    314         "               <p7:field name=\"p7.handshake.encryption\" type=\"enum\" id=\"4\">" 
     317        "               <p7:field name=\"p7.handshake.encryption\" type=\"enum\" id=\"5\">" 
    315318        "                       <p7:enum name=\"p7.handshake.encryption.rsa_aes256_sha1\" value=\"0\" />" 
    316319        "                       <p7:enum name=\"p7.handshake.encryption.rsa_bf128_sha1\" value=\"1\" />" 
    317320        "                       <p7:enum name=\"p7.handshake.encryption.rsa_3des192_sha1\" value=\"2\" />" 
    318321        "               </p7:field>" 
    319         "               <p7:field name=\"p7.handshake.compatibility_check\" type=\"bool\" id=\"5\" />" 
     322        "               <p7:field name=\"p7.handshake.compatibility_check\" type=\"bool\" id=\"6\" />" 
    320323        "" 
    321         "               <p7:field name=\"p7.encryption.envelope_key\" id=\"6\" type=\"data\" />" 
    322         "               <p7:field name=\"p7.encryption.cipher_key\" id=\"7\" type=\"data\" />" 
    323         "               <p7:field name=\"p7.encryption.cipher_iv\" id=\"8\" type=\"data\" />" 
    324         "               <p7:field name=\"p7.encryption.username\" id=\"9\" type=\"data\" />" 
    325         "               <p7:field name=\"p7.encryption.client_password\" id=\"10\" type=\"data\" />" 
    326         "               <p7:field name=\"p7.encryption.server_password\" id=\"11\" type=\"data\" />" 
     324        "               <p7:field name=\"p7.encryption.envelope_key\" id=\"7\" type=\"data\" />" 
     325        "               <p7:field name=\"p7.encryption.cipher_key\" id=\"8\" type=\"data\" />" 
     326        "               <p7:field name=\"p7.encryption.cipher_iv\" id=\"9\" type=\"data\" />" 
     327        "               <p7:field name=\"p7.encryption.username\" id=\"10\" type=\"data\" />" 
     328        "               <p7:field name=\"p7.encryption.client_password\" id=\"11\" type=\"data\" />" 
     329        "               <p7:field name=\"p7.encryption.server_password\" id=\"12\" type=\"data\" />" 
    327330        "" 
    328         "               <p7:field name=\"p7.compatibility_check.specification\" id=\"12\" type=\"string\" />" 
    329         "               <p7:field name=\"p7.compatibility_check.status\" id=\"13\" type=\"bool\" />" 
     331        "               <p7:field name=\"p7.compatibility_check.specification\" id=\"13\" type=\"string\" />" 
     332        "               <p7:field name=\"p7.compatibility_check.status\" id=\"14\" type=\"bool\" />" 
    330333        "       </p7:fields>" 
    331334        "" 
     
    333336        "               <p7:message name=\"p7.handshake\" id=\"1\">" 
    334337        "                       <p7:parameter field=\"p7.handshake.version\" use=\"required\" />" 
    335         "                       <p7:parameter field=\"p7.handshake.protocol\" use=\"required\" />" 
     338        "                       <p7:parameter field=\"p7.handshake.protocol_name\" use=\"required\" />" 
     339        "                       <p7:parameter field=\"p7.handshake.protocol_version\" use=\"required\" />" 
    336340        "                       <p7:parameter field=\"p7.handshake.encryption\" />" 
    337341        "                       <p7:parameter field=\"p7.handshake.compression\" />" 
     
    340344        "               <p7:message name=\"p7.handshake.reply\" id=\"2\">" 
    341345        "                       <p7:parameter field=\"p7.handshake.version\" use=\"required\" />" 
    342         "                       <p7:parameter field=\"p7.handshake.protocol\" use=\"required\" />" 
     346        "                       <p7:parameter field=\"p7.handshake.protocol_name\" use=\"required\" />" 
     347        "                       <p7:parameter field=\"p7.handshake.protocol_version\" use=\"required\" />" 
    343348        "                       <p7:parameter field=\"p7.handshake.encryption\" />" 
    344349        "                       <p7:parameter field=\"p7.handshake.compression\" />" 
     
    464469        }; 
    465470         
    466         p7_spec->compatible_ids         = wi_set_init(wi_set_alloc()); 
    467  
    468         p7_spec->messages_name          = wi_hash_init_with_capacity(wi_hash_alloc(), 500); 
    469         p7_spec->messages_id            = wi_hash_init_with_capacity_and_callbacks(wi_hash_alloc(), 500, key_callbacks, wi_hash_default_value_callbacks); 
    470  
    471         p7_spec->fields_name            = wi_hash_init_with_capacity(wi_hash_alloc(), 500); 
    472         p7_spec->fields_id                      = wi_hash_init_with_capacity_and_callbacks(wi_hash_alloc(), 500, key_callbacks, wi_hash_default_value_callbacks); 
    473  
    474         p7_spec->types_name                     = wi_hash_init_with_capacity(wi_hash_alloc(), 20); 
    475         p7_spec->types_id                       = wi_hash_init_with_capacity_and_callbacks(wi_hash_alloc(), 20, key_callbacks, wi_hash_default_value_callbacks); 
    476  
    477         p7_spec->transactions_name      = wi_hash_init_with_capacity(wi_hash_alloc(), 20); 
     471        p7_spec->compatible_protocols   = wi_set_init(wi_set_alloc()); 
     472 
     473        p7_spec->messages_name                  = wi_hash_init_with_capacity(wi_hash_alloc(), 500); 
     474        p7_spec->messages_id                    = wi_hash_init_with_capacity_and_callbacks(wi_hash_alloc(), 
     475                500, key_callbacks, wi_hash_default_value_callbacks); 
     476 
     477        p7_spec->fields_name                    = wi_hash_init_with_capacity(wi_hash_alloc(), 500); 
     478        p7_spec->fields_id                              = wi_hash_init_with_capacity_and_callbacks(wi_hash_alloc(), 
     479                500, key_callbacks, wi_hash_default_value_callbacks); 
     480 
     481        p7_spec->types_name                             = wi_hash_init_with_capacity(wi_hash_alloc(), 20); 
     482        p7_spec->types_id                               = wi_hash_init_with_capacity_and_callbacks(wi_hash_alloc(), 
     483                20, key_callbacks, wi_hash_default_value_callbacks); 
     484 
     485        p7_spec->transactions_name              = wi_hash_init_with_capacity(wi_hash_alloc(), 20); 
    478486 
    479487        return p7_spec; 
     
    536544 
    537545        wi_release(p7_spec->filename); 
    538         wi_release(p7_spec->id); 
    539         wi_release(p7_spec->compatible_ids); 
     546        wi_release(p7_spec->name); 
     547        wi_release(p7_spec->compatible_protocols); 
    540548         
    541549        wi_release(p7_spec->messages_name); 
     
    556564        wi_p7_spec_t            *p7_spec = instance; 
    557565         
    558         return wi_string_with_format(WI_STR("<%@ %p>{types = %@, fields = %@, messages = %@}"), 
     566        return wi_string_with_format(WI_STR("<%@ %p>{name = %@, version = %.1f, types = %@, fields = %@, messages = %@}"), 
    559567                wi_runtime_class_name(p7_spec), 
    560568                p7_spec, 
     569                p7_spec->name, 
     570                p7_spec->version, 
    561571                p7_spec->types_name, 
    562572                p7_spec->fields_name, 
     
    655665 
    656666static wi_boolean_t _wi_p7_spec_load_spec(wi_p7_spec_t *p7_spec, xmlDocPtr doc) { 
    657         wi_string_t             *string
     667        wi_string_t             *version
    658668        xmlNodePtr              root_node, node; 
    659669         
    660670        root_node = xmlDocGetRootElement(doc); 
    661671         
    662         string = wi_p7_xml_string_for_attribute(root_node, WI_STR("id")); 
    663          
    664         if(string) 
    665                 p7_spec->id = wi_uuid_init_with_string(wi_uuid_alloc(), string); 
     672        p7_spec->name = wi_retain(wi_p7_xml_string_for_attribute(root_node, WI_STR("name"))); 
     673 
     674        if(!p7_spec->name) { 
     675                wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, 
     676                        WI_STR("Protocol has no \"name\"")); 
     677                 
     678                return false; 
     679        } 
     680         
     681        version = wi_p7_xml_string_for_attribute(root_node, WI_STR("version")); 
     682         
     683        if(!version) { 
     684                wi_error_set_libwired_p7_error(WI_ERROR_P7_INVALIDSPEC, 
     685                        WI_STR("Protocol has no \"version\"")); 
     686                 
     687                return false; 
     688        } 
     689         
     690        p7_spec->version = wi_string_double(version); 
    666691 
    667692        for(node = root_node->children; node != NULL; node = node->next) { 
     
    840865#pragma mark - 
    841866 
    842 wi_boolean_t wi_p7_spec_is_compatible_with_id(wi_p7_spec_t *p7_spec, wi_uuid_t *id) { 
    843         return (wi_is_equal(p7_spec->id, id) || wi_set_contains_data(p7_spec->compatible_ids, id)); 
     867wi_boolean_t wi_p7_spec_is_compatible_with_protocol(wi_p7_spec_t *p7_spec, wi_string_t *name, double version) { 
     868        return ((wi_is_equal(p7_spec->name, name) && p7_spec->version == version) || 
     869                        wi_set_contains_data(p7_spec->compatible_protocols, wi_string_with_format(WI_STR("%@ %.1f"), name, version))); 
    844870} 
    845871 
     
    851877        compatible = _wi_p7_spec_is_compatible(p7_spec, other_p7_spec); 
    852878         
    853         if(compatible) 
    854                 wi_set_add_data(p7_spec->compatible_ids, other_p7_spec->id); 
     879        if(compatible) { 
     880                wi_set_add_data(p7_spec->compatible_protocols, wi_string_with_format(WI_STR("%@ %.1f"), 
     881                        other_p7_spec->name, other_p7_spec->version)); 
     882        } 
    855883         
    856884        return compatible; 
     
    11321160#pragma mark - 
    11331161 
    1134 wi_uuid_t * wi_p7_spec_id(wi_p7_spec_t *p7_spec) { 
    1135         return p7_spec->id; 
     1162wi_string_t * wi_p7_spec_name(wi_p7_spec_t *p7_spec) { 
     1163        return p7_spec->name; 
     1164
     1165 
     1166 
     1167 
     1168double wi_p7_spec_version(wi_p7_spec_t *p7_spec) { 
     1169        return p7_spec->version; 
    11361170} 
    11371171 
  • libwired/trunk/libwired/p7/wi-p7-spec.h

    r4679 r4696  
    4747WI_EXPORT wi_p7_spec_t *                                wi_p7_spec_init_with_string(wi_p7_spec_t *, wi_string_t *); 
    4848 
    49 WI_EXPORT wi_boolean_t                                  wi_p7_spec_is_compatible_with_id(wi_p7_spec_t *, wi_uuid_t *); 
    5049WI_EXPORT wi_boolean_t                                  wi_p7_spec_is_compatible_with_spec(wi_p7_spec_t *, wi_p7_spec_t *); 
    5150 
    52 WI_EXPORT wi_uuid_t *                                   wi_p7_spec_id(wi_p7_spec_t *); 
     51WI_EXPORT wi_string_t *                                 wi_p7_spec_name(wi_p7_spec_t *); 
     52WI_EXPORT double                                                wi_p7_spec_version(wi_p7_spec_t *); 
    5353WI_EXPORT wi_string_t *                                 wi_p7_spec_xml(wi_p7_spec_t *); 
    5454WI_EXPORT wi_uinteger_t                                 wi_p7_spec_message_id(wi_p7_spec_t *, wi_string_t *); 
  • libwired/trunk/test/tests/wi-p7-spec-tests.c

    r4668 r4696  
    3838        "                        xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"" 
    3939        "                        xsi:schemaLocation=\"http://www.zankasoftware.com/P7/Specification p7.xsd\"" 
    40         "                        id=\"097CDA0A-1DDF-43AA-BC4C-17C275FD14E8\">" 
     40        "                        name=\"test\"" 
     41        "                        version=\"1.0\">" 
    4142        "       <p7:fields>" 
    4243        "               <p7:field name=\"test.bool\" type=\"bool\" id=\"1000\" />" 
     
    124125        WI_TEST_ASSERT_NOT_NULL(p7_spec, ""); 
    125126         
    126         WI_TEST_ASSERT_EQUAL_INSTANCES(wi_p7_spec_id(p7_spec), wi_uuid_with_string(WI_STR("097CDA0A-1DDF-43AA-BC4C-17C275FD14E8")), ""); 
     127        WI_TEST_ASSERT_EQUAL_INSTANCES(wi_p7_spec_name(p7_spec), WI_STR("test"), ""); 
     128        WI_TEST_ASSERT_EQUALS_WITH_ACCURACY(wi_p7_spec_version(p7_spec), 1.0, 0.001, ""); 
    127129         
    128130        WI_TEST_ASSERT_EQUALS(wi_p7_spec_message_id(p7_spec, WI_STR("test")), 1000U, "");