Ticket #112: xapian-omtostring-test.patch

File xapian-omtostring-test.patch, 1.2 KB (added by Richard Boulton, 18 years ago)

Patch to add required test to internaltest.cc

  • tests/internaltest.cc

     
    3737#include "serialise.h"
    3838#include "serialise-double.h"
    3939#include "omqueryinternal.h"
     40#include "utils.h"
    4041
    4142static bool test_except1()
    4243{
     
    190191    return true;
    191192}
    192193
     194static bool test_omtostring1()
     195{
     196    string str;
     197    str = om_tostring(10);
     198    TEST_EQUAL(str, "10");
     199
     200#ifdef __WIN32__
     201    /* Test the 64 bit integer conversion to string.
     202     * (Currently only exists for windows.)
     203     */
     204    str = om_tostring(10ll);
     205    TEST_EQUAL(str, "10");
     206
     207    str = om_tostring(0x200000000ll);
     208    TEST_EQUAL(str, "8589934592");
     209#endif
     210
     211    return true;
     212}
     213
    193214#ifdef XAPIAN_HAS_REMOTE_BACKEND
    194215// Check serialisation of lengths.
    195216static bool test_serialiselength1()
     
    351372    {"stringcomp1",             test_stringcomp1},
    352373    {"temporarydtor1",          test_temporarydtor1},
    353374    {"omstringstream1",         test_omstringstream1},
     375    {"omtostring1",             test_omtostring1},
    354376    {"serialisedouble1",        test_serialisedouble1},
    355377#ifdef XAPIAN_HAS_REMOTE_BACKEND
    356378    {"serialiselength1",        test_serialiselength1},