/[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 302 by siliconforks, Mon Oct 13 05:11:20 2008 UTC revision 310 by siliconforks, Mon Oct 13 07:19:42 2008 UTC
# Line 17  Line 17 
17      51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.      51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */  */
19    
20    #include <config.h>
21    
22  #include <assert.h>  #include <assert.h>
23  #include <string.h>  #include <string.h>
24    
# Line 81  Line 83 
83    
84    free(characters);    free(characters);
85    
86  #ifndef _WIN32  #ifdef HAVE_ICONV
87    uint8_t utf16be[] = {    uint8_t utf16be[] = {
88      0, 'e',      0, 'e',
89      0, 0xe8,      0, 0xe8,
# Line 164  Line 166 
166    
167    assert(result == JSCOVERAGE_ERROR_ENCODING_NOT_SUPPORTED);    assert(result == JSCOVERAGE_ERROR_ENCODING_NOT_SUPPORTED);
168    
169  #ifndef _WIN32  #ifdef HAVE_ICONV
170    /* malformed US-ASCII */    /* malformed US-ASCII */
171    /* NOTE: Windows simply discards the high bit */    /* NOTE: Windows simply discards the high bit */
172    uint8_t malformed_ascii[] = {    uint8_t malformed_ascii[] = {
# Line 177  Line 179 
179    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);
180    
181    assert(result == JSCOVERAGE_ERROR_INVALID_BYTE_SEQUENCE);    assert(result == JSCOVERAGE_ERROR_INVALID_BYTE_SEQUENCE);
182    #endif
183    
184    /* malformed UTF-8 */    /* malformed UTF-8 */
   /* NOTE: Windows simply decodes as many bytes as it can, then it stops */  
185    uint8_t malformed_utf8[] = {    uint8_t malformed_utf8[] = {
186      'e',      'e',
187      0xe8,      0xe8,
# Line 190  Line 192 
192    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);
193    
194    assert(result == JSCOVERAGE_ERROR_INVALID_BYTE_SEQUENCE);    assert(result == JSCOVERAGE_ERROR_INVALID_BYTE_SEQUENCE);
 #endif  
195    
196    return 0;    return 0;
197  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.24