diff options
author | havardpe <havardpe@gmail.com> | 2016-06-20 17:47:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-20 17:47:06 +0200 |
commit | dd5de94a49973bd6a8aa45c3699fdb5f13efa468 (patch) | |
tree | 2113dafead1557a5fd85155826aa9d8f6c70516a | |
parent | 05325795c30b7cbc5b6fcd78fdea3e3418ae686c (diff) | |
parent | 607878358232f89d1b377aa03afb0e27649ff08a (diff) |
Merge pull request #121 from yahoo/geirst/remove-placement-delete-test
Remove test that verifies that gcc works as intended.
-rw-r--r-- | vespalib/CMakeLists.txt | 1 | ||||
-rw-r--r-- | vespalib/src/tests/placement-delete/.gitignore | 7 | ||||
-rw-r--r-- | vespalib/src/tests/placement-delete/CMakeLists.txt | 13 | ||||
-rw-r--r-- | vespalib/src/tests/placement-delete/DESC | 4 | ||||
-rw-r--r-- | vespalib/src/tests/placement-delete/FILES | 4 | ||||
-rw-r--r-- | vespalib/src/tests/placement-delete/fail.cpp | 2 | ||||
-rw-r--r-- | vespalib/src/tests/placement-delete/hello.cpp | 7 | ||||
-rw-r--r-- | vespalib/src/tests/placement-delete/placement-delete.cpp | 29 | ||||
-rw-r--r-- | vespalib/src/tests/placement-delete/undef.cpp | 34 |
9 files changed, 0 insertions, 101 deletions
diff --git a/vespalib/CMakeLists.txt b/vespalib/CMakeLists.txt index e4c9ab27225..4af66d89ed5 100644 --- a/vespalib/CMakeLists.txt +++ b/vespalib/CMakeLists.txt @@ -54,7 +54,6 @@ vespa_define_module( src/tests/net/socket src/tests/objects/nbostream src/tests/optimized - src/tests/placement-delete src/tests/printable src/tests/priority_queue src/tests/random diff --git a/vespalib/src/tests/placement-delete/.gitignore b/vespalib/src/tests/placement-delete/.gitignore deleted file mode 100644 index fbf1f708fc0..00000000000 --- a/vespalib/src/tests/placement-delete/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -.depend -Makefile -fail -hello -placement-delete_test -undef -vespalib_placement-delete_test_app diff --git a/vespalib/src/tests/placement-delete/CMakeLists.txt b/vespalib/src/tests/placement-delete/CMakeLists.txt deleted file mode 100644 index 74c4a431958..00000000000 --- a/vespalib/src/tests/placement-delete/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -vespa_add_executable(vespalib_placement-delete_test_app TEST - SOURCES - placement-delete.cpp - DEPENDS - vespalib -) - -vespa_add_test( - NAME vespalib_placement-delete_test_app - NO_VALGRIND COMMAND vespalib_placement-delete_test_app - ENVIRONMENT "CXX_PROG=g++" -) diff --git a/vespalib/src/tests/placement-delete/DESC b/vespalib/src/tests/placement-delete/DESC deleted file mode 100644 index 49ef1e5fb3c..00000000000 --- a/vespalib/src/tests/placement-delete/DESC +++ /dev/null @@ -1,4 +0,0 @@ -This test checks whether gcc generates code to invoke placement delete -when a templated placement new throws an exception. We expect this -test to fail until gcc has been fixed to handle templated placement -new correctly. diff --git a/vespalib/src/tests/placement-delete/FILES b/vespalib/src/tests/placement-delete/FILES deleted file mode 100644 index 6214cb9fb02..00000000000 --- a/vespalib/src/tests/placement-delete/FILES +++ /dev/null @@ -1,4 +0,0 @@ -placement-delete.cpp -hello.cpp -fail.cpp -undef.cpp diff --git a/vespalib/src/tests/placement-delete/fail.cpp b/vespalib/src/tests/placement-delete/fail.cpp deleted file mode 100644 index b6df97df6d4..00000000000 --- a/vespalib/src/tests/placement-delete/fail.cpp +++ /dev/null @@ -1,2 +0,0 @@ -// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -This should not compile with any version of gcc... diff --git a/vespalib/src/tests/placement-delete/hello.cpp b/vespalib/src/tests/placement-delete/hello.cpp deleted file mode 100644 index aeab3a27762..00000000000 --- a/vespalib/src/tests/placement-delete/hello.cpp +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <stdio.h> - -int main () { - fprintf(stdout, "Hello World!\n"); - return 0; -} diff --git a/vespalib/src/tests/placement-delete/placement-delete.cpp b/vespalib/src/tests/placement-delete/placement-delete.cpp deleted file mode 100644 index 0d1cb200110..00000000000 --- a/vespalib/src/tests/placement-delete/placement-delete.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/vespalib/testkit/test_kit.h> -#include <vespa/vespalib/util/slaveproc.h> -#include <vespa/vespalib/util/stringfmt.h> - -using namespace vespalib; - -bool checkCompile(const std::string &base) { - std::string out; - std::string gcc = getenv("CXX_PROG"); // TODO: override from environment - std::string cmd = make_string("%s -o %s %s.cpp 2>&1", gcc.c_str(), base.c_str(), base.c_str()); - bool ok = SlaveProc::run(cmd.c_str(), out); - fprintf(stderr, "CMD: %s\n(compile output follows...)\n%s\n", cmd.c_str(), out.c_str()); - return ok; -} - -TEST("require that valid test program can be compiled") { - EXPECT_EQUAL(checkCompile("hello"), true); -} - -TEST("require that bogus test program can not be compiled") { - EXPECT_EQUAL(checkCompile("fail"), false); -} - -TEST("require that templated placement delete is instantiated resulting in a compile error") { - EXPECT_EQUAL(checkCompile("undef"), false); -} - -TEST_MAIN_WITH_PROCESS_PROXY() { TEST_RUN_ALL(); } diff --git a/vespalib/src/tests/placement-delete/undef.cpp b/vespalib/src/tests/placement-delete/undef.cpp deleted file mode 100644 index c6ba20534f8..00000000000 --- a/vespalib/src/tests/placement-delete/undef.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -// This is a compile-time test which should fail because undef<T> -// cannot be instantiated - -#include <stdlib.h> - -template <class T> class undef; - -struct A { - A() { throw 1; } -}; - -template<typename T> class Pool { }; - -template<typename T> -inline void *operator new(size_t size,Pool<T>& pool) -{ - return malloc(size); -} - -template<typename T> -inline void operator delete(void *p,Pool<T>& pool) -{ - undef<T> t; - free(p); -} - -int main () -{ - Pool<int> pool; - new (pool) A(); - return 0; -} |