<commit_before>/*
 *  Author(s):
 *  - <NAME> <<EMAIL>>
 *
 *  Copyright (c) 2013 Aldebaran Robotics. All rights reserved.
 */

#include <gtest/gtest.h>

#include <qiperf/measure.hpp>

TEST(TestMeasure, TestNumFD)
{
  int numFD = qi::measure::getNumFD();
#ifdef __linux__
  ASSERT_NE(numFD, -1);
#else
  ASSERT_EQ(numFD, -1);
#endif
}
<commit_msg>improve test_measure<commit_after>/*
 *  Author(s):
 *  - <NAME> <<EMAIL>>
 *
 *  Copyright (c) 2013 Aldebaran Robotics. All rights reserved.
 */

#include <gtest/gtest.h>

#include <qiperf/measure.hpp>
#include <qi/os.hpp>
TEST(TestMeasure, TestNumFD)
{
  int numFD = qi::measure::getNumFD();
#ifdef __linux__
  ASSERT_NE(numFD, -1);
#else
  ASSERT_EQ(numFD, -1);
#endif

  std::string tmp = qi::os::mktmpdir();
  tmp += "test";
  qi::os::fopen(tmp.c_str(), "w");
#ifdef __linux__
  ASSERT_EQ(qi::measure::getNumFD(), numFD + 1);
#else
  ASSERT_EQ(qi::measure::getNumFD(), -1);
#endif
}

{'fraction_non_alphanumeric': 0.1925133689839572, 'fraction_numerical': 0.014973262032085561, 'mean_word_length': 4.538461538461538, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, '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': '1270387', 'n_tokens_mistral': 405, 'n_tokens_neox': 388, 'n_words': 77}