<commit_before>// Basic tests.

#include "utils/if_test_helper.hxx"

#include "nmranet/NMRAnetEventRegistry.hxx"
#include "if/nmranet_if.h"

TEST_F(IfTest, Setup) {}

TEST_F(IfTest, WriteMessageSync) {
  // We write a message using the WriteFlow class directly into the interface.
  ExpectPacket(":X195B412DN0102030405060708;");
  event_write_helper1.WriteAsync(node_, MTI_EVENT_REPORT, WriteHelper::Global(),
                                 EventIdToBuffer(0x0102030405060708ULL),
                                 nullptr);
}

TEST_F(IfTest, WriteMessageASync) {
  // We write a message using the WriteFlow class asynchronously.
  ExpectPacket(":X195B412DN0102030405060708;");
  SyncNotifiable n;
  event_write_helper1.WriteAsync(node_, MTI_EVENT_REPORT, WriteHelper::Global(),
                                 EventIdToBuffer(0x0102030405060708ULL),
                                 &n);
  n.WaitForNotification();
}


TEST_F(IfTest, ReadMessageAndReply) {
  // We send an alias mapping enquiry frame and expect the node ID back.
  ExpectPacket(":X1070112DN02010d000003;");
  SendPacket(  ":X10702000N;");

}<commit_msg>style fixes<commit_after>// Basic tests.

#include "utils/if_test_helper.hxx"

#include "nmranet/NMRAnetEventRegistry.hxx"
#include "if/nmranet_if.h"

TEST_F(IfTest, Setup) {}

TEST_F(IfTest, WriteMessageSync) {
  // We write a message using the WriteFlow class directly into the interface.
  ExpectPacket(":X195B412DN0102030405060708;");
  event_write_helper1.WriteAsync(node_, MTI_EVENT_REPORT, WriteHelper::Global(),
                                 EventIdToBuffer(0x0102030405060708ULL),
                                 nullptr);
}

TEST_F(IfTest, WriteMessageASync) {
  // We write a message using the WriteFlow class asynchronously.
  ExpectPacket(":X195B412DN0102030405060708;");
  SyncNotifiable n;
  event_write_helper1.WriteAsync(node_, MTI_EVENT_REPORT, WriteHelper::Global(),
                                 EventIdToBuffer(0x0102030405060708ULL),
                                 &n);
  n.WaitForNotification();
}

TEST_F(IfTest, ReadMessageAndReply) {
  // We send an alias mapping enquiry frame and expect the node ID back.
  ExpectPacket(":X1070112DN02010d000003;");
  SendPacket(  ":X10702000N;");
}
{'fraction_non_alphanumeric': 0.09991079393398751, 'fraction_numerical': 0.09455842997323818, 'mean_word_length': 3.280534351145038, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6171025', 'n_tokens_mistral': 853, 'n_tokens_neox': 727, 'n_words': 139}