summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/simple_sink.cc12
-rw-r--r--tests/test_graphviz_1.c6
2 files changed, 10 insertions, 8 deletions
diff --git a/tests/simple_sink.cc b/tests/simple_sink.cc
index d27fd18..045bbb9 100644
--- a/tests/simple_sink.cc
+++ b/tests/simple_sink.cc
@@ -2,7 +2,7 @@
#include "common/tools.hh"
#include <unistd.h>
-#include <sys/timeb.h>
+#include <sys/time.h>
namespace rtfl {
@@ -38,10 +38,12 @@ void SimpleSink::finish ()
long SimpleSink::getCurrentTime ()
{
- struct timeb t;
- if (ftime (&t) == -1)
- syserr ("ftime() failed");
- return t.time * 1000L + t.millitm;
+ struct timeval tv;
+
+ if (gettimeofday (&tv, NULL) != 0)
+ syserr ("gettimeofday() failed");
+
+ return tv.tv_sec * 1000L + tv.tv_usec / 1000L;
}
void SimpleSink::msg (const char *fmt, ...)
diff --git a/tests/test_graphviz_1.c b/tests/test_graphviz_1.c
index 9199b25..2e26c37 100644
--- a/tests/test_graphviz_1.c
+++ b/tests/test_graphviz_1.c
@@ -10,15 +10,15 @@ int main(int argc, char *argv[])
gvc = gvContext ();
graph = agopen ("graph", Agdirected, NULL);
- node1 = agnode(graph, "node1", TRUE);
+ node1 = agnode(graph, "node1", 1);
agsafeset (node1, "width", "1", "");
agsafeset (node1, "height", "1", "");
- node2 = agnode(graph, "node2", TRUE);
+ node2 = agnode(graph, "node2", 1);
agsafeset (node2, "width", "1", "");
agsafeset (node2, "height", "1", "");
- edge1 = agedge(graph, node1, node2, "edge1", TRUE);
+ edge1 = agedge(graph, node1, node2, "edge1", 1);
puts ("---------- initially ----------");
agwrite (graph, stdout);