summaryrefslogtreecommitdiffstats
path: root/cpp/sca/kernel/kernel-test.cpp
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2009-10-03 21:50:33 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2009-10-03 21:50:33 +0000
commitb2b06bd2780dc40f666201d095c388313364b37a (patch)
tree1186e75dd637a02e567f91a1c5d7014a2bca7a95 /cpp/sca/kernel/kernel-test.cpp
parent95cb8fb517576b3357ecdf27a30c29b1365c5cf5 (diff)
Refactored store tests and moved them under test/. Simplified the script evaluation logic a little, added an apply procedure and support for variable lists of args. Added a test case that assembles the store app using a script.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@821425 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--cpp/sca/kernel/kernel-test.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/cpp/sca/kernel/kernel-test.cpp b/cpp/sca/kernel/kernel-test.cpp
index 3e2793f070..02bb63c928 100644
--- a/cpp/sca/kernel/kernel-test.cpp
+++ b/cpp/sca/kernel/kernel-test.cpp
@@ -105,9 +105,9 @@ bool testCons() {
return true;
}
-bool testlistGC() {
+bool testListGC() {
resetLambdaCounters();
- resetlistCounters();
+ resetListCounters();
countElements = 0;
testCons();
assert(countLambdas == 0);
@@ -227,13 +227,13 @@ double testSeqReduce(double v, double accum) {
}
bool testSeq() {
- //resetLambdaCounters();
- //resetlistCounters();
+ resetLambdaCounters();
+ resetListCounters();
list<double> s = seq(0.0, 1000.0);
assert(1001 == length(s));
- //printLambdaCounters();
- //printlistCounters();
+ printLambdaCounters();
+ printListCounters();
assert(1001 == length(map(lambda<double(double)>(testSeqMap), s)));
@@ -241,8 +241,8 @@ bool testSeq() {
assert(201 == length(member(200.0, reverse(s))));
assert(1001 == reduce(lambda<double(double, double)>(testSeqReduce), 0.0, s));
- //printLambdaCounters();
- //printlistCounters();
+ printLambdaCounters();
+ printListCounters();
return true;
}
@@ -262,9 +262,9 @@ bool testValue() {
}
bool testValueGC() {
- resetValueCounters();
resetLambdaCounters();
- resetlistCounters();
+ resetListCounters();
+ resetValueCounters();
testValue();
assert(countValues == 0);
assert(countLambdas == 0);
@@ -292,7 +292,7 @@ bool testCppPerf() {
assert(1000 == length(r));
gettimeofday(&end, NULL);
- long t = (end.tv_sec * 1000 + end.tv_usec / 1000) - (start.tv_sec * 1000 + start.tv_usec / 1000);
+ //long t = (end.tv_sec * 1000 + end.tv_usec / 1000) - (start.tv_sec * 1000 + start.tv_usec / 1000);
//std::cout << "Fib cpp perf test " << t << " ms" << std::endl;
return true;
}
@@ -305,7 +305,7 @@ bool testAtomicPerf() {
for(int i = 0; i < 10000000;)
i = i + 1;
gettimeofday(&end, NULL);
- long t = (end.tv_sec * 1000 + end.tv_usec / 1000) - (start.tv_sec * 1000 + start.tv_usec / 1000);
+ //long t = (end.tv_sec * 1000 + end.tv_usec / 1000) - (start.tv_sec * 1000 + start.tv_usec / 1000);
//std::cout << "Loop test " << t << " ms" << std::endl;
}
{
@@ -313,7 +313,7 @@ bool testAtomicPerf() {
for(int i = 0; i < 10000000;)
__sync_add_and_fetch(&i, 1);
gettimeofday(&end, NULL);
- long t = (end.tv_sec * 1000 + end.tv_usec / 1000) - (start.tv_sec * 1000 + start.tv_usec / 1000);
+ //long t = (end.tv_sec * 1000 + end.tv_usec / 1000) - (start.tv_sec * 1000 + start.tv_usec / 1000);
//std::cout << "Loop atomic test " << t << " ms" << std::endl;
}
{
@@ -327,7 +327,7 @@ bool testAtomicPerf() {
}
gettimeofday(&end, NULL);
pthread_mutex_destroy(&mutex);
- long t = (end.tv_sec * 1000 + end.tv_usec / 1000) - (start.tv_sec * 1000 + start.tv_usec / 1000);
+ //long t = (end.tv_sec * 1000 + end.tv_usec / 1000) - (start.tv_sec * 1000 + start.tv_usec / 1000);
//std::cout << "Loop mutex test " << t << " ms" << std::endl;
}
return true;
@@ -418,7 +418,7 @@ int main() {
tuscany::testFunction();
tuscany::testFunctionGC();
tuscany::testCons();
- tuscany::testlistGC();
+ tuscany::testListGC();
tuscany::testOut();
tuscany::testEquals();
tuscany::testLength();