i++;
dst[dstcounter++] = WIDE_CHAR_SHORT_PREFIX;
dst[dstcounter++] = WIDE_CHAR_SHORT_O;
+ } else if (src[i] == 'u' && src[i + 1] == 'e') {
+ i++;
+ dst[dstcounter++] = WIDE_CHAR_SHORT_PREFIX;
+ dst[dstcounter++] = WIDE_CHAR_SHORT_u;
+ } else if (src[i] == 'U' && src[i + 1] == 'e') {
+ i++;
+ dst[dstcounter++] = WIDE_CHAR_SHORT_PREFIX;
+ dst[dstcounter++] = WIDE_CHAR_SHORT_U;
} else {
dst[dstcounter++] = src[i];
}
#define WIDE_CHAR_SHORT_A 0x84
#define WIDE_CHAR_SHORT_o 0xb6
#define WIDE_CHAR_SHORT_O 0x96
+#define WIDE_CHAR_SHORT_u 0xbc
+#define WIDE_CHAR_SHORT_U 0x9c
typedef void (*rename_func_ptr)(char* src, char* dst);
void escape_str(char* src, char* dst);
assert_string_equal(output, "Ökosystem");
}
+void rename_revert_ue(void **state)
+{
+ char* output = (char*) *state;
+ char* input = "bruellt";
+
+ rename_revert_str(input, output);
+
+ assert_string_equal(output, "brüllt");
+}
+
+void rename_revert_Ue(void **state)
+{
+ char* output = (char*) *state;
+ char* input = "Ueberlastung";
+
+ rename_revert_str(input, output);
+
+ assert_string_equal(output, "Überlastung");
+}
+
int main()
{
const struct CMUnitTest tests[] = {
cmocka_unit_test_setup_teardown(rename_revert_Ae, setup, teardown),
cmocka_unit_test_setup_teardown(rename_revert_oe, setup, teardown),
cmocka_unit_test_setup_teardown(rename_revert_Oe, setup, teardown),
+ cmocka_unit_test_setup_teardown(rename_revert_ue, setup, teardown),
+ cmocka_unit_test_setup_teardown(rename_revert_Ue, setup, teardown),
};
return cmocka_run_group_tests(tests, NULL, NULL);