~ubuntu-branches/ubuntu/trusty/libsdl2/trusty-proposed

« back to all changes in this revision

Viewing changes to test/testiconv.c

  • Committer: Package Import Robot
  • Author(s): Manuel A. Fernandez Montecelo
  • Date: 2013-12-28 12:31:19 UTC
  • mto: (7.1.3 sid)
  • mto: This revision was merged to the branch mainline in revision 7.
  • Revision ID: package-import@ubuntu.com-20131228123119-wehupm72qsjvh6vz
Tags: upstream-2.0.1+dfsg1
ImportĀ upstreamĀ versionĀ 2.0.1+dfsg1

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
    FILE *file;
50
50
    int errors = 0;
51
51
 
 
52
    /* Enable standard application logging */
 
53
    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
54
 
52
55
    if (!argv[1]) {
53
56
        argv[1] = "utf8.txt";
54
57
    }
55
58
    file = fopen(argv[1], "rb");
56
59
    if (!file) {
57
 
        fprintf(stderr, "Unable to open %s\n", argv[1]);
 
60
        SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to open %s\n", argv[1]);
58
61
        return (1);
59
62
    }
60
63
 
69
72
            test[0] = SDL_iconv_string(formats[i], "UCS-4", ucs4, len);
70
73
            test[1] = SDL_iconv_string("UCS-4", formats[i], test[0], len);
71
74
            if (!test[1] || SDL_memcmp(test[1], ucs4, len) != 0) {
72
 
                fprintf(stderr, "FAIL: %s\n", formats[i]);
 
75
                SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "FAIL: %s\n", formats[i]);
73
76
                ++errors;
74
77
            }
75
 
            if (test[0]) {
76
 
                SDL_free(test[0]);
77
 
            }
78
 
            if (test[1]) {
79
 
                SDL_free(test[1]);
80
 
            }
 
78
            SDL_free(test[0]);
 
79
            SDL_free(test[1]);
81
80
        }
82
81
        test[0] = SDL_iconv_string("UTF-8", "UCS-4", ucs4, len);
83
82
        SDL_free(ucs4);