<commit_before># 2 "TestPointers.ino"

#include <Arduino.h>
#include <Arduino_FreeRTOS.h>
#include <StandardCplusplus.h>
#include <RabirdToolkit.h>

#include <RTest.h>
#include <RRawPointer.h>
#include <RSharedPointer.h>

RTEST(TestRawPointer)
{
  // This pointer will not be free forever
  uint8_t *ptr  = new uint8_t(0xFA);
  uint8_t *ptr2 = new uint8_t(0xFA);

  RRawPointer<uint8_t> rawPtr;
  RRawPointer<uint8_t> rawPtr2(ptr);
  RRawPointer<uint8_t> rawPtr3(rawPtr2);

  RASSERT_TRUE(rawPtr.data() == NULL);
  RASSERT_TRUE(rawPtr2.data() == ptr);
  RASSERT_TRUE(rawPtr3.data() == ptr);
  RASSERT_TRUE(rawPtr3.data() == rawPtr2.data());
  RASSERT_TRUE(rawPtr == NULL);
  RASSERT_TRUE(rawPtr2 == ptr);
  RASSERT_TRUE(rawPtr3 == ptr);
  RASSERT_TRUE(rawPtr3 == rawPtr2.data());

  rawPtr.reset(ptr2);

  RASSERT_TRUE(rawPtr.data() == ptr2);

  rawPtr = rawPtr3;

  RASSERT_TRUE(rawPtr.data() == ptr);
  RASSERT_TRUE(rawPtr.data() == rawPtr2.data());

  rawPtr.reset();
  rawPtr3.reset();

  RASSERT_TRUE(rawPtr.data() == NULL);
  RASSERT_TRUE(rawPtr3.data() == NULL);<commit_msg>Added more tests for pointer class<commit_after># 2 "TestPointers.ino"

#include <Arduino.h>
#include <Arduino_FreeRTOS.h>
#include <StandardCplusplus.h>
#include <RabirdToolkit.h>

#include <RTest.h>
#include <RRawPointer.h>
#include <RSharedPointer.h>

RTEST(TestRawPointer)
{
  // This pointer will not be free forever
  uint8_t *ptr  = new uint8_t(0xFA);
  uint8_t *ptr2 = new uint8_t(0xEB);

  RRawPointer<uint8_t> rawPtr;
  RRawPointer<uint8_t> rawPtr2(ptr);
  RRawPointer<uint8_t> rawPtr3(rawPtr2);

  RASSERT_TRUE(rawPtr.data() == 0);
  RASSERT_TRUE(rawPtr2.data() == ptr);
  RASSERT_TRUE(rawPtr3.data() == ptr);
  RASSERT_TRUE(rawPtr3.data() == rawPtr2.data());
  RASSERT_TRUE(rawPtr == 0);
  RASSERT_TRUE(rawPtr2 == ptr);
  RASSERT_TRUE(rawPtr3 == ptr);
  RASSERT_TRUE(rawPtr3 == rawPtr2.data());
  RASSERT_EQUAL(rawPtr3, rawPtr2);

  rawPtr.reset(ptr2);

  RASSERT_TRUE(rawPtr.data() == ptr2);
  RASSERT_EQUAL(*rawPtr, 0xEB);
  RASSERT_EQUAL(*rawPtr3, 0xFA);

  rawPtr = rawPtr3;

  RASSERT_TRUE(rawPtr.data() == ptr);
  RASSERT_TRUE(rawPtr.data() == rawPtr2.data());

  rawPtr.reset();
  rawPtr3.reset();

  RASSERT_TRUE(rawPtr.data() == NULL);
  RASSERT_TRUE(rawPtr3.data() == NULL);
{'fraction_non_alphanumeric': 0.16249451032059728, 'fraction_numerical': 0.02766798418972332, 'mean_word_length': 5.363128491620111, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '5268718', 'n_tokens_mistral': 960, 'n_tokens_neox': 931, 'n_words': 150}