Project homepage Mailing List  Warmcat.com  API Docs  Github Mirror 
{"schema":"libjg2-1", "vpath":"/git/", "avatar":"/git/avatar/", "alang":"", "gen_ut":1752719260, "reponame":"openssl", "desc":"OpenSSL", "owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://warmcat.com/repo/openssl", "f":3, "items": [ {"schema":"libjg2-1", "cid":"10cf6c70aa31db067b409f6ab77e807d", "commit": {"type":"commit", "time": 1493155611, "time_ofs": 120, "oid_tree": { "oid": "02ce291863551e70434453b535676f927f471f3b", "alias": []}, "oid":{ "oid": "dd05be5d7809cb831718820eedd86269b2504180", "alias": []}, "msg": "test: don't make it more complicated than necessary.", "sig_commit": { "git_time": { "time": 1493155611, "offset": 120 }, "name": "Andy Polyakov", "email": "appro@openssl.org", "md5": "50bd64fa2a792cbbf679fa16213a3b2a" }, "sig_author": { "git_time": { "time": 1493072488, "offset": 120 }, "name": "Andy Polyakov", "email": "appro@openssl.org", "md5": "50bd64fa2a792cbbf679fa16213a3b2a" }}, "body": "test: don't make it more complicated than necessary.\n\nOriginal rationale behind using write in testutil was to accommodate\nno-stdio builds. But is there evidence that no-stdio users would have\nwrite or pre-defined meaning for file descriptors 1 and 2? Correct\nanswer is to provide way for no-stdio users who want to exercise\ntests to plug in own BIO, not to make assumption that they have write.\nAnd since we don't have to make such assumption, we can as well go\nfor simplest that works with standard library as specified by C\nlanguage standard.\n\nReviewed-by: Richard Levitte \u003clevitte@openssl.org\u003e\n" , "diff": "diff --git a/test/bioprinttest.c b/test/bioprinttest.c\nindex 56aa0b0..2c2dc8c 100644\n--- a/test/bioprinttest.c\n+++ b/test/bioprinttest.c\n@@ -11,12 +11,6 @@\n \n #include \u003cstdio.h\u003e\n #include \u003cstring.h\u003e\n-#include \u003copenssl/e_os2.h\u003e\n-#ifdef OPENSSL_SYS_WINDOWS\n-# include \u003cwinsock.h\u003e\n-#else\n-# include OPENSSL_UNISTD\n-#endif\n #include \u003copenssl/bio.h\u003e\n #include \u0022internal/numbers.h\u0022\n #include \u0022testutil.h\u0022\n@@ -268,16 +262,21 @@ void test_close_streams(void)\n \n int test_puts_stdout(const char *str)\n {\n- return write(1, str, strlen(str));\n+ return fputs(str, stdout);\n }\n \n int test_puts_stderr(const char *str)\n {\n- return write(2, str, strlen(str));\n+ return fputs(str, stderr);\n }\n \n static char vprint_buf[10240];\n \n+/*\n+ * This works out as long as caller doesn't use any \u0022fancy\u0022 formats.\n+ * But we are caller's caller, and test_str_eq is the only one called,\n+ * and it uses only \u0022%s\u0022, which is not \u0022fancy\u0022...\n+ */\n int test_vprintf_stdout(const char *fmt, va_list ap)\n {\n size_t len \u003d vsnprintf(vprint_buf, sizeof(vprint_buf), fmt, ap);\n@@ -298,10 +297,10 @@ int test_vprintf_stderr(const char *fmt, va_list ap)\n \n int test_flush_stdout(void)\n {\n- return 0;\n+ return fflush(stdout);\n }\n \n int test_flush_stderr(void)\n {\n- return 0;\n+ return fflush(stderr);\n }\ndiff --git a/test/testutil/basic_output.c b/test/testutil/basic_output.c\nindex ac413a6..9080aae 100644\n--- a/test/testutil/basic_output.c\n+++ b/test/testutil/basic_output.c\n@@ -15,29 +15,10 @@\n BIO *bio_out \u003d NULL;\n BIO *bio_err \u003d NULL;\n \n-#ifdef OPENSSL_USE_APPLINK\n-/*\n- * Using BIO_new_fd() obligates the use of applinks on platforms where it's\n- * relevant. Because it becomes a module of the libtestutil library and would\n- * be disregarded if not actively referred to, we have this dummy that does\n- * exactly this. For any module that uses the rest of the routines here,\n- * OPENSSL_Applink should tag along for sure.\n- */\n-void Applink_dummy(void);\n-void Applink_dummy(void)\n-{\n- OPENSSL_EXTERN void OPENSSL_Applink(void);\n-\n- OPENSSL_Applink();\n-}\n-/* Generate an error for anyone who tries to actually use this dummy */\n-# define Applink_dummy \u0022DON'T USE THIS\u0022\n-#endif\n-\n void test_open_streams(void)\n {\n- bio_out \u003d BIO_new_fd(1, 0);\n- bio_err \u003d BIO_new_fd(2, 0);\n+ bio_out \u003d BIO_new_fp(stdout, BIO_NOCLOSE | BIO_FP_TEXT);\n+ bio_err \u003d BIO_new_fp(stderr, BIO_NOCLOSE | BIO_FP_TEXT);\n \n OPENSSL_assert(bio_out !\u003d NULL);\n OPENSSL_assert(bio_err !\u003d NULL);\n","s":{"c":1752719260,"u": 28032}} ],"g": 29415,"chitpc": 0,"ehitpc": 0,"indexed":0 , "ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}