aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2016-09-09 03:03:57 +0200
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2016-09-09 03:03:57 +0200
commitd66ebfab3458172bd435b00c51e8b09e2510b4d4 (patch)
tree157220d08f8005a7f91e321394d5f10d97ffb693 /tests
parentba38817ab8dd3606de9e5d40c83c8f8d185f671b (diff)
downloadblogc-d66ebfab3458172bd435b00c51e8b09e2510b4d4.tar.gz
blogc-d66ebfab3458172bd435b00c51e8b09e2510b4d4.tar.bz2
blogc-d66ebfab3458172bd435b00c51e8b09e2510b4d4.zip
s/blogc_utf8_/bc_utf8_/g
Diffstat (limited to 'tests')
-rw-r--r--tests/common/check_utf8.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/common/check_utf8.c b/tests/common/check_utf8.c
index f4c7f32..56953f1 100644
--- a/tests/common/check_utf8.c
+++ b/tests/common/check_utf8.c
@@ -24,11 +24,11 @@ test_utf8_valid(void **state)
{
const char *c = "<a href=\"{{ BASE_URL }}/page/{{ PREVIOUS_PAGE }}/\">"
"\xc2\xab Newer posts</a>";
- assert_true(blogc_utf8_validate((uint8_t*) c, strlen(c)));
+ assert_true(bc_utf8_validate((uint8_t*) c, strlen(c)));
const uint8_t d[3] = {0xe2, 0x82, 0xac}; // euro sign
- assert_true(blogc_utf8_validate(d, 3));
+ assert_true(bc_utf8_validate(d, 3));
const uint8_t e[3] = {0xef, 0xbb, 0xbf}; // utf-8 bom
- assert_true(blogc_utf8_validate(e, 3));
+ assert_true(bc_utf8_validate(e, 3));
}
@@ -36,9 +36,9 @@ static void
test_utf8_invalid(void **state)
{
const uint8_t c[4] = {0xff, 0xfe, 0xac, 0x20}; // utf-16
- assert_false(blogc_utf8_validate(c, 4));
+ assert_false(bc_utf8_validate(c, 4));
const uint8_t d[8] = {0xff, 0xfe, 0x00, 0x00, 0xac, 0x20, 0x00, 0x00}; // utf-32
- assert_false(blogc_utf8_validate(d, 8));
+ assert_false(bc_utf8_validate(d, 8));
}
@@ -49,11 +49,11 @@ test_utf8_valid_str(void **state)
bc_string_append(s,
"<a href=\"{{ BASE_URL }}/page/{{ PREVIOUS_PAGE }}/\">\xc2\xab Newer "
"posts</a>");
- assert_true(blogc_utf8_validate_str(s));
+ assert_true(bc_utf8_validate_str(s));
bc_string_free(s, true);
s = bc_string_new();
bc_string_append(s, "\xe2\x82\xac");
- assert_true(blogc_utf8_validate_str(s));
+ assert_true(bc_utf8_validate_str(s));
bc_string_free(s, true);
}
@@ -63,11 +63,11 @@ test_utf8_invalid_str(void **state)
{
bc_string_t *s = bc_string_new();
bc_string_append(s, "\xff\xfe\xac\x20"); // utf-16
- assert_false(blogc_utf8_validate_str(s));
+ assert_false(bc_utf8_validate_str(s));
bc_string_free(s, true);
s = bc_string_new();
bc_string_append(s, "\xff\xfe\x00\x00\xac\x20\x00\x00"); // utf-32
- assert_false(blogc_utf8_validate_str(s));
+ assert_false(bc_utf8_validate_str(s));
bc_string_free(s, true);
}
@@ -76,14 +76,14 @@ static void
test_utf8_skip_bom(void **state)
{
const uint8_t c[4] = {0xef, 0xbb, 0xbf, 0};
- assert_int_equal(blogc_utf8_skip_bom(c, 2), 0);
- assert_int_equal(blogc_utf8_skip_bom(c, 3), 3);
+ assert_int_equal(bc_utf8_skip_bom(c, 2), 0);
+ assert_int_equal(bc_utf8_skip_bom(c, 3), 3);
assert_string_equal(c + 3, "");
const uint8_t d[8] = {0xef, 0xbb, 0xbf, 'b', 'o', 'l', 'a', 0};
- assert_int_equal(blogc_utf8_skip_bom(d, 7), 3);
+ assert_int_equal(bc_utf8_skip_bom(d, 7), 3);
assert_string_equal(d + 3, "bola");
const uint8_t e[5] = "bola";
- assert_int_equal(blogc_utf8_skip_bom(e, 4), 0);
+ assert_int_equal(bc_utf8_skip_bom(e, 4), 0);
}