Exemplo n.º 1
0
    void checkPass (std::string const& input, bool shouldPass = true)
    {
        SemanticVersion v;

        if (shouldPass )
        {
            expect (v.parse (input));
            expect (v.print () == input);
        }
        else
        {
            expect (! v.parse (input));
        }
    }
Exemplo n.º 2
0
    // makes sure the left version is less than the right
    void checkLessInternal (std::string const& lhs, std::string const& rhs)
    {
        SemanticVersion left;
        SemanticVersion right;

        expect (left.parse (lhs));
        expect (right.parse (rhs));

        expect (compare (left, left) == 0);
        expect (compare (right, right) == 0);
        expect (compare (left, right) < 0);
        expect (compare (right, left) > 0);

        expect (left < right);
        expect (right > left);
        expect (left == left);
        expect (right == right);
    }
Exemplo n.º 3
0
        SanityChecker ()
        {
            SemanticVersion v;

            char const* const rawText = getRawVersionString ();

            if (! v.parse (rawText) || v.print () != rawText)
                FatalError ("Bad server version string", __FILE__, __LINE__);

            versionString = rawText;
        }
Exemplo n.º 4
0
    // Checks the decomposition of the input into appropriate values
    void checkValues (std::string const& input,
        int majorVersion,
        int minorVersion,
        int patchVersion,
        identifier_list const& preReleaseIdentifiers = identifier_list (),
        identifier_list const& metaData = identifier_list ())
    {
        SemanticVersion v;

        expect (v.parse (input));

        expect (v.majorVersion == majorVersion);
        expect (v.minorVersion == minorVersion);
        expect (v.patchVersion == patchVersion);

        expect (v.preReleaseIdentifiers == preReleaseIdentifiers);
        expect (v.metaData == metaData);
    }