<commit_before>#include "api-test-utils.h"

#include <boost/process.hpp>
#include "config/config.h"
#include "test_utils.h"
#include "utilities/utils.h"

std::string serverAddress;
std::unique_ptr<boost::process::child> server;
std::unique_ptr<TemporaryDirectory> temp_dir;

void Run_fake_http_server(const char *serverPath, const char *metaPath) {
  std::string port = TestUtils::getFreePort();
  serverAddress = "http://127.0.0.1:" + port;

  server = std_::make_unique<boost::process::child>(serverPath, port, "-f", "-m", metaPath);
  TestUtils::waitForServer(serverAddress + "/");
}

void Stop_fake_http_server() { server.reset(); }

Config *Get_test_config() {
  auto *config = new Config();

  config->tls.server = serverAddress;

  config->provision.primary_ecu_serial = "CA:FE:A6:D2:84:9D";
  config->provision.primary_ecu_hardware_id = "primary_hw";
  config->provision.server = serverAddress;
  config->provision.provision_path = "tests/test_data/cred.zip";

  temp_dir = std_::make_unique<TemporaryDirectory>();
  config->storage.path = temp_dir->Path();
  config->pacman.type = PACKAGE_MANAGER_NONE;

  config->postUpdateValues();
  return config;
}
<commit_msg>Silence some more annoying false positives.<commit_after>#include "api-test-utils.h"

#include <boost/process.hpp>
#include "config/config.h"
#include "test_utils.h"
#include "utilities/utils.h"

std::string serverAddress;
std::unique_ptr<boost::process::child> server;
std::unique_ptr<TemporaryDirectory> temp_dir;

void Run_fake_http_server(const char *serverPath, const char *metaPath) {
  std::string port = TestUtils::getFreePort();
  serverAddress = "http://127.0.0.1:" + port;

  // NOLINTNEXTLINE(clang-analyzer-core.NonNullParamChecker)
  server = std_::make_unique<boost::process::child>(serverPath, port, "-f", "-m", metaPath);
  TestUtils::waitForServer(serverAddress + "/");
}

// NOLINTNEXTLINE(clang-analyzer-core.CallAndMessage)
void Stop_fake_http_server() { server.reset(); }

Config *Get_test_config() {
  auto *config = new Config();

  config->tls.server = serverAddress;

  config->provision.primary_ecu_serial = "CA:FE:A6:D2:84:9D";
  config->provision.primary_ecu_hardware_id = "primary_hw";
  config->provision.server = serverAddress;
  config->provision.provision_path = "tests/test_data/cred.zip";

  temp_dir = std_::make_unique<TemporaryDirectory>();
  config->storage.path = temp_dir->Path();
  config->pacman.type = PACKAGE_MANAGER_NONE;

  config->postUpdateValues();
  return config;
}

{'fraction_non_alphanumeric': 0.156839149618933, 'fraction_numerical': 0.008824709185720016, 'mean_word_length': 6.1461318051575935, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '4666725', 'n_tokens_mistral': 875, 'n_tokens_neox': 857, 'n_words': 135}