metaTests.cpp 942 字节
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
  // // 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 已提交
26

H
more  
Hongze Cheng 已提交
27 28
  //   metaCreateTable(meta, &tbOpts);
  // }
H
Hongze Cheng 已提交
29 30

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

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