Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions C/tests/c4Test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,8 @@ string C4Test::sReplicatorFixturesDir = "Replicator/tests/data/";

C4Test::C4Test(int num) : _storage(kC4SQLiteStorageEngine) { // NOLINT(cppcoreguidelines-pro-type-member-init)
constexpr static TestOptions numToTestOption[] = {
#if SkipVersionVectorTest
RevTreeOption,
EncryptedRevTreeOption
#else
RevTreeOption,
VersionVectorOption,
EncryptedRevTreeOption
#endif
EncryptedVersionVectorOption
};
static_assert(sizeof(numToTestOption) / sizeof(TestOptions) >= numberOfOptions);
TestOptions testOption = numToTestOption[num];
Expand Down Expand Up @@ -203,7 +197,7 @@ C4Test::C4Test(int num) : _storage(kC4SQLiteStorageEngine) { // NOLINT(cppcoreg
kRev4ID = C4STR("4-44444444");
}

if ( testOption == EncryptedRevTreeOption ) {
if ( testOption == EncryptedVersionVectorOption ) {
_dbConfig.encryptionKey.algorithm = kC4EncryptionAES256;
memcpy(_dbConfig.encryptionKey.bytes, "this is not a random key at all.", kC4EncryptionKeySizeAES256);
}
Expand Down
17 changes: 4 additions & 13 deletions C/tests/c4Test.hh
Original file line number Diff line number Diff line change
Expand Up @@ -171,22 +171,13 @@ void C4ExpectException(C4ErrorDomain domain, int code, const std::function<void(
/// and closes & deletes it in tearDown. Also checks for leaks of classes that are InstanceCounted.
class C4Test {
public:
enum TestOptions { RevTreeOption = 0, VersionVectorOption, EncryptedRevTreeOption };
enum TestOptions { VersionVectorOption = 0, EncryptedVersionVectorOption };
#if defined(COUCHBASE_ENTERPRISE)
# if SkipVersionVectorTest
static constexpr int numberOfOptions = 2; // rev-tree, rev-tree encrypted
static constexpr const char* nameOfOption[numberOfOptions] = {"RevTree", "EncryptedRevTree"};
# else
static constexpr int numberOfOptions = 3; // rev-tree, version vector, rev-tree encrypted
static constexpr const char* nameOfOption[numberOfOptions] = {"RevTree", "VersionVector", "EncryptedRevTree"};
# endif
static constexpr int numberOfOptions = 2; // See nameOfOption
static constexpr const char* nameOfOption[numberOfOptions] = {"VersionVector", "EncryptedVersionVector"};
#else
# if SkipVersionVectorTest
static constexpr int numberOfOptions = 1; // rev-tree
# else
static constexpr int numberOfOptions = 2; // rev-tree, version vector
# endif
static constexpr const char* nameOfOption[2] = {"RevTree", "VersionVector"};
static constexpr const char* nameOfOption[numberOfOptions] = {"VersionVector"};
#endif

static std::string sFixturesDir; // directory where test files live
Expand Down
4 changes: 0 additions & 4 deletions Replicator/tests/ReplicatorLoopbackTest.hh
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,7 @@ class ReplicatorLoopbackTest

slice kNonLocalRev1ID, kNonLocalRev2ID, kNonLocalRev3ID, kConflictRev2AID, kConflictRev2BID;

#if SkipVersionVectorTest
static constexpr int numberOfOptions = 1;
#else
static constexpr int numberOfOptions = 2;
#endif

ReplicatorLoopbackTest(int which) : C4Test(which), db2(createDatabase("2")) {
// Change tuning param so that tests will actually create deltas, despite using small
Expand Down
Loading