<commit_before>/************************************************************************
  Module:    otherFieldData.cxx
  Language:  C++
  Date:      $Date$
  Version:   $Revision$
 ************************************************************************/

#include "vtkDebugLeaks.h"
#include "vtkFieldData.h"
#include "vtkFloatArray.h"
#include "vtkIdList.h"

int main()
{
  vtkDebugLeaks::PromptUserOff();

  vtkFieldData* fd = vtkFieldData::New();

  vtkFloatArray* fa;

  char name[128];
  for(int i=0; i<5; i++)
    {
    sprintf(name, "Array%d", i);
    fa = vtkFloatArray::New();
    fa->SetName(name);
    fd->AddArray(fa);
    fa->Delete();
    }

  // Coverage
  vtkFieldData::Iterator it(fd);
  vtkFieldData::Iterator it2(it);

  it = it;
  it2 = it;

  fd->Allocate(20);
  fd->CopyFieldOff("Array0");
  fd->CopyFieldOff("Array1");

  vtkFieldData* fd2 = fd->MakeObject();
  fd2->ShallowCopy(fd);
  fd2->DeepCopy(fd);

  vtkIdList* ptIds = vtkIdList::New();
  ptIds->InsertNextId(0);
  ptIds->InsertNextId(2);

  fd->GetField(ptIds, fd2);
  ptIds->Delete();

//  int arrayComp;
//  int id = fd->GetArrayContainingComponent(1, arrayComp);

  float tuple[10];
  fd->GetTuple(2);
  fd->SetTuple(2, tuple);
  fd->InsertTuple(2, tuple);
  fd->InsertNextTuple(tuple);
  fd->SetComponent(0,0, 1.0);
  fd->InsertComponent(0,0, 1.0);

  fd2->Reset();

  fd->Delete();
  fd2->Delete();

  return 0;

} <commit_msg>Argh ! People are removing lines from my test... They are there for coverage.<commit_after>/************************************************************************
  Module:    otherFieldData.cxx
  Language:  C++
  Date:      $Date$
  Version:   $Revision$
 ************************************************************************/

#include "vtkDebugLeaks.h"
#include "vtkFieldData.h"
#include "vtkFloatArray.h"
#include "vtkIdList.h"

int main()
{
  vtkDebugLeaks::PromptUserOff();

  vtkFieldData* fd = vtkFieldData::New();

  vtkFloatArray* fa;

  char name[128];
  for(int i=0; i<5; i++)
    {
    sprintf(name, "Array%d", i);
    fa = vtkFloatArray::New();
    fa->SetName(name);
    fd->AddArray(fa);
    fa->Delete();
    }

  // Coverage
  vtkFieldData::Iterator it(fd);
  vtkFieldData::Iterator it2(it);

  it = it;
  it2 = it;

  fd->Allocate(20);
  fd->CopyFieldOff("Array0");
  fd->CopyFieldOff("Array1");

  vtkFieldData* fd2 = fd->MakeObject();
  fd2->ShallowCopy(fd);
  fd2->DeepCopy(fd);

  vtkIdList* ptIds = vtkIdList::New();
  ptIds->InsertNextId(0);
  ptIds->InsertNextId(2);

  fd->GetField(ptIds, fd2);
  ptIds->Delete();

  int arrayComp;
  cout << fd->GetArrayContainingComponent(1, arrayComp) << endl;

  float tuple[10];
  fd->GetTuple(2);
  fd->SetTuple(2, tuple);
  fd->InsertTuple(2, tuple);
  fd->InsertNextTuple(tuple);
  fd->SetComponent(0,0, 1.0);
  fd->InsertComponent(0,0, 1.0);

  fd2->Reset();

  fd->Delete();
  fd2->Delete();

  return 0;

} 
{'fraction_non_alphanumeric': 0.2669886167644015, 'fraction_numerical': 0.023456364263539153, 'mean_word_length': 4.206463195691203, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 49, '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': '232727', 'n_tokens_mistral': 1107, 'n_tokens_neox': 1049, 'n_words': 186}