KinoSearch

 view release on metacpan or  search on metacpan

core/KinoSearch/Test/TestUtils.cfh  view on Meta::CPAN

     */
    inert uint64_t*
    random_u64s(uint64_t *buf, size_t count, uint64_t min, uint64_t limit);

    /** Return an array of <code>count</code> random double-precision floating
     * point numbers between 0 and 1.
     *
     * If <code>buf</code> is NULL, it will be allocated, otherwise it will
     * be used.
     */
    inert double*
    random_f64s(double *buf, size_t count);

    /** Return a VArray of CharBufs, each representing the content for a
     * document in the shared collection.
     */
    inert incremented VArray*
    doc_set();

    /** Testing-only TermQuery factory.
     */
    inert incremented TermQuery*
    make_term_query(const char *field, const char *term);

    /** Testing-only PhraseQuery factory.
     */
    inert incremented PhraseQuery*
    make_phrase_query(const char *field, ...);

    /** Testing-only LeafQuery factory.
     */
    inert incremented LeafQuery*
    make_leaf_query(const char *field, const char *term);

    /** Return a new NOTQuery, decrementing the refcount for
     * <code>negated_query</code>.
     */
    inert incremented NOTQuery*
    make_not_query(Query *negated_query);

    inert incremented RangeQuery*
    make_range_query(const char *field, const char *lower_term = NULL, 
                     const char *upper_term = NULL, 
                     bool_t include_lower = true, 
                     bool_t include_upper = true);

    /** Return either an ORQuery or an ANDQuery depending on the value of
     * <code>boolop</code>.  Takes a NULL-terminated list of Query objects.
     * Decrements the refcounts of all supplied children, under the assumption
     * that they were created solely for inclusion within the aggregate query.
     */
    inert incremented PolyQuery*
    make_poly_query(uint32_t boolop, ...);

    /** Return the result of round-tripping the object through FREEZE and
     * THAW. 
     */
    inert incremented Obj*
    freeze_thaw(Obj *object);

    /** Verify an Analyzer's transform, transform_text, and split methods.
     */
    inert void
    test_analyzer(TestBatch *batch, Analyzer *analyzer, CharBuf *source,
                  VArray *expected, char *message);
}

__C__

#define KINO_TESTUTILS_BOOLOP_OR  1
#define KINO_TESTUTILS_BOOLOP_AND 2
#ifdef KINO_USE_SHORT_NAMES
  #define BOOLOP_OR        KINO_TESTUTILS_BOOLOP_OR
  #define BOOLOP_AND       KINO_TESTUTILS_BOOLOP_AND
#endif

__END_C__

/* Copyright 2005-2011 Marvin Humphrey
 *
 * This program is free software; you can redistribute it and/or modify
 * under the same terms as Perl itself.
 */



( run in 0.570 second using v1.01-cache-2.11-cpan-5511b514fd6 )