Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
73a01874
Commit
73a01874
authored
Sep 19, 2017
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eliminate deprecation warnings from testing our own deprecated interfaces.
parent
715e6b6b
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
37 additions
and
15 deletions
+37
-15
common.h
c++/src/capnp/common.h
+6
-0
ez-rpc-test.c++
c++/src/capnp/ez-rpc-test.c++
+2
-0
ez-rpc.h
c++/src/capnp/ez-rpc.h
+7
-7
rpc-test.c++
c++/src/capnp/rpc-test.c++
+2
-0
rpc-twoparty-test.c++
c++/src/capnp/rpc-twoparty-test.c++
+2
-0
rpc.h
c++/src/capnp/rpc.h
+3
-4
schema-loader-test.c++
c++/src/capnp/schema-loader-test.c++
+2
-0
schema-parser-test.c++
c++/src/capnp/schema-parser-test.c++
+2
-0
schema-test.c++
c++/src/capnp/schema-test.c++
+2
-0
schema.h
c++/src/capnp/schema.h
+2
-2
common.h
c++/src/kj/common.h
+5
-0
http.c++
c++/src/kj/compat/http.c++
+1
-1
mutex-test.c++
c++/src/kj/mutex-test.c++
+1
-1
No files found.
c++/src/capnp/common.h
View file @
73a01874
...
@@ -51,6 +51,12 @@ namespace capnp {
...
@@ -51,6 +51,12 @@ namespace capnp {
#define CAPNP_LITE 0
#define CAPNP_LITE 0
#endif
#endif
#if CAPNP_TESTING_CAPNP // defined in Cap'n Proto's own unit tests; others should not define this
#define CAPNP_DEPRECATED(reason)
#else
#define CAPNP_DEPRECATED KJ_DEPRECATED
#endif
typedef
unsigned
int
uint
;
typedef
unsigned
int
uint
;
struct
Void
{
struct
Void
{
...
...
c++/src/capnp/ez-rpc-test.c++
View file @
73a01874
...
@@ -19,6 +19,8 @@
...
@@ -19,6 +19,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// THE SOFTWARE.
#define CAPNP_TESTING_CAPNP 1
#include "ez-rpc.h"
#include "ez-rpc.h"
#include "test-util.h"
#include "test-util.h"
#include <kj/compat/gtest.h>
#include <kj/compat/gtest.h>
...
...
c++/src/capnp/ez-rpc.h
View file @
73a01874
...
@@ -130,10 +130,10 @@ public:
...
@@ -130,10 +130,10 @@ public:
// Get the server's main (aka "bootstrap") interface.
// Get the server's main (aka "bootstrap") interface.
template
<
typename
Type
>
template
<
typename
Type
>
typename
Type
::
Client
importCap
(
kj
::
StringPtr
name
)
typename
Type
::
Client
importCap
(
kj
::
StringPtr
name
)
CAPNP_DEPRECATED
(
KJ_DEPRECATED
(
"Change your server to export a main interface, then use getMain() instead."
);
"Change your server to export a main interface, then use getMain() instead."
);
Capability
::
Client
importCap
(
kj
::
StringPtr
name
)
Capability
::
Client
importCap
(
kj
::
StringPtr
name
)
CAPNP_DEPRECATED
(
KJ_DEPRECATED
(
"Change your server to export a main interface, then use getMain() instead."
);
"Change your server to export a main interface, then use getMain() instead."
);
// ** DEPRECATED **
// ** DEPRECATED **
//
//
// Ask the sever for the capability with the given name. You may specify a type to automatically
// Ask the sever for the capability with the given name. You may specify a type to automatically
...
@@ -198,12 +198,12 @@ public:
...
@@ -198,12 +198,12 @@ public:
explicit
EzRpcServer
(
kj
::
StringPtr
bindAddress
,
uint
defaultPort
=
0
,
explicit
EzRpcServer
(
kj
::
StringPtr
bindAddress
,
uint
defaultPort
=
0
,
ReaderOptions
readerOpts
=
ReaderOptions
())
ReaderOptions
readerOpts
=
ReaderOptions
())
KJ
_DEPRECATED
(
"Please specify a main interface for your server."
);
CAPNP
_DEPRECATED
(
"Please specify a main interface for your server."
);
EzRpcServer
(
struct
sockaddr
*
bindAddress
,
uint
addrSize
,
EzRpcServer
(
struct
sockaddr
*
bindAddress
,
uint
addrSize
,
ReaderOptions
readerOpts
=
ReaderOptions
())
ReaderOptions
readerOpts
=
ReaderOptions
())
KJ
_DEPRECATED
(
"Please specify a main interface for your server."
);
CAPNP
_DEPRECATED
(
"Please specify a main interface for your server."
);
EzRpcServer
(
int
socketFd
,
uint
port
,
ReaderOptions
readerOpts
=
ReaderOptions
())
EzRpcServer
(
int
socketFd
,
uint
port
,
ReaderOptions
readerOpts
=
ReaderOptions
())
KJ
_DEPRECATED
(
"Please specify a main interface for your server."
);
CAPNP
_DEPRECATED
(
"Please specify a main interface for your server."
);
~
EzRpcServer
()
noexcept
(
false
);
~
EzRpcServer
()
noexcept
(
false
);
...
...
c++/src/capnp/rpc-test.c++
View file @
73a01874
...
@@ -19,6 +19,8 @@
...
@@ -19,6 +19,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// THE SOFTWARE.
#define CAPNP_TESTING_CAPNP 1
#include "rpc.h"
#include "rpc.h"
#include "test-util.h"
#include "test-util.h"
#include "schema.h"
#include "schema.h"
...
...
c++/src/capnp/rpc-twoparty-test.c++
View file @
73a01874
...
@@ -19,6 +19,8 @@
...
@@ -19,6 +19,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// THE SOFTWARE.
#define CAPNP_TESTING_CAPNP 1
#include "rpc-twoparty.h"
#include "rpc-twoparty.h"
#include "test-util.h"
#include "test-util.h"
#include <capnp/rpc.capnp.h>
#include <capnp/rpc.capnp.h>
...
...
c++/src/capnp/rpc.h
View file @
73a01874
...
@@ -99,7 +99,7 @@ public:
...
@@ -99,7 +99,7 @@ public:
// Connect to the given vat and return its bootstrap interface.
// Connect to the given vat and return its bootstrap interface.
Capability
::
Client
restore
(
typename
VatId
::
Reader
hostId
,
AnyPointer
::
Reader
objectId
)
Capability
::
Client
restore
(
typename
VatId
::
Reader
hostId
,
AnyPointer
::
Reader
objectId
)
KJ
_DEPRECATED
(
"Please transition to using a bootstrap interface instead."
);
CAPNP
_DEPRECATED
(
"Please transition to using a bootstrap interface instead."
);
// ** DEPRECATED **
// ** DEPRECATED **
//
//
// Restores the given SturdyRef from the network and return the capability representing it.
// Restores the given SturdyRef from the network and return the capability representing it.
...
@@ -196,7 +196,7 @@ template <typename VatId, typename LocalSturdyRefObjectId,
...
@@ -196,7 +196,7 @@ template <typename VatId, typename LocalSturdyRefObjectId,
RpcSystem
<
VatId
>
makeRpcServer
(
RpcSystem
<
VatId
>
makeRpcServer
(
VatNetwork
<
VatId
,
ProvisionId
,
RecipientId
,
ThirdPartyCapId
,
JoinResult
>&
network
,
VatNetwork
<
VatId
,
ProvisionId
,
RecipientId
,
ThirdPartyCapId
,
JoinResult
>&
network
,
SturdyRefRestorer
<
LocalSturdyRefObjectId
>&
restorer
)
SturdyRefRestorer
<
LocalSturdyRefObjectId
>&
restorer
)
KJ
_DEPRECATED
(
"Please transition to using a bootstrap interface instead."
);
CAPNP
_DEPRECATED
(
"Please transition to using a bootstrap interface instead."
);
// ** DEPRECATED **
// ** DEPRECATED **
//
//
// Create an RPC server which exports multiple main interfaces by object ID. The `restorer` object
// Create an RPC server which exports multiple main interfaces by object ID. The `restorer` object
...
@@ -254,8 +254,7 @@ class SturdyRefRestorer: public _::SturdyRefRestorerBase {
...
@@ -254,8 +254,7 @@ class SturdyRefRestorer: public _::SturdyRefRestorerBase {
// string names.
// string names.
public
:
public
:
virtual
Capability
::
Client
restore
(
typename
SturdyRefObjectId
::
Reader
ref
)
virtual
Capability
::
Client
restore
(
typename
SturdyRefObjectId
::
Reader
ref
)
CAPNP_DEPRECATED
(
KJ_DEPRECATED
(
"Please transition to using bootstrap interfaces instead of SturdyRefRestorer."
)
=
0
;
"Please transition to using bootstrap interfaces instead of SturdyRefRestorer."
)
=
0
;
// Restore the given object, returning a capability representing it.
// Restore the given object, returning a capability representing it.
...
...
c++/src/capnp/schema-loader-test.c++
View file @
73a01874
...
@@ -19,6 +19,8 @@
...
@@ -19,6 +19,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// THE SOFTWARE.
#define CAPNP_TESTING_CAPNP 1
#include "schema-loader.h"
#include "schema-loader.h"
#include <kj/compat/gtest.h>
#include <kj/compat/gtest.h>
#include "test-util.h"
#include "test-util.h"
...
...
c++/src/capnp/schema-parser-test.c++
View file @
73a01874
...
@@ -19,6 +19,8 @@
...
@@ -19,6 +19,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// THE SOFTWARE.
#define CAPNP_TESTING_CAPNP 1
#include "schema-parser.h"
#include "schema-parser.h"
#include <kj/compat/gtest.h>
#include <kj/compat/gtest.h>
#include "test-util.h"
#include "test-util.h"
...
...
c++/src/capnp/schema-test.c++
View file @
73a01874
...
@@ -19,6 +19,8 @@
...
@@ -19,6 +19,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// THE SOFTWARE.
#define CAPNP_TESTING_CAPNP 1
#include "schema.h"
#include "schema.h"
#include <kj/compat/gtest.h>
#include <kj/compat/gtest.h>
#include "test-util.h"
#include "test-util.h"
...
...
c++/src/capnp/schema.h
View file @
73a01874
...
@@ -82,7 +82,7 @@ public:
...
@@ -82,7 +82,7 @@ public:
// Get the encoded schema node content as a single message segment. It is safe to read as an
// Get the encoded schema node content as a single message segment. It is safe to read as an
// unchecked message.
// unchecked message.
Schema
getDependency
(
uint64_t
id
)
const
KJ
_DEPRECATED
(
"Does not handle generics correctly."
);
Schema
getDependency
(
uint64_t
id
)
const
CAPNP
_DEPRECATED
(
"Does not handle generics correctly."
);
// DEPRECATED: This method cannot correctly account for generic type parameter bindings that
// DEPRECATED: This method cannot correctly account for generic type parameter bindings that
// may apply to the dependency. Instead of using this method, use a method of the Schema API
// may apply to the dependency. Instead of using this method, use a method of the Schema API
// that corresponds to the exact kind of dependency. For example, to get a field type, use
// that corresponds to the exact kind of dependency. For example, to get a field type, use
...
@@ -706,7 +706,7 @@ public:
...
@@ -706,7 +706,7 @@ public:
// Construct the schema for a list of the given type.
// Construct the schema for a list of the given type.
static
ListSchema
of
(
schema
::
Type
::
Reader
elementType
,
Schema
context
)
static
ListSchema
of
(
schema
::
Type
::
Reader
elementType
,
Schema
context
)
KJ
_DEPRECATED
(
"Does not handle generics correctly."
);
CAPNP
_DEPRECATED
(
"Does not handle generics correctly."
);
// DEPRECATED: This method cannot correctly account for generic type parameter bindings that
// DEPRECATED: This method cannot correctly account for generic type parameter bindings that
// may apply to the input type. Instead of using this method, use a method of the Schema API
// may apply to the input type. Instead of using this method, use a method of the Schema API
// that corresponds to the exact kind of dependency. For example, to get a field type, use
// that corresponds to the exact kind of dependency. For example, to get a field type, use
...
...
c++/src/kj/common.h
View file @
73a01874
...
@@ -202,6 +202,11 @@ typedef unsigned char byte;
...
@@ -202,6 +202,11 @@ typedef unsigned char byte;
// TODO(msvc): Again, here, MSVC prefers a prefix, __declspec(deprecated).
// TODO(msvc): Again, here, MSVC prefers a prefix, __declspec(deprecated).
#endif
#endif
#if KJ_TESTING_KJ // defined in KJ's own unit tests; others should not define this
#undef KJ_DEPRECATED
#define KJ_DEPRECATED(reason)
#endif
namespace
_
{
// private
namespace
_
{
// private
KJ_NORETURN
(
void
inlineRequireFailure
(
KJ_NORETURN
(
void
inlineRequireFailure
(
...
...
c++/src/kj/compat/http.c++
View file @
73a01874
...
@@ -1759,7 +1759,7 @@ public:
...
@@ -1759,7 +1759,7 @@ public:
});
});
if
(
overshot
)
{
if
(
overshot
)
{
promise
=
promise
.
then
([
this
,
amount
,
&
input
](
uint64_t
actual
)
->
kj
::
Promise
<
uint64_t
>
{
promise
=
promise
.
then
([
amount
,
&
input
](
uint64_t
actual
)
->
kj
::
Promise
<
uint64_t
>
{
if
(
actual
==
amount
)
{
if
(
actual
==
amount
)
{
// We read exactly the amount expected. In order to detect an overshoot, we have to
// We read exactly the amount expected. In order to detect an overshoot, we have to
// try reading one more byte. Ugh.
// try reading one more byte. Ugh.
...
...
c++/src/kj/mutex-test.c++
View file @
73a01874
...
@@ -157,7 +157,7 @@ TEST(Mutex, When) {
...
@@ -157,7 +157,7 @@ TEST(Mutex, When) {
threads
.
add
(
kj
::
heap
<
kj
::
Thread
>
([
i
,
&
value
]()
{
threads
.
add
(
kj
::
heap
<
kj
::
Thread
>
([
i
,
&
value
]()
{
if
(
i
%
2
==
0
)
delay
();
if
(
i
%
2
==
0
)
delay
();
uint
m
=
value
.
when
([
i
](
const
uint
&
n
)
{
return
n
==
i
;
},
uint
m
=
value
.
when
([
i
](
const
uint
&
n
)
{
return
n
==
i
;
},
[
i
](
uint
&
n
)
{
return
n
++
;
});
[](
uint
&
n
)
{
return
n
++
;
});
KJ_ASSERT
(
m
==
i
);
KJ_ASSERT
(
m
==
i
);
}));
}));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment