<commit_before>//===----------------------------------------------------------------------===//
//
//                         PelotonDB
//
// expression_test.cpp
//
// Identification: tests/expression/container_tuple_test.cpp
//
// Copyright (c) 2015, Carnegie Mellon University Database Group
//
//===----------------------------------------------------------------------===//

#include <iostream>
#include <sstream>
#include <queue>

#include "gtest/gtest.h"
#include "harness.h"

#include "backend/common/types.h"
#include "backend/common/value_peeker.h"
#include "backend/common/value_factory.h"
#include "backend/expression/container_tuple.h"
#include "backend/storage/tuple.h"

namespace peloton {
namespace test {


TEST(ContainerTupleTest, VectorValue) {
  std::vector<Value> values;
  values.push_back(ValueFactory::GetIntegerValue(11));
  values.push_back(ValueFactory::GetIntegerValue(22));
  values.push_back(ValueFactory::GetDoubleValue(3.14));
  values.push_back(ValueFactory::GetStringValue("Hello from ContainerTupleTest"));

  expression::ContainerTuple<std::vector<Value>> ctuple(&values);

  for(size_t i = 0; i < values.size(); i++){
    std::cout << ctuple.GetValue(i) << "\n";
    EXPECT_TRUE(values[i].OpEquals(ctuple.GetValue(i)).IsTrue());
  }


}

}  // End test namespace
}  // End peloton namespace<commit_msg>Fix memory leak in container_tuple_test<commit_after>//===----------------------------------------------------------------------===//
//
//                         PelotonDB
//
// expression_test.cpp
//
// Identification: tests/expression/container_tuple_test.cpp
//
// Copyright (c) 2015, Carnegie Mellon University Database Group
//
//===----------------------------------------------------------------------===//

#include <iostream>
#include <sstream>
#include <queue>

#include "gtest/gtest.h"
#include "harness.h"

#include "backend/common/types.h"
#include "backend/common/value_peeker.h"
#include "backend/common/value_factory.h"
#include "backend/expression/container_tuple.h"
#include "backend/storage/tuple.h"

namespace peloton {
namespace test {


TEST(ContainerTupleTest, VectorValue) {
  std::vector<Value> values;
  values.push_back(ValueFactory::GetIntegerValue(11));
  values.push_back(ValueFactory::GetIntegerValue(22));
  values.push_back(ValueFactory::GetDoubleValue(3.14));
  values.push_back(ValueFactory::GetStringValue("Hello from ContainerTupleTest"));

  expression::ContainerTuple<std::vector<Value>> ctuple(&values);

  for(size_t i = 0; i < values.size(); i++){
    std::cout << ctuple.GetValue(i) << "\n";
    EXPECT_TRUE(values[i].OpEquals(ctuple.GetValue(i)).IsTrue());
  }

  for(auto v : values){
    v.FreeUninlinedData();
  }


}

}  // End test namespace
}  // End peloton namespace
{'fraction_non_alphanumeric': 0.2512690355329949, 'fraction_numerical': 0.00870195794053662, 'mean_word_length': 2.8160442600276627, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2967079', 'n_tokens_mistral': 844, 'n_tokens_neox': 810, 'n_words': 137}