aboutsummaryrefslogtreecommitdiff
path: root/tests/install_component_swap_optimization.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/install_component_swap_optimization.cpp')
-rw-r--r--tests/install_component_swap_optimization.cpp58
1 files changed, 0 insertions, 58 deletions
diff --git a/tests/install_component_swap_optimization.cpp b/tests/install_component_swap_optimization.cpp
deleted file mode 100644
index 7faece9..0000000
--- a/tests/install_component_swap_optimization.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright 2014 Google Inc. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "test_common.h"
-
-using namespace std;
-
-fruit::Component<int, float, double, unsigned> getParentComponent() {
- static int x = 0;
- static float y = 0;
- static double z = 0;
- static unsigned u = 0;
- return fruit::createComponent()
- .bindInstance(x)
- .bindInstance(y)
- .bindInstance(z)
- .bindInstance(u);
-}
-
-fruit::Component<vector<int>, vector<float>, vector<double>, vector<unsigned>> getParentComponent2() {
- static vector<int> x;
- static vector<float> y;
- static vector<double> z;
- static vector<unsigned> u;
- return fruit::createComponent()
- .bindInstance(x)
- .bindInstance(y)
- .bindInstance(z)
- .bindInstance(u)
- .addInstanceMultibinding(x);
-}
-
-fruit::Component<int, float, double, unsigned> getComponent() {
- return fruit::createComponent()
- .install(getParentComponent())
- .install(getParentComponent2());
-}
-
-int main() {
- fruit::Injector<int, float, double, unsigned> injector(getComponent());
-
- injector.get<int>();
-
- return 0;
-}