I was reading partially ordered calls for googletest here and I understoond how their example works. So we can use:
using ::testing::Sequence;
...
Sequence s1, s2;
EXPECT_CALL(foo, A())
.InSequence(s1, s2);
EXPECT_CALL(bar, B())
.InSequence(s1);
EXPECT_CALL(bar, C())
.InSequence(s2);
EXPECT_CALL(foo, D())
.InSequence(s2);
to show the following DAG:
+---> B
|
A ---|
|
+---> C ---> D
But I wondered how we can define multiple prerequisites of a call. For example, how I can add DAG constraints for E node in following DAG?
+---> B ----------+
| |
A ---| |---> E
| |
+---> C ---> D ---+
Will it be something like this?
using ::testing::Sequence;
...
Sequence s1, s2, s3;
EXPECT_CALL(foo, A())
.InSequence(s1, s2);
EXPECT_CALL(bar, B())
.InSequence(s1, s3);
EXPECT_CALL(bar, C())
.InSequence(s2);
EXPECT_CALL(foo, D())
.InSequence(s2, s3);
EXPECT_CALL(foo, E())
.InSequence(s3);