summaryrefslogtreecommitdiff
path: root/client/test/util.h
diff options
context:
space:
mode:
authordeva <deva>2010-08-17 07:24:27 +0000
committerdeva <deva>2010-08-17 07:24:27 +0000
commit57c5ca5b7fc3db3ab16d9a1cf2760d114e5685ca (patch)
tree42a23e13f97b3d2d3eb65217312327a634608fad /client/test/util.h
parent16fa999ed01f3f98e42e2b1248c7021d75b3ef75 (diff)
More tests
Diffstat (limited to 'client/test/util.h')
-rw-r--r--client/test/util.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/client/test/util.h b/client/test/util.h
index abf7df5..03b3e8a 100644
--- a/client/test/util.h
+++ b/client/test/util.h
@@ -31,3 +31,16 @@ QDomElement getWidgetElement(QString type = "",
QCOMPARE(wdg.value(), QString("")); \
wdg.setValue("hello", "source"); \
QCOMPARE(wdg.value(), QString("hello"));
+
+#define TEST_MEMLEAK(C) { \
+ FILE *memlk_fp = fopen("/proc/self/statm", "r"); \
+ int memlk_before; \
+ int memlk_after; \
+ fscanf(memlk_fp, "%d", &memlk_before); \
+ { C; } \
+ rewind(memlk_fp); \
+ fscanf(memlk_fp, "%d", &memlk_after); \
+ fclose(memlk_fp); \
+ QCOMPARE(memlk_before, memlk_after); \
+ }
+