Changeset b40e60d for tests


Ignore:
Timestamp:
2010-07-29T08:57:01Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
2fe5eb9
Parents:
3963fdd
Message:

Fixing http_encode(): BitlBee now calls setlocale() (for nickname
transliteration to work), which changes the behaviour of isalpha() (turns
out it's not a simple macro). For HTTP-encoding, this sucks, especially
when doing OAuth (which is very picky about the way HTTP encoding is done).
This should fix problems some people were seeing with posting Twitter
messages containing accents.

Location:
tests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tests/check.c

    r3963fdd rb40e60d  
    33#include <gmodule.h>
    44#include <check.h>
     5#include <locale.h>
    56#include "bitlbee.h"
    67#include "testsuite.h"
     
    9293
    9394        log_init();
     95        setlocale(LC_CTYPE, "");
    9496
    9597        if (verbose) {
  • tests/check_util.c

    r3963fdd rb40e60d  
    161161END_TEST
    162162
     163START_TEST(test_http_encode)
     164        char s[80];
     165       
     166        strcpy( s, "ee\xc3""\xab""ee!!..." );
     167        http_encode( s );
     168        fail_unless( strcmp( s, "ee%C3%ABee%21%21..." ) == 0 );
     169END_TEST
     170
    163171Suite *util_suite (void)
    164172{
     
    174182        tcase_add_test (tc_core, test_set_url_username_pwd);
    175183        tcase_add_test (tc_core, test_word_wrap);
     184        tcase_add_test (tc_core, test_http_encode);
    176185        return s;
    177186}
Note: See TracChangeset for help on using the changeset viewer.