yep. these are the additions i've in my branch.
// TODO(vinod): Combine this with ASSERT_FUTURE_WILL_SUCCEED
// inside libprocess gtest.hpp.
#define AWAIT_FOR_READY(future, duration) \
ASSERT_TRUE(future.await(duration)); \
ASSERT_TRUE(future.isReady()) \
// TODO(vinod): Combine this with ASSERT_FUTURE_WILL_SUCCEED
// inside libprocess gtest.hpp.
#define AWAIT_READY(future) \
ASSERT_TRUE(future.await(Seconds(2))); \
ASSERT_TRUE(future.isReady()) \
#define FUTURE_PROTOBUF(message, from, to) \
FutureProtobuf(message, from, to)
#define DROP_PROTOBUF(message, from, to) \
DropProtobuf(message, from, to)
#define DROP_PROTOBUFS(message, from, to) \
DropProtobufs(message, from, to)
template <typename T, typename From, typename To>
process::Future<T> DropProtobuf(T t, From from, To to)
{
// Help debugging by adding some "type constraints".
{ google::protobuf::Message* m = &t; (void) m; }
return process::FutureMessage(testing::Eq(t.GetTypeName()), from, to, true
)
.then(lambda::bind(&_FutureProtobuf<T>, lambda::_1));
}
template <typename T, typename From, typename To>
void DropProtobufs(T t, From from, To to)
{
// Help debugging by adding some "type constraints".
{ google::protobuf::Message* m = &t; (void) m; }
process::DropMessages(testing::Eq(t.GetTypeName()), from, to, true);
}
@vinodkone
On Fri, Apr 5, 2013 at 10:56 AM, Vinod Kone <[email protected]> wrote:
> looks like you extended FutureProtobuf to take a bool 'drop'. I ended up
> just creating DropProtobuf() and DropProtobufs().
>
>
> @vinodkone
>
>
> On Fri, Apr 5, 2013 at 10:43 AM, Benjamin Hindman <[email protected]>wrote:
>
>> This is an automatically generated e-mail. To reply, visit:
>> https://reviews.apache.org/r/10307/
>> Review request for mesos and Vinod Kone.
>> By Benjamin Hindman.
>> Description
>>
>> See summary.
>>
>> Testing
>>
>> N/A
>>
>> Diffs
>>
>> - src/tests/utils.hpp (9fee0ca68d4a0c307e875a7e520fd00c5f9a7b57)
>>
>> View Diff <https://reviews.apache.org/r/10307/diff/>
>>
>
>