metaTests.cpp 907 字节
Newer Older
H
refact  
Hongze Cheng 已提交
1
#include <gtest/gtest.h>
H
Hongze Cheng 已提交
2
#include <string.h>
H
refact  
Hongze Cheng 已提交
3 4 5 6 7
#include <iostream>

#include "meta.h"

TEST(MetaTest, meta_open_test) {
H
Hongze Cheng 已提交
8
  // Open Meta
H
Hongze Cheng 已提交
9 10 11
  SMeta *meta = metaOpen(NULL);
  std::cout << "Meta is opened!" << std::endl;

H
more  
Hongze Cheng 已提交
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
#if 0
  // Create tables
  STableOpts      tbOpts;
  char            tbname[128];
  STSchema *      pSchema;
  STSchemaBuilder sb;
  tdInitTSchemaBuilder(&sb, 0);
  for (size_t i = 0; i < 10; i++) {
    tdAddColToSchema(&sb, TSDB_DATA_TYPE_TIMESTAMP, i, 8);
  }
  pSchema = tdGetSchemaFromBuilder(&sb);
  tdDestroyTSchemaBuilder(&sb);
  for (size_t i = 0; i < 1000000; i++) {
    sprintf(tbname, "tb%ld", i);
    metaTableOptsInit(&tbOpts, 0, tbname, pSchema);
H
Hongze Cheng 已提交
27

H
more  
Hongze Cheng 已提交
28 29 30
    metaCreateTable(meta, &tbOpts);
  }
#endif
H
Hongze Cheng 已提交
31 32

  // Close Meta
H
Hongze Cheng 已提交
33 34
  metaClose(meta);
  std::cout << "Meta is closed!" << std::endl;
H
more  
Hongze Cheng 已提交
35

H
more  
Hongze Cheng 已提交
36 37 38
  // // Destroy Meta
  // metaDestroy("meta");
  // std::cout << "Meta is destroyed!" << std::endl;
H
refact  
Hongze Cheng 已提交
39
}