Mercurial > hg > sv-dependency-builds
comparison win32-mingw/include/capnp/test-util.h @ 149:279b18cc7785
Update Win32 capnp builds to v0.6
author | Chris Cannam <cannam@all-day-breakfast.com> |
---|---|
date | Tue, 23 May 2017 09:16:54 +0100 |
parents | 38d1c0e7850b |
children |
comparison
equal
deleted
inserted
replaced
148:b4bfdf10c4b3 | 149:279b18cc7785 |
---|---|
33 | 33 |
34 #if !CAPNP_LITE | 34 #if !CAPNP_LITE |
35 #include "dynamic.h" | 35 #include "dynamic.h" |
36 #endif // !CAPNP_LITE | 36 #endif // !CAPNP_LITE |
37 | 37 |
38 #if KJ_NO_EXCEPTIONS | |
39 #undef EXPECT_ANY_THROW | |
40 #define EXPECT_ANY_THROW(code) EXPECT_DEATH(code, ".") | |
41 #endif | |
42 | |
43 #define EXPECT_NONFATAL_FAILURE(code) \ | |
44 EXPECT_TRUE(kj::runCatchingExceptions([&]() { code; }) != nullptr); | |
45 | |
46 #ifdef KJ_DEBUG | |
47 #define EXPECT_DEBUG_ANY_THROW EXPECT_ANY_THROW | |
48 #else | |
49 #define EXPECT_DEBUG_ANY_THROW(EXP) | |
50 #endif | |
51 | |
52 // TODO(cleanup): Auto-generate stringification functions for union discriminants. | 38 // TODO(cleanup): Auto-generate stringification functions for union discriminants. |
53 namespace capnproto_test { | 39 namespace capnproto_test { |
54 namespace capnp { | 40 namespace capnp { |
55 namespace test { | 41 namespace test { |
56 inline kj::String KJ_STRINGIFY(TestUnion::Union0::Which which) { | 42 inline kj::String KJ_STRINGIFY(TestUnion::Union0::Which which) { |
225 class TestPipelineImpl final: public test::TestPipeline::Server { | 211 class TestPipelineImpl final: public test::TestPipeline::Server { |
226 public: | 212 public: |
227 TestPipelineImpl(int& callCount); | 213 TestPipelineImpl(int& callCount); |
228 | 214 |
229 kj::Promise<void> getCap(GetCapContext context) override; | 215 kj::Promise<void> getCap(GetCapContext context) override; |
216 kj::Promise<void> getAnyCap(GetAnyCapContext context) override; | |
230 | 217 |
231 private: | 218 private: |
232 int& callCount; | 219 int& callCount; |
233 }; | 220 }; |
234 | 221 |
283 kj::Promise<void> expectCancel(ExpectCancelContext context) override; | 270 kj::Promise<void> expectCancel(ExpectCancelContext context) override; |
284 | 271 |
285 kj::Promise<void> getHandle(GetHandleContext context) override; | 272 kj::Promise<void> getHandle(GetHandleContext context) override; |
286 | 273 |
287 kj::Promise<void> getNull(GetNullContext context) override; | 274 kj::Promise<void> getNull(GetNullContext context) override; |
275 | |
276 kj::Promise<void> getEnormousString(GetEnormousStringContext context) override; | |
288 | 277 |
289 private: | 278 private: |
290 int& callCount; | 279 int& callCount; |
291 int& handleCount; | 280 int& handleCount; |
292 test::TestInterface::Client clientToHold = nullptr; | 281 test::TestInterface::Client clientToHold = nullptr; |