]>
git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/utilities/cassandra/test_utils.h
1 // Copyright (c) 2017-present, Facebook, Inc. All rights reserved.
2 // This source code is licensed under both the GPLv2 (found in the
3 // COPYING file in the root directory) and Apache 2.0 License
4 // (found in the LICENSE.Apache file in the root directory).
8 #include "test_util/testharness.h"
9 #include "utilities/cassandra/format.h"
10 #include "utilities/cassandra/serialize.h"
12 namespace ROCKSDB_NAMESPACE
{
14 extern const char kData
[];
15 extern const char kExpiringData
[];
16 extern const int32_t kTtl
;
17 extern const int8_t kColumn
;
18 extern const int8_t kTombstone
;
19 extern const int8_t kExpiringColumn
;
22 std::shared_ptr
<ColumnBase
> CreateTestColumn(int8_t mask
,
26 std::tuple
<int8_t, int8_t, int64_t> CreateTestColumnSpec(int8_t mask
,
30 RowValue
CreateTestRowValue(
31 std::vector
<std::tuple
<int8_t, int8_t, int64_t>> column_specs
);
33 RowValue
CreateRowTombstone(int64_t timestamp
);
35 void VerifyRowValueColumns(
36 const std::vector
<std::shared_ptr
<ColumnBase
>> &columns
,
37 std::size_t index_of_vector
, int8_t expected_mask
, int8_t expected_index
,
38 int64_t expected_timestamp
);
40 int64_t ToMicroSeconds(int64_t seconds
);
41 int32_t ToSeconds(int64_t microseconds
);
43 } // namespace ROCKSDB_NAMESPACE