/[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 221 by siliconforks, Fri Oct 3 02:27:43 2008 UTC revision 309 by siliconforks, Mon Oct 13 06:24:16 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    /* malformed */  #ifndef _WIN32
168      /* 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 173  Line 177 
177    result = jscoverage_bytes_to_characters("US-ASCII", malformed_ascii, 4, &characters, &num_characters);    result = jscoverage_bytes_to_characters("US-ASCII", malformed_ascii, 4, &characters, &num_characters);
178    
179    assert(result == JSCOVERAGE_ERROR_INVALID_BYTE_SEQUENCE);    assert(result == JSCOVERAGE_ERROR_INVALID_BYTE_SEQUENCE);
180    #endif
181    
182      /* malformed UTF-8 */
183      uint8_t malformed_utf8[] = {
184        'e',
185        0xe8,
186        0xe9,
187        0xea,
188      };
189    
190      result = jscoverage_bytes_to_characters("UTF-8", malformed_utf8, 4, &characters, &num_characters);
191    
192      assert(result == JSCOVERAGE_ERROR_INVALID_BYTE_SEQUENCE);
193    
194    return 0;    return 0;
195  }  }

Legend:
Removed from v.221  
changed lines
  Added in v.309

  ViewVC Help
Powered by ViewVC 1.1.24