mirror of https://gitee.com/bigwinds/arangodb
Fixed now missing include in test files
This commit is contained in:
parent
d1116c1c72
commit
ca30314c78
|
@ -24,17 +24,21 @@
|
||||||
#ifndef TESTS_IRESEARCH__COMMON_H
|
#ifndef TESTS_IRESEARCH__COMMON_H
|
||||||
#define TESTS_IRESEARCH__COMMON_H 1
|
#define TESTS_IRESEARCH__COMMON_H 1
|
||||||
|
|
||||||
#include "Aql/Query.h"
|
|
||||||
#include "Aql/AstNode.h"
|
#include "Aql/AstNode.h"
|
||||||
#include "VocBase/vocbase.h"
|
#include "Aql/Query.h"
|
||||||
#include "Basics/StaticStrings.h"
|
#include "Basics/StaticStrings.h"
|
||||||
|
#include "VocBase/VocbaseInfo.h"
|
||||||
|
#include "VocBase/vocbase.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#undef NO_INLINE // to avoid GCC warning
|
#undef NO_INLINE // to avoid GCC warning
|
||||||
#include <search/filter.hpp>
|
#include <search/filter.hpp>
|
||||||
|
|
||||||
|
#include <velocypack/Builder.h>
|
||||||
#include <velocypack/Slice.h>
|
#include <velocypack/Slice.h>
|
||||||
|
#include <velocypack/velocypack-aliases.h>
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief a TRI_vocbase_t that will call shutdown() on deallocation
|
/// @brief a TRI_vocbase_t that will call shutdown() on deallocation
|
||||||
|
@ -66,7 +70,6 @@ namespace tests {
|
||||||
|
|
||||||
extern std::string const AnalyzerCollectionName;
|
extern std::string const AnalyzerCollectionName;
|
||||||
|
|
||||||
|
|
||||||
extern std::string testResourceDir;
|
extern std::string testResourceDir;
|
||||||
|
|
||||||
void init(bool withICU = false);
|
void init(bool withICU = false);
|
||||||
|
@ -84,46 +87,41 @@ void v8Init();
|
||||||
|
|
||||||
v8::Isolate* v8Isolate();
|
v8::Isolate* v8Isolate();
|
||||||
|
|
||||||
bool assertRules(
|
bool assertRules(TRI_vocbase_t& vocbase, std::string const& queryString,
|
||||||
TRI_vocbase_t& vocbase,
|
|
||||||
std::string const& queryString,
|
|
||||||
std::vector<int> expectedRulesIds,
|
std::vector<int> expectedRulesIds,
|
||||||
std::shared_ptr<arangodb::velocypack::Builder> bindVars = nullptr,
|
std::shared_ptr<arangodb::velocypack::Builder> bindVars = nullptr,
|
||||||
std::string const& optionsString = "{}"
|
std::string const& optionsString = "{}");
|
||||||
);
|
|
||||||
|
|
||||||
arangodb::aql::QueryResult executeQuery(
|
arangodb::aql::QueryResult executeQuery(
|
||||||
TRI_vocbase_t& vocbase,
|
TRI_vocbase_t& vocbase, std::string const& queryString,
|
||||||
std::string const& queryString,
|
|
||||||
std::shared_ptr<arangodb::velocypack::Builder> bindVars = nullptr,
|
std::shared_ptr<arangodb::velocypack::Builder> bindVars = nullptr,
|
||||||
std::string const& optionsString = "{}"
|
std::string const& optionsString = "{}");
|
||||||
);
|
|
||||||
|
|
||||||
std::unique_ptr<arangodb::aql::ExecutionPlan> planFromQuery(
|
std::unique_ptr<arangodb::aql::ExecutionPlan> planFromQuery(
|
||||||
TRI_vocbase_t& vocbase,
|
TRI_vocbase_t& vocbase, std::string const& queryString,
|
||||||
std::string const& queryString,
|
|
||||||
std::shared_ptr<arangodb::velocypack::Builder> bindVars = nullptr,
|
std::shared_ptr<arangodb::velocypack::Builder> bindVars = nullptr,
|
||||||
std::string const& optionsString = "{}"
|
std::string const& optionsString = "{}");
|
||||||
);
|
|
||||||
|
|
||||||
std::unique_ptr<arangodb::aql::Query> prepareQuery(
|
std::unique_ptr<arangodb::aql::Query> prepareQuery(
|
||||||
TRI_vocbase_t& vocbase,
|
TRI_vocbase_t& vocbase, std::string const& queryString,
|
||||||
std::string const& queryString,
|
|
||||||
std::shared_ptr<arangodb::velocypack::Builder> bindVars = nullptr,
|
std::shared_ptr<arangodb::velocypack::Builder> bindVars = nullptr,
|
||||||
std::string const& optionsString = "{}"
|
std::string const& optionsString = "{}");
|
||||||
);
|
|
||||||
|
|
||||||
uint64_t getCurrentPlanVersion();
|
uint64_t getCurrentPlanVersion();
|
||||||
|
|
||||||
void setDatabasePath(arangodb::DatabasePathFeature& feature);
|
void setDatabasePath(arangodb::DatabasePathFeature& feature);
|
||||||
|
|
||||||
#define EXPECT_EQUAL_SLICES_STRINGIFY(x) #x
|
#define EXPECT_EQUAL_SLICES_STRINGIFY(x) #x
|
||||||
#define EXPECT_EQUAL_SLICES_EXPANDER(leftSlice, rightSlice, file, line) arangodb::tests::expectEqualSlices_(leftSlice, rightSlice, file ":" EXPECT_EQUAL_SLICES_STRINGIFY(line))
|
#define EXPECT_EQUAL_SLICES_EXPANDER(leftSlice, rightSlice, file, line) \
|
||||||
#define EXPECT_EQUAL_SLICES(leftSlice, rightSlice) EXPECT_EQUAL_SLICES_EXPANDER(leftSlice, rightSlice, __FILE__, __LINE__)
|
arangodb::tests::expectEqualSlices_(leftSlice, rightSlice, \
|
||||||
void expectEqualSlices_(const velocypack::Slice& lhs, const velocypack::Slice& rhs, const char* where);
|
file ":" EXPECT_EQUAL_SLICES_STRINGIFY(line))
|
||||||
|
#define EXPECT_EQUAL_SLICES(leftSlice, rightSlice) \
|
||||||
|
EXPECT_EQUAL_SLICES_EXPANDER(leftSlice, rightSlice, __FILE__, __LINE__)
|
||||||
|
void expectEqualSlices_(const velocypack::Slice& lhs,
|
||||||
|
const velocypack::Slice& rhs, const char* where);
|
||||||
|
|
||||||
}
|
} // namespace tests
|
||||||
}
|
} // namespace arangodb
|
||||||
|
|
||||||
std::string mangleType(std::string name);
|
std::string mangleType(std::string name);
|
||||||
std::string mangleAnalyzer(std::string name);
|
std::string mangleAnalyzer(std::string name);
|
||||||
|
@ -142,61 +140,40 @@ inline arangodb::aql::AstNode* wrappedExpressionExtractor(arangodb::aql::AstNode
|
||||||
}
|
}
|
||||||
|
|
||||||
void assertExpressionFilter(
|
void assertExpressionFilter(
|
||||||
std::string const& queryString,
|
std::string const& queryString, irs::boost_t boost = irs::no_boost(),
|
||||||
irs::boost_t boost = irs::no_boost(),
|
|
||||||
std::function<arangodb::aql::AstNode*(arangodb::aql::AstNode*)> const& expressionExtractor = &defaultExpressionExtractor,
|
std::function<arangodb::aql::AstNode*(arangodb::aql::AstNode*)> const& expressionExtractor = &defaultExpressionExtractor,
|
||||||
std::string const& refName = "d"
|
std::string const& refName = "d");
|
||||||
);
|
|
||||||
|
|
||||||
void assertFilterBoost(
|
void assertFilterBoost(irs::filter const& expected, irs::filter const& actual);
|
||||||
irs::filter const& expected,
|
|
||||||
irs::filter const& actual
|
|
||||||
);
|
|
||||||
|
|
||||||
void assertFilterOptimized(
|
void assertFilterOptimized(TRI_vocbase_t& vocbase, std::string const& queryString,
|
||||||
TRI_vocbase_t& vocbase,
|
|
||||||
std::string const& queryString,
|
|
||||||
irs::filter const& expectedFilter,
|
irs::filter const& expectedFilter,
|
||||||
arangodb::aql::ExpressionContext* exprCtx = nullptr,
|
arangodb::aql::ExpressionContext* exprCtx = nullptr,
|
||||||
std::shared_ptr<arangodb::velocypack::Builder> bindVars = nullptr
|
std::shared_ptr<arangodb::velocypack::Builder> bindVars = nullptr);
|
||||||
);
|
|
||||||
|
|
||||||
void assertFilter(
|
void assertFilter(bool parseOk, bool execOk, std::string const& queryString,
|
||||||
bool parseOk,
|
|
||||||
bool execOk,
|
|
||||||
std::string const& queryString,
|
|
||||||
irs::filter const& expected,
|
irs::filter const& expected,
|
||||||
arangodb::aql::ExpressionContext* exprCtx = nullptr,
|
arangodb::aql::ExpressionContext* exprCtx = nullptr,
|
||||||
std::shared_ptr<arangodb::velocypack::Builder> bindVars = nullptr,
|
std::shared_ptr<arangodb::velocypack::Builder> bindVars = nullptr,
|
||||||
std::string const& refName = "d"
|
std::string const& refName = "d");
|
||||||
);
|
|
||||||
|
|
||||||
void assertFilterSuccess(
|
void assertFilterSuccess(std::string const& queryString, irs::filter const& expected,
|
||||||
std::string const& queryString,
|
|
||||||
irs::filter const& expected,
|
|
||||||
arangodb::aql::ExpressionContext* exprCtx = nullptr,
|
arangodb::aql::ExpressionContext* exprCtx = nullptr,
|
||||||
std::shared_ptr<arangodb::velocypack::Builder> bindVars = nullptr,
|
std::shared_ptr<arangodb::velocypack::Builder> bindVars = nullptr,
|
||||||
std::string const& refName = "d"
|
std::string const& refName = "d");
|
||||||
);
|
|
||||||
|
|
||||||
void assertFilterFail(
|
void assertFilterFail(std::string const& queryString,
|
||||||
std::string const& queryString,
|
|
||||||
arangodb::aql::ExpressionContext* exprCtx = nullptr,
|
arangodb::aql::ExpressionContext* exprCtx = nullptr,
|
||||||
std::shared_ptr<arangodb::velocypack::Builder> bindVars = nullptr,
|
std::shared_ptr<arangodb::velocypack::Builder> bindVars = nullptr,
|
||||||
std::string const& refName = "d"
|
std::string const& refName = "d");
|
||||||
);
|
|
||||||
|
|
||||||
void assertFilterExecutionFail(
|
void assertFilterExecutionFail(std::string const& queryString,
|
||||||
std::string const& queryString,
|
|
||||||
arangodb::aql::ExpressionContext* exprCtx = nullptr,
|
arangodb::aql::ExpressionContext* exprCtx = nullptr,
|
||||||
std::shared_ptr<arangodb::velocypack::Builder> bindVars = nullptr,
|
std::shared_ptr<arangodb::velocypack::Builder> bindVars = nullptr,
|
||||||
std::string const& refName = "d"
|
std::string const& refName = "d");
|
||||||
);
|
|
||||||
|
|
||||||
void assertFilterParseFail(
|
void assertFilterParseFail(std::string const& queryString,
|
||||||
std::string const& queryString,
|
std::shared_ptr<arangodb::velocypack::Builder> bindVars = nullptr);
|
||||||
std::shared_ptr<arangodb::velocypack::Builder> bindVars = nullptr
|
|
||||||
);
|
|
||||||
|
|
||||||
inline VPackBuilder dbArgsBuilder(std::string const& name = "_system") {
|
inline VPackBuilder dbArgsBuilder(std::string const& name = "_system") {
|
||||||
VPackBuilder builder;
|
VPackBuilder builder;
|
||||||
|
@ -208,9 +185,13 @@ inline VPackBuilder dbArgsBuilder(std::string const& name = "_system") {
|
||||||
return builder;
|
return builder;
|
||||||
};
|
};
|
||||||
|
|
||||||
arangodb::CreateDatabaseInfo createInfo(std::string const& name, uint64_t id, bool allowSystemDB = false);
|
arangodb::CreateDatabaseInfo createInfo(std::string const& name, uint64_t id,
|
||||||
arangodb::CreateDatabaseInfo systemDBInfo(std::string const& name = arangodb::StaticStrings::SystemDatabase, uint64_t id = 1);
|
bool allowSystemDB = false);
|
||||||
arangodb::CreateDatabaseInfo testDBInfo(std::string const& name = "testVocbase", uint64_t id = 2);
|
arangodb::CreateDatabaseInfo systemDBInfo(std::string const& name = arangodb::StaticStrings::SystemDatabase,
|
||||||
arangodb::CreateDatabaseInfo unknownDBInfo(std::string const& name = "unknownVocbase", uint64_t id = 3);
|
uint64_t id = 1);
|
||||||
|
arangodb::CreateDatabaseInfo testDBInfo(std::string const& name = "testVocbase",
|
||||||
|
uint64_t id = 2);
|
||||||
|
arangodb::CreateDatabaseInfo unknownDBInfo(
|
||||||
|
std::string const& name = "unknownVocbase", uint64_t id = 3);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue