Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
tapir
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ashlie Martinez
tapir
Commits
eeaba446
Commit
eeaba446
authored
9 years ago
by
Irene Zhang
Browse files
Options
Downloads
Patches
Plain Diff
updating tests for VR
parent
d89913ff
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/tests/simtransport-test.cc
+11
-8
11 additions, 8 deletions
lib/tests/simtransport-test.cc
replication/common/replica.cc
+2
-0
2 additions, 0 deletions
replication/common/replica.cc
replication/vr/tests/vr-test.cc
+2
-2
2 additions, 2 deletions
replication/vr/tests/vr-test.cc
with
15 additions
and
10 deletions
lib/tests/simtransport-test.cc
+
11
−
8
View file @
eeaba446
...
...
@@ -67,11 +67,9 @@ TestReceiver::ReceiveMessage(const TransportAddress &src,
class
SimTransportTest
:
public
testing
::
Test
{
protected:
std
::
vector
<
transport
::
ReplicaAddress
>
replicaAddrs
=
{
{
"localhost"
,
"12345"
},
{
"localhost"
,
"12346"
},
{
"localhost"
,
"12347"
}};
transport
::
Configuration
config
{
3
,
1
,
replicaAddrs
};
std
::
vector
<
transport
::
ReplicaAddress
>
replicaAddrs
;
transport
::
Configuration
*
config
;
TestReceiver
*
receiver0
;
TestReceiver
*
receiver1
;
...
...
@@ -80,14 +78,19 @@ protected:
SimulatedTransport
*
transport
;
virtual
void
SetUp
()
{
replicaAddrs
.
push_back
(
*
(
new
transport
::
ReplicaAddress
(
"localhost"
,
"12345"
)));
replicaAddrs
.
push_back
(
*
(
new
transport
::
ReplicaAddress
(
"localhost"
,
"12346"
)));
replicaAddrs
.
push_back
(
*
(
new
transport
::
ReplicaAddress
(
"localhost"
,
"12347"
)));
receiver0
=
new
TestReceiver
();
receiver1
=
new
TestReceiver
();
receiver2
=
new
TestReceiver
();
config
=
new
transport
::
Configuration
(
3
,
1
,
replicaAddrs
);
transport
=
new
SimulatedTransport
();
transport
->
Register
(
receiver0
,
config
,
0
);
transport
->
Register
(
receiver1
,
config
,
1
);
transport
->
Register
(
receiver2
,
config
,
2
);
transport
->
Register
(
receiver0
,
*
config
,
0
);
transport
->
Register
(
receiver1
,
*
config
,
1
);
transport
->
Register
(
receiver2
,
*
config
,
2
);
}
virtual
void
TearDown
()
{
...
...
This diff is collapsed.
Click to expand it.
replication/common/replica.cc
+
2
−
0
View file @
eeaba446
...
...
@@ -56,7 +56,9 @@ Replica::~Replica()
void
Replica
::
LeaderUpcall
(
opnum_t
opnum
,
const
string
&
op
,
bool
&
replicate
,
string
&
res
)
{
Debug
(
"Making leader upcall for operation %s"
,
op
.
c_str
());
app
->
LeaderUpcall
(
opnum
,
op
,
replicate
,
res
);
Debug
(
"Upcall result: %s %s"
,
replicate
?
"yes"
:
"no"
,
res
.
c_str
());
}
void
...
...
This diff is collapsed.
Click to expand it.
replication/vr/tests/vr-test.cc
+
2
−
2
View file @
eeaba446
...
...
@@ -61,12 +61,12 @@ class VRApp : public AppReplica {
public:
VRApp
(
std
::
vector
<
string
>
*
o
,
std
::
vector
<
string
>
*
u
)
:
ops
(
o
),
unloggedOps
(
u
)
{
}
void
ReplicaUpcall
(
Replica
*
r
,
opnum_t
opnum
,
const
string
&
req
,
string
&
reply
)
{
void
ReplicaUpcall
(
opnum_t
opnum
,
const
string
&
req
,
string
&
reply
)
{
ops
->
push_back
(
req
);
reply
=
"reply: "
+
req
;
}
void
UnloggedUpcall
(
Replica
*
r
,
const
string
&
req
,
string
&
reply
)
{
void
UnloggedUpcall
(
const
string
&
req
,
string
&
reply
)
{
unloggedOps
->
push_back
(
req
);
reply
=
"unlreply: "
+
req
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment