ASSERT_TRUE(obs) << "cannot find: " << stats_name;
EXPECT_EQ(exp_value, obs->getInteger().first);
}
-
- /// @brief Checks the value of a big integer statistic for a given subnet.
- ///
- /// @param subnet_id identifier of a subnet for which the statistic should be checked
- /// @param name statistic name (e.g. "total-nas", "total-pds", ...)
- /// @param exp_value expected value of the statistic
- ///
- /// @return Number of assigned addresses for a subnet.
- void checkBigSubnetStat(const SubnetID& subnet_id, const std::string& name, int64_t exp_value) const {
- // Retrieve statistics name, e.g. subnet[1234].assigned-addresses.
- const std::string stats_name = StatsMgr::generateName("subnet", subnet_id, name);
- ObservationPtr obs = StatsMgr::instance().getObservation(stats_name);
- ASSERT_TRUE(obs) << "cannot find: " << stats_name;
- EXPECT_EQ(exp_value, obs->getBigInteger().first);
- }
};
// Tests the following scenario:
/// @name pure virtuals, every derived class must implement these
- /// @return true if the other ElementPtr has the same type and value
+ /// @return true if the other ElementPtr has the same value and the same
+ /// type (or a different and compatible type), false otherwise.
virtual bool equals(const Element& other) const = 0;
/// Converts the Element to JSON format and appends it to
/// stringstream.
void toJSON(std::ostream& ss) const override;
- /// @brief Checks whether the other Element has the same type and value.
+ /// @brief Checks whether the other Element is equal.
+ ///
+ /// @return true if the other ElementPtr has the same value and the same
+ /// type (or a different and compatible type), false otherwise.
bool equals(const Element& other) const override;
private: