| 98 | |
| 99 | |
| 100 | int |
| 101 | main(int argc, char *argv[]) |
| 102 | { |
| 103 | pg_logging_init(argv[0]); |
| 104 | set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pg_test_fsync")); |
| 105 | progname = get_progname(argv[0]); |
| 106 | |
| 107 | handle_args(argc, argv); |
| 108 | |
| 109 | /* Prevent leaving behind the test file */ |
| 110 | pqsignal(SIGINT, signal_cleanup); |
| 111 | pqsignal(SIGTERM, signal_cleanup); |
| 112 | #ifndef WIN32 |
| 113 | pqsignal(SIGALRM, process_alarm); |
| 114 | #endif |
| 115 | #ifdef SIGHUP |
| 116 | /* Not defined on win32 */ |
| 117 | pqsignal(SIGHUP, signal_cleanup); |
| 118 | #endif |
| 119 | |
| 120 | prepare_buf(); |
| 121 | |
| 122 | test_open(); |
| 123 | |
| 124 | /* Test using 1 XLOG_BLCKSZ write */ |
| 125 | test_sync(1); |
| 126 | |
| 127 | /* Test using 2 XLOG_BLCKSZ writes */ |
| 128 | test_sync(2); |
| 129 | |
| 130 | test_open_syncs(); |
| 131 | |
| 132 | test_file_descriptor_sync(); |
| 133 | |
| 134 | test_non_sync(); |
| 135 | |
| 136 | unlink(filename); |
| 137 | |
| 138 | return 0; |
| 139 | } |
| 140 | |
| 141 | static void |
| 142 | handle_args(int argc, char *argv[]) |
nothing calls this directly
no test coverage detected