From 502681ed560d053360bd470332dbf14a5ef78799 Mon Sep 17 00:00:00 2001 From: Pawel Piech Date: Wed, 28 May 2008 16:36:24 +0000 Subject: [PATCH] Committed an application for use in manual testing. --- tests/StressTests/.cproject | 934 ++++++++++++++++++++++++++ tests/StressTests/.project | 82 +++ tests/StressTests/src/StressTests.cpp | 97 +++ 3 files changed, 1113 insertions(+) create mode 100644 tests/StressTests/.cproject create mode 100644 tests/StressTests/.project create mode 100644 tests/StressTests/src/StressTests.cpp diff --git a/tests/StressTests/.cproject b/tests/StressTests/.cproject new file mode 100644 index 00000000000..b7ac45a4715 --- /dev/null +++ b/tests/StressTests/.cproject @@ -0,0 +1,934 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/StressTests/.project b/tests/StressTests/.project new file mode 100644 index 00000000000..90a5afd41cc --- /dev/null +++ b/tests/StressTests/.project @@ -0,0 +1,82 @@ + + + StressTests + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + ?name? + + + + org.eclipse.cdt.make.core.append_environment + true + + + org.eclipse.cdt.make.core.autoBuildTarget + all + + + org.eclipse.cdt.make.core.buildArguments + + + + org.eclipse.cdt.make.core.buildCommand + make + + + org.eclipse.cdt.make.core.buildLocation + ${workspace_loc:/StressTests/Debug} + + + org.eclipse.cdt.make.core.cleanBuildTarget + clean + + + org.eclipse.cdt.make.core.contents + org.eclipse.cdt.make.core.activeConfigSettings + + + org.eclipse.cdt.make.core.enableAutoBuild + false + + + org.eclipse.cdt.make.core.enableCleanBuild + true + + + org.eclipse.cdt.make.core.enableFullBuild + true + + + org.eclipse.cdt.make.core.fullBuildTarget + all + + + org.eclipse.cdt.make.core.stopOnError + true + + + org.eclipse.cdt.make.core.useDefaultBuildCmd + true + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + + diff --git a/tests/StressTests/src/StressTests.cpp b/tests/StressTests/src/StressTests.cpp new file mode 100644 index 00000000000..0e6eac62bf2 --- /dev/null +++ b/tests/StressTests/src/StressTests.cpp @@ -0,0 +1,97 @@ +/******************************************************************************* + * Copyright (c) 2008 Wind River Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ + +#include +using namespace std; + + +void step_loop() { + int i = 0; + while (i < 1000) { + i++; + i++; + i++; + i++; + i++; + i++; + i++; + i++; + i++; + i++; + i++; + i++; + i++; + } +} + +void descend_stack(int depth) { + if (depth == 0) { + step_loop(); + } else { + descend_stack(--depth); + } +} + +void variables() { + class bar { + public: + int d; + private: + int e[2]; + }; + + class bar2 { + public: + int f; + private: + int g[2]; + }; + + class foo: public bar, bar2 { + public: + int a[2]; + bar b; + private: + int c; + }; + + // Test children + foo f; + f.d = 1; + + int lIntVar = 12345; + double lDoubleVar = 12345.12345; + char lCharVar = 'm'; + bool lBoolVar = false; + + int lIntArray[2] = {6789, 12345}; + double lDoubleArray[2] = {456.789, 12345.12345}; + char lCharArray[2] = {'i', 'm'}; + bool lBoolArray[2] = {true, false}; + + int *lIntPtr = &lIntVar; + double *lDoublePtr = &lDoubleVar; + char *lCharPtr = &lCharVar; + + int *lIntPtr2 = (int*)0x1; + double *lDoublePtr2 = (double*)0x2345; + char *lCharPtr2 = (char*)0x1234; + bool *lBoolPtr2 = (bool*)0x123ABCDE; +} + + +int main() { + step_loop(); + descend_stack(50); + variables(); + return 0; +} +