/[jscoverage]/trunk/tests/encodings.c
ViewVC logotype

Diff of /trunk/tests/encodings.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 301 by siliconforks, Mon Oct 13 05:07:00 2008 UTC revision 302 by siliconforks, Mon Oct 13 05:11:20 2008 UTC
# Line 81  Line 81 
81    
82    free(characters);    free(characters);
83    
84    #ifndef _WIN32
85    uint8_t utf16be[] = {    uint8_t utf16be[] = {
86      0, 'e',      0, 'e',
87      0, 0xe8,      0, 0xe8,
# Line 154  Line 155 
155    assert(characters[3] == 0xea);    assert(characters[3] == 0xea);
156    
157    free(characters);    free(characters);
158    #endif
159    
160    /* bogus encoding */    /* bogus encoding */
161    uint8_t bogus[] = {'b', 'o', 'g', 'u', 's'};    uint8_t bogus[] = {'b', 'o', 'g', 'u', 's'};
# Line 162  Line 164 
164    
165    assert(result == JSCOVERAGE_ERROR_ENCODING_NOT_SUPPORTED);    assert(result == JSCOVERAGE_ERROR_ENCODING_NOT_SUPPORTED);
166    
167    #ifndef _WIN32
168    /* malformed US-ASCII */    /* malformed US-ASCII */
169      /* NOTE: Windows simply discards the high bit */
170    uint8_t malformed_ascii[] = {    uint8_t malformed_ascii[] = {
171      'e',      'e',
172      0xe8,      0xe8,
# Line 175  Line 179 
179    assert(result == JSCOVERAGE_ERROR_INVALID_BYTE_SEQUENCE);    assert(result == JSCOVERAGE_ERROR_INVALID_BYTE_SEQUENCE);
180    
181    /* malformed UTF-8 */    /* malformed UTF-8 */
182      /* NOTE: Windows simply decodes as many bytes as it can, then it stops */
183    uint8_t malformed_utf8[] = {    uint8_t malformed_utf8[] = {
184      'e',      'e',
185      0xe8,      0xe8,
# Line 185  Line 190 
190    result = jscoverage_bytes_to_characters("UTF-8", malformed_utf8, 4, &characters, &num_characters);    result = jscoverage_bytes_to_characters("UTF-8", malformed_utf8, 4, &characters, &num_characters);
191    
192    assert(result == JSCOVERAGE_ERROR_INVALID_BYTE_SEQUENCE);    assert(result == JSCOVERAGE_ERROR_INVALID_BYTE_SEQUENCE);
193    #endif
194    
195    return 0;    return 0;
196  }  }

Legend:
Removed from v.301  
changed lines
  Added in v.302

  ViewVC Help
Powered by ViewVC 1.1.24