aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/fasta.cpp22
-rw-r--r--tests/runner.py8
2 files changed, 28 insertions, 2 deletions
diff --git a/tests/fasta.cpp b/tests/fasta.cpp
index 7954feef..35bd4425 100644
--- a/tests/fasta.cpp
+++ b/tests/fasta.cpp
@@ -7,6 +7,24 @@
#include <stdlib.h>
#include <string.h>
+// limit output, so we do not benchmark speed of printing
+void puts_limited(char *x)
+{
+ static int left = 550;
+ int len = strlen(x);
+ if (len <= left) {
+ puts(x);
+ left -= len;
+ return;
+ }
+ if (left > 0) {
+ x[left] = '\0';
+ puts(x);
+ x[left] = 'z';
+ left = 0;
+ }
+}
+
struct Random {
enum { IM = 139968, IA = 3877, IC = 29573 };
Random() : last(42) {}
@@ -68,7 +86,7 @@ struct LineBuffer {
lastN = N + 1;
return *this;
}
- void writeline() { puts(buffer); }
+ void writeline() { puts_limited(buffer); }
protected:
char buffer[lineLength + 2];
size_t lastN;
@@ -87,7 +105,7 @@ struct RotatingString {
memcpy(temp, buffer + pos, bytes);
temp[bytes] = '\n';
temp[bytes] = '\0';
- puts(temp);
+ puts_limited(temp);
delete temp;
pos += bytes;
if ( pos > size )
diff --git a/tests/runner.py b/tests/runner.py
index a7b7f0a5..9d3f4780 100644
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -2678,6 +2678,14 @@ else:
print 'Total stats:'
self.print_stats(total_times)
+ def zzztest_dlmalloc(self):
+ global COMPILER_TEST_OPTS; COMPILER_TEST_OPTS = ['-g']
+ global CORRECT_SIGNS; CORRECT_SIGNS = 2
+ global CORRECT_SIGNS_LINES; CORRECT_SIGNS_LINES = ['src.cpp:' + str(i) for i in [4816, 4191, 4246, 4199, 4205, 4235, 4227]]
+
+ src = open(path_from_root('tests', 'dlmalloc.c'), 'r').read()
+ self.do_test(src, '*1,0*', ['200'])
+
def test_primes(self):
src = '''
#include<stdio.h>