jeyzu pushed a commit to branch master.
commit 88cf0cf460e35902f26c11c4229934559c9a8ecb
Author: Jérémy Zurcher <[email protected]>
Date: Fri May 3 21:10:50 2013 +0200
eo suite: add ptr indirection coverage test
---
src/Makefile_Eo.am | 1 +
src/tests/eo/suite/eo_suite.c | 1 +
src/tests/eo/suite/eo_suite.h | 1 +
src/tests/eo/suite/eo_test_ptr_indirection.c | 34 ++++++++++++++++++++++++++++
4 files changed, 37 insertions(+)
diff --git a/src/Makefile_Eo.am b/src/Makefile_Eo.am
index e955632..3c1b5d3 100644
--- a/src/Makefile_Eo.am
+++ b/src/Makefile_Eo.am
@@ -85,6 +85,7 @@ tests/eo/suite/eo_suite.h \
tests/eo/suite/eo_test_class_errors.c \
tests/eo/suite/eo_test_general.c \
tests/eo/suite/eo_test_value.c \
+tests/eo/suite/eo_test_ptr_indirection.c \
tests/eo/suite/eo_test_init.c
tests_eo_eo_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/eo\" \
diff --git a/src/tests/eo/suite/eo_suite.c b/src/tests/eo/suite/eo_suite.c
index 9d040d3..a9b8b64 100644
--- a/src/tests/eo/suite/eo_suite.c
+++ b/src/tests/eo/suite/eo_suite.c
@@ -21,6 +21,7 @@ static const Eo_Test_Case etc[] = {
{ "Eo general", eo_test_general },
{ "Eo class errors", eo_test_class_errors },
{ "Eo eina value", eo_test_value },
+ { "Eo pointer indirection", eo_test_ptr_ind },
{ NULL, NULL }
};
diff --git a/src/tests/eo/suite/eo_suite.h b/src/tests/eo/suite/eo_suite.h
index c26db96..5c37e9f 100644
--- a/src/tests/eo/suite/eo_suite.h
+++ b/src/tests/eo/suite/eo_suite.h
@@ -7,5 +7,6 @@ void eo_test_init(TCase *tc);
void eo_test_general(TCase *tc);
void eo_test_class_errors(TCase *tc);
void eo_test_value(TCase *tc);
+void eo_test_ptr_ind(TCase *tc);
#endif /* _EO_SUITE_H */
diff --git a/src/tests/eo/suite/eo_test_ptr_indirection.c
b/src/tests/eo/suite/eo_test_ptr_indirection.c
new file mode 100644
index 0000000..eb4da35
--- /dev/null
+++ b/src/tests/eo/suite/eo_test_ptr_indirection.c
@@ -0,0 +1,34 @@
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "Eo.h"
+#include "eo_suite.h"
+#include "eo_test_class_simple.h"
+
+START_TEST(eo_ptr_ind)
+{
+ int i;
+ int request = 100000;
+
+ eo_init();
+
+ Eo **objs = calloc(request, sizeof(Eo *));
+
+ for (i = 0 ; i < request ; i++)
+ objs[i] = eo_add(SIMPLE_CLASS, NULL);
+
+ for (i = 0 ; i < request; i++)
+ eo_unref(objs[i]);
+ eo_unref(objs[0]);
+
+ free(objs);
+
+ eo_shutdown();
+}
+END_TEST
+
+void eo_test_ptr_ind(TCase *tc)
+{
+ tcase_add_test(tc, eo_ptr_ind);
+}
--
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2