Make it possible to compile with gcc4.6
diff --git a/test/build/c++11.cc b/test/build/c++11.cc
new file mode 100644
index 0000000..519395f
--- /dev/null
+++ b/test/build/c++11.cc
@@ -0,0 +1,52 @@
+/*
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+/* This is just a compilation test, to see if we have zlib installed. */
+
+#include <stdlib.h>
+#include <zlib.h>
+
+class Base {
+ public:
+  virtual void foo() = 0;
+};
+
+class Foo final : public Base {
+ public:
+  void foo() override {}
+};
+
+int main() {
+  Foo().foo();
+  return 0;
+}
diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc
index 9e25a53..5a2762d 100644
--- a/test/cpp/end2end/async_end2end_test.cc
+++ b/test/cpp/end2end/async_end2end_test.cc
@@ -81,7 +81,7 @@
  protected:
   AsyncEnd2endTest() : service_(&srv_cq_) {}
 
-  void SetUp() override {
+  void SetUp() GRPC_OVERRIDE {
     int port = grpc_pick_unused_port_or_die();
     server_address_ << "localhost:" << port;
     // Setup server
@@ -91,7 +91,7 @@
     server_ = builder.BuildAndStart();
   }
 
-  void TearDown() override {
+  void TearDown() GRPC_OVERRIDE {
     server_->Shutdown();
     void* ignored_tag;
     bool ignored_ok;
diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc
index 45f12a9..1d5dfc4 100644
--- a/test/cpp/end2end/end2end_test.cc
+++ b/test/cpp/end2end/end2end_test.cc
@@ -83,7 +83,7 @@
 class TestServiceImpl : public ::grpc::cpp::test::util::TestService::Service {
  public:
   Status Echo(ServerContext* context, const EchoRequest* request,
-              EchoResponse* response) override {
+              EchoResponse* response) GRPC_OVERRIDE {
     response->set_message(request->message());
     MaybeEchoDeadline(context, request, response);
     return Status::OK;
@@ -93,7 +93,7 @@
 
   Status RequestStream(ServerContext* context,
                        ServerReader<EchoRequest>* reader,
-                       EchoResponse* response) override {
+                       EchoResponse* response) GRPC_OVERRIDE {
     EchoRequest request;
     response->set_message("");
     while (reader->Read(&request)) {
@@ -105,7 +105,7 @@
   // Return 3 messages.
   // TODO(yangg) make it generic by adding a parameter into EchoRequest
   Status ResponseStream(ServerContext* context, const EchoRequest* request,
-                        ServerWriter<EchoResponse>* writer) override {
+                        ServerWriter<EchoResponse>* writer) GRPC_OVERRIDE {
     EchoResponse response;
     response.set_message(request->message() + "0");
     writer->Write(response);
@@ -117,9 +117,9 @@
     return Status::OK;
   }
 
-  Status BidiStream(
-      ServerContext* context,
-      ServerReaderWriter<EchoResponse, EchoRequest>* stream) override {
+  Status BidiStream(ServerContext* context,
+                    ServerReaderWriter<EchoResponse, EchoRequest>* stream)
+      GRPC_OVERRIDE {
     EchoRequest request;
     EchoResponse response;
     while (stream->Read(&request)) {
@@ -135,7 +135,7 @@
     : public ::grpc::cpp::test::util::duplicate::TestService::Service {
  public:
   Status Echo(ServerContext* context, const EchoRequest* request,
-              EchoResponse* response) override {
+              EchoResponse* response) GRPC_OVERRIDE {
     response->set_message("no package");
     return Status::OK;
   }
@@ -145,7 +145,7 @@
  protected:
   End2endTest() : thread_pool_(2) {}
 
-  void SetUp() override {
+  void SetUp() GRPC_OVERRIDE {
     int port = grpc_pick_unused_port_or_die();
     server_address_ << "localhost:" << port;
     // Setup server
@@ -157,7 +157,7 @@
     server_ = builder.BuildAndStart();
   }
 
-  void TearDown() override { server_->Shutdown(); }
+  void TearDown() GRPC_OVERRIDE { server_->Shutdown(); }
 
   void ResetStub() {
     std::shared_ptr<ChannelInterface> channel =
diff --git a/test/cpp/interop/client.cc b/test/cpp/interop/client.cc
index acfaa87..f7537c2 100644
--- a/test/cpp/interop/client.cc
+++ b/test/cpp/interop/client.cc
@@ -38,6 +38,8 @@
 #include <string>
 #include <thread>
 
+#include <unistd.h>
+
 #include <grpc/grpc.h>
 #include <grpc/support/log.h>
 #include <gflags/gflags.h>
@@ -313,8 +315,7 @@
     GPR_ASSERT(response.payload().body() ==
                grpc::string(kResponseMessageSize, '\0'));
     gpr_log(GPR_INFO, "received message %d", i);
-    std::this_thread::sleep_for(
-        std::chrono::milliseconds(kReceiveDelayMilliSeconds));
+    usleep(kReceiveDelayMilliSeconds * 1000);
     ++i;
   }
   GPR_ASSERT(kNumResponseMessages == i);
diff --git a/test/cpp/interop/server.cc b/test/cpp/interop/server.cc
index 263bd8e..9810ff6 100644
--- a/test/cpp/interop/server.cc
+++ b/test/cpp/interop/server.cc
@@ -36,6 +36,7 @@
 #include <thread>
 
 #include <signal.h>
+#include <unistd.h>
 
 #include <gflags/gflags.h>
 #include <grpc/grpc.h>
@@ -222,7 +223,7 @@
   std::unique_ptr<Server> server(builder.BuildAndStart());
   gpr_log(GPR_INFO, "Server listening on %s", server_address.str().c_str());
   while (!got_sigint) {
-    std::this_thread::sleep_for(std::chrono::seconds(5));
+    sleep(5);
   }
 }
 
diff --git a/test/cpp/qps/server.cc b/test/cpp/qps/server.cc
index 8e13634..be27c12 100644
--- a/test/cpp/qps/server.cc
+++ b/test/cpp/qps/server.cc
@@ -36,6 +36,8 @@
 #include <sys/signal.h>
 #include <thread>
 
+#include <unistd.h>
+
 #include <gflags/gflags.h>
 #include <grpc/support/alloc.h>
 #include <grpc/support/host_port.h>
@@ -97,7 +99,7 @@
 
 namespace {
 
-class TestServiceImpl final : public TestService::Service {
+class TestServiceImpl GRPC_FINAL : public TestService::Service {
  public:
   Status CollectServerStats(ServerContext* context, const StatsRequest*,
                             ServerStats* response) {
@@ -146,7 +148,7 @@
   grpc_profiler_start("qps_server.prof");
 
   while (!got_sigint) {
-    std::this_thread::sleep_for(std::chrono::seconds(5));
+    sleep(5);
   }
 
   grpc_profiler_stop();