| OLD | NEW |
| 1 // Protocol Buffers - Google's data interchange format | 1 // Protocol Buffers - Google's data interchange format |
| 2 // Copyright 2008 Google Inc. All rights reserved. | 2 // Copyright 2008 Google Inc. All rights reserved. |
| 3 // https://developers.google.com/protocol-buffers/ | 3 // https://developers.google.com/protocol-buffers/ |
| 4 // | 4 // |
| 5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
| 6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
| 7 // met: | 7 // met: |
| 8 // | 8 // |
| 9 // * Redistributions of source code must retain the above copyright | 9 // * Redistributions of source code must retain the above copyright |
| 10 // notice, this list of conditions and the following disclaimer. | 10 // notice, this list of conditions and the following disclaimer. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 #include <google/protobuf/stubs/casts.h> | 34 #include <google/protobuf/stubs/casts.h> |
| 35 #include <google/protobuf/stubs/common.h> | 35 #include <google/protobuf/stubs/common.h> |
| 36 #include <google/protobuf/stubs/strutil.h> | 36 #include <google/protobuf/stubs/strutil.h> |
| 37 #include <google/protobuf/stubs/substitute.h> | 37 #include <google/protobuf/stubs/substitute.h> |
| 38 | 38 |
| 39 #include <google/protobuf/testing/googletest.h> | 39 #include <google/protobuf/testing/googletest.h> |
| 40 #include <gtest/gtest.h> | 40 #include <gtest/gtest.h> |
| 41 | 41 |
| 42 namespace google { | 42 namespace google { |
| 43 namespace protobuf { | 43 namespace protobuf { |
| 44 using internal::NewCallback; | |
| 45 using internal::NewPermanentCallback; | |
| 46 namespace { | 44 namespace { |
| 47 | 45 |
| 48 // TODO(kenton): More tests. | 46 // TODO(kenton): More tests. |
| 49 | 47 |
| 50 #ifdef PACKAGE_VERSION // only defined when using automake, not MSVC | 48 #ifdef PACKAGE_VERSION // only defined when using automake, not MSVC |
| 51 | 49 |
| 52 TEST(VersionTest, VersionMatchesConfig) { | 50 TEST(VersionTest, VersionMatchesConfig) { |
| 53 // Verify that the version string specified in config.h matches the one | 51 // Verify that the version string specified in config.h matches the one |
| 54 // in common.h. The config.h version is a string which may have a suffix | 52 // in common.h. The config.h version is a string which may have a suffix |
| 55 // like "beta" or "rc1", so we remove that. | 53 // like "beta" or "rc1", so we remove that. |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 | 347 |
| 350 TEST_F(ClosureTest, TestPermanentClosureDeleteInCallback) { | 348 TEST_F(ClosureTest, TestPermanentClosureDeleteInCallback) { |
| 351 permanent_closure_ = NewPermanentCallback((ClosureTest*) this, | 349 permanent_closure_ = NewPermanentCallback((ClosureTest*) this, |
| 352 &ClosureTest::DeleteClosureInCallback); | 350 &ClosureTest::DeleteClosureInCallback); |
| 353 permanent_closure_->Run(); | 351 permanent_closure_->Run(); |
| 354 } | 352 } |
| 355 | 353 |
| 356 } // anonymous namespace | 354 } // anonymous namespace |
| 357 } // namespace protobuf | 355 } // namespace protobuf |
| 358 } // namespace google | 356 } // namespace google |
| OLD | NEW |