Consistent use of returns documentation tag.

This commit is contained in:
Bhargava Shastry 2021-02-09 12:51:36 +01:00
parent 896de75bcb
commit 75e7e1bee7

View File

@ -94,24 +94,24 @@ struct TestState
sourceUnitPaths.insert(_path); sourceUnitPaths.insert(_path);
currentSourceUnitPath = _path; currentSourceUnitPath = _path;
} }
/// Returns true if @name sourceUnitPaths is empty, /// @returns true if @name sourceUnitPaths is empty,
/// false otherwise. /// false otherwise.
[[nodiscard]] bool empty() const [[nodiscard]] bool empty() const
{ {
return sourceUnitPaths.empty(); return sourceUnitPaths.empty();
} }
/// Returns the number of items in @name sourceUnitPaths. /// @returns the number of items in @name sourceUnitPaths.
[[nodiscard]] size_t size() const [[nodiscard]] size_t size() const
{ {
return sourceUnitPaths.size(); return sourceUnitPaths.size();
} }
/// Prints test state to @param _os. /// Prints test state to @param _os.
void print(std::ostream& _os) const; void print(std::ostream& _os) const;
/// Returns a randomly chosen path from @param _sourceUnitPaths. /// @returns a randomly chosen path from @param _sourceUnitPaths.
[[nodiscard]] std::string randomPath(std::set<std::string> const& _sourceUnitPaths) const; [[nodiscard]] std::string randomPath(std::set<std::string> const& _sourceUnitPaths) const;
/// Returns a randomly chosen path from @name sourceUnitPaths. /// @returns a randomly chosen path from @name sourceUnitPaths.
[[nodiscard]] std::string randomPath() const; [[nodiscard]] std::string randomPath() const;
/// Returns a randomly chosen non current source unit path. /// @returns a randomly chosen non current source unit path.
[[nodiscard]] std::string randomNonCurrentPath() const; [[nodiscard]] std::string randomNonCurrentPath() const;
/// List of source paths in test input. /// List of source paths in test input.
std::set<std::string> sourceUnitPaths; std::set<std::string> sourceUnitPaths;
@ -132,15 +132,15 @@ struct GeneratorBase
return std::get<std::shared_ptr<T>>(g); return std::get<std::shared_ptr<T>>(g);
solAssert(false, ""); solAssert(false, "");
} }
/// Returns test fragment created by this generator. /// @returns test fragment created by this generator.
std::string generate() std::string generate()
{ {
std::string generatedCode = visit(); std::string generatedCode = visit();
endVisit(); endVisit();
return generatedCode; return generatedCode;
} }
/// Virtual visitor that returns a string representing /// @returns a string representing the generation of
/// the generation of the Solidity grammar element. /// the Solidity grammar element.
virtual std::string visit() = 0; virtual std::string visit() = 0;
/// Method called after visiting this generator. Used /// Method called after visiting this generator. Used
/// for clearing state if necessary. /// for clearing state if necessary.
@ -189,7 +189,7 @@ public:
return "Test case generator"; return "Test case generator";
} }
private: private:
/// Returns a new source path name that is formed by concatenating /// @returns a new source path name that is formed by concatenating
/// a static prefix @name m_sourceUnitNamePrefix, a monotonically /// a static prefix @name m_sourceUnitNamePrefix, a monotonically
/// increasing counter starting from 0 and the postfix (extension) /// increasing counter starting from 0 and the postfix (extension)
/// ".sol". /// ".sol".
@ -257,18 +257,18 @@ class SolidityGenerator: public std::enable_shared_from_this<SolidityGenerator>
public: public:
explicit SolidityGenerator(unsigned _seed); explicit SolidityGenerator(unsigned _seed);
/// Returns the generator of type @param T. /// @returns the generator of type @param T.
template <typename T> template <typename T>
std::shared_ptr<T> generator(); std::shared_ptr<T> generator();
/// Returns a shared ptr to underlying random /// @returns a shared ptr to underlying random
/// number distribution. /// number distribution.
std::shared_ptr<UniformRandomDistribution> uniformRandomDist() std::shared_ptr<UniformRandomDistribution> uniformRandomDist()
{ {
return m_urd; return m_urd;
} }
/// Returns a pseudo randomly generated test case. /// @returns a pseudo randomly generated test case.
std::string generateTestProgram(); std::string generateTestProgram();
/// Returns shared ptr to global test state. /// @returns shared ptr to global test state.
std::shared_ptr<TestState> testState() std::shared_ptr<TestState> testState()
{ {
return m_state; return m_state;