chiark / gitweb /
New m4-based test harness stuff.
[adns.git] / regress / junk
similarity index 65%
rename from src/hrecord.c
rename to regress/junk
index 5d9f69d25f2052e8a3411108d9a0993a8b5341d9..54e797b0bfa1f6676cdab156e4157db98ca0f33b 100644 (file)
@@ -1,69 +1,21 @@
-/*
- * hrecord.c
- * - complex test harness, recording routines
- */
-/*
- *  This file is part of adns, which is Copyright (C) 1997, 1998 Ian Jackson
- *  
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2, or (at your option)
- *  any later version.
- *  
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *  
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software Foundation,
- *  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
- */
-
-#include <assert.h>
-#include <string.h>
-#include <fcntl.h>
-#include <errno.h>
-
-#include "harness.h"
-
-static int begin_set;
-static struct timeval begin;
-
-void Q_str(const char *str) {
-  Tensureoutputfile();
-  if (fprintf(Toutputfile," %s\n",str) == EOF) Toutputerr();
-  if (fflush(Toutputfile)) Toutputerr();
-}
 
-void Q_vb(void) {
-  if (!adns__vbuf_append(&vb,"",1)) Tnomem();
-  Q_str(vb.buf);
-}
 
-static void Rvb(void) {
-  Q_vb();
-}
-  
-static void Rf(const char *fmt, ...) PRINTFFORMAT(1,2);
-static void Rf(const char *fmt, ...) {
-  va_list al;
 
-  va_start(al,fmt);
-  Tvbvf(fmt,al);
-  va_end(al);
-  Rvb();
-}
+m4_define(`hm_arg_timeval_out_abs', `')
+m4_define(`hm_arg_nullptr', `')
+m4_define(`hm_arg_fdset_io', `const fd_set *$1 $3')
+m4_define(`hm_arg_must', `')
+m4_define(`hm_arg_ign', `')
+m4_define(`hm_arg_fcntl_arg', `long arg')
+m4_define(`hm_arg_bytes_out', `$3 $4 $6')
+m4_define(`hm_arg_addr_out', `int $2 $3')
+
+
+m4_define(`hm_syscall', `void Q$1(hm_args_checkvoid(`$3'));')
+
+
 
-static void Rerrno(const char *call) {
-  int e;
 
-  e= errno;
-  Tvbf("%s ",call);
-  Tvberrno(e);
-  Rvb();
-  errno= e;
-}
 
 int Hgettimeofday(struct timeval *tv, struct timezone *tz) {
   int r;
@@ -241,3 +193,9 @@ int Hwrite(int fd, const void *buf, size_t len) {
   
   return r;
 }
+
+
+
+
+
+