| 108 | } |
| 109 | |
| 110 | func (runner *SGRTestRunner) RunSubprotocolV4(test func(t *testing.T)) { |
| 111 | if runner.initialisedInsideRunnerCode { |
| 112 | require.FailNow(runner.TB(), "must not initialise SGRPeers outside Run() method") |
| 113 | } |
| 114 | |
| 115 | runner.initialisedInsideRunnerCode = true |
| 116 | defer func() { |
| 117 | // reset bool post test run to ensure no one can setup SetupSGRPeers outside run method upon completion of Run() |
| 118 | runner.initialisedInsideRunnerCode = false |
| 119 | }() |
| 120 | |
| 121 | if !runner.SkipSubtest[VersionVectorSubtestName] { |
| 122 | runner.t.Run(VersionVectorSubtestName, func(t *testing.T) { |
| 123 | runner.SupportedSubprotocols = []string{db.CBMobileReplicationV4.SubprotocolString()} |
| 124 | test(t) |
| 125 | }) |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | func (runner *SGRTestRunner) IsV4Protocol() bool { |
| 130 | return slices.Contains(runner.SupportedSubprotocols, db.CBMobileReplicationV4.SubprotocolString()) |