示例#1
0
            2khvpfu13f  
    */
    sb = stringbuffer_create();
    ght_node_compact_attribute(root, simpleschema->dims[2], &attr);
    ght_node_compact_attribute(root, simpleschema->dims[3], &attr);
    ght_node_to_string(root, sb, 0);
    // printf("\n%s\n", stringbuffer_getstring(sb));
    stringbuffer_destroy(sb);
    
    /* Check that Intensity=5 has migrated all the way to the top of the tree */
    CU_ASSERT_STRING_EQUAL(root->attributes->dim->name, "Intensity");
    ght_attribute_get_value(root->attributes, &d);
    CU_ASSERT_DOUBLE_EQUAL(d, 5, 0.00000001);
    
    ght_node_free(root);
    ght_nodelist_free_shallow(nodelist);
}


/* REGISTER ***********************************************************/

CU_TestInfo attribute_tests[] =
{
    GHT_TEST(test_ght_build_tree_with_attributes),
    GHT_TEST(test_ght_build_node_with_attributes),
    CU_TEST_INFO_NULL
};

CU_SuiteInfo attributes_suite = {"attributes", init_suite, clean_suite, attribute_tests};

示例#2
0
    ght_writer_free(writer);
    
    err = ght_reader_new_file(testfile, schema, &reader);
    CU_ASSERT_EQUAL(err, GHT_OK);
    err = ght_node_read(reader, &noderead);
    CU_ASSERT_EQUAL(err, GHT_OK);
    ght_reader_free(reader);
    remove(testfile);

    ght_node_free(root);
    ght_node_free(noderead);
    
}

/* REGISTER ***********************************************************/

CU_TestInfo core_tests[] =
{
    GHT_TEST(test_geohash_inout),
    GHT_TEST(test_ght_hash_common_length),
    GHT_TEST(test_ght_hash_leaf_parts),
    GHT_TEST(test_ght_node_build_tree),
    GHT_TEST(test_ght_node_build_tree_big),
    GHT_TEST(test_ght_node_serialization),
    GHT_TEST(test_ght_node_file_serialization),
    CU_TEST_INFO_NULL
};

CU_SuiteInfo core_suite = {"core", init_suite, clean_suite, core_tests};

示例#3
0
    result = ght_schema_to_xml_str(myschema, &mystr, &schema_size);
    CU_ASSERT_EQUAL(result, GHT_OK);

    CU_ASSERT_STRING_EQUAL(str, mystr);
    ght_free(str);
    ght_free(mystr);
    ght_schema_free(myschema);
}



static void
test_schema_size()
{
//  size_t sz = schema->size;
//  CU_ASSERT_EQUAL(sz, 37);
}



/* REGISTER ***********************************************************/

CU_TestInfo schema_tests[] =
{
    GHT_TEST(test_schema_xml),
    CU_TEST_INFO_NULL
};

CU_SuiteInfo schema_suite = {"schema", init_suite, clean_suite, schema_tests};