X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=libcitadel%2Ftests%2Fstringbuf_conversion.c;h=c73ece4d273d9489bd647d0391880d1897dabdf0;hb=b826c3117bb7ddf1386a4811cb2eb47ea4e1097c;hp=15634cc160755cbac330d1fee73951bde4b80262;hpb=d04e4ad0b8ab9e5b71310030704d61b6eceb530b;p=citadel.git diff --git a/libcitadel/tests/stringbuf_conversion.c b/libcitadel/tests/stringbuf_conversion.c index 15634cc16..c73ece4d2 100644 --- a/libcitadel/tests/stringbuf_conversion.c +++ b/libcitadel/tests/stringbuf_conversion.c @@ -321,6 +321,33 @@ static void TestEncodeEmailSTDIN(void) FreeStrBuf(&Source); } +static void StrBufRFC2047encodeMessageStdin(void) +{ + int fdin = 0;// STDIN + const char *Err; + StrBuf *Target; + StrBuf *Source; + StrBuf *Src; + + Source = NewStrBuf(); + Src = NewStrBuf(); + + printf("["); + while (fdin == 0) { + + StrBufTCP_read_line(Source, &fdin, 0, &Err); + StrBufAppendBuf(Src, Source, 0); + StrBufAppendBufPlain(Src, HKEY("\n"), 0); + + } + + Target = StrBufRFC2047encodeMessage(Src); + + printf("Target: \n%s\n", ChrPtr(Target)); + FreeStrBuf(&Source); + FreeStrBuf(&Src); + FreeStrBuf(&Target); +} static void TestHTML2ASCII_line(void) { @@ -335,7 +362,7 @@ static void TestHTML2ASCII_line(void) StrBufTCP_read_line(Source, &fdin, 0, &Err); printf("the source:>%s<\n", ChrPtr(Source)); - Target = html_to_ascii(ChrPtr(Source), StrLength(Source), 80, 0); + Target = html_to_ascii(ChrPtr(Source), StrLength(Source), 80); printf("the target:>%s<\n", Target); FlushStrBuf(Source); @@ -390,6 +417,9 @@ static void AddStrBufSimlpeTests(void) case 'U': pTest = CU_add_test(pGroup, "TestUrlescEncodeStdin", TestUrlescEncodeStdin); break; + case 'R': + pTest = CU_add_test(pGroup, "StrBufRFC2047encodeMessageStdin", StrBufRFC2047encodeMessageStdin); + break; default: printf("%c not supported!\n", OutputEscapeAs); CU_ASSERT(1); @@ -428,7 +458,6 @@ int main(int argc, char* argv[]) setvbuf(stdout, NULL, _IONBF, 0); - StartLibCitadel(8); CU_BOOL Run = CU_FALSE ; CU_set_output_filename("TestAutomated");