<commit_before>#ifndef VST_TESTBASESERIALPORT_H
#define VST_TESTBASESERIALPORT_H

#include <QtTest/QtTest>

// redefine protected to public to get access to the member variables of the
// BaseSerialPort class
#define protected public
#include "../../src/BaseSerialPort.h"
#undef protected

namespace unittest
{

/// Unit tests for BaseSerialPort class.
class TestBaseSerialPort : public QObject
{
  Q_OBJECT

private slots:
  /// Tests the default constructor.
  void defaultConstructor();

  /// Tests the error function.
  void error();
};

// Dummy class for testing of BaseSerialPort, implements the pure virtual
// functions.
class DummySerialPort : public BaseSerialPort
{
  Q_OBJECT

public:
  DummySerialPort(QObject *parent = 0)
    : BaseSerialPort(parent)
  {
  }

  ~DummySerialPort()
  {
  }

  virtual bool open(const QString &deviceName,
                    unsigned int baudrate,
                    unsigned short timeoutSecs)
  {
    Q_UNUSED(deviceName)
    Q_UNUSED(baudrate)
    Q_UNUSED(timeoutSecs)

    return true;
  }

  virtual bool isOpen()
  {
    return true;
  }

  virtual bool close()
  {
    return true;
  }

  virtual bool setTimeout(unsigned short timeoutSecs)
  {
    Q_UNUSED(timeoutSecs)

    return true;
  }

  virtual bool write(const QString &data)
  {
    Q_UNUSED(data)

    return true;
  }
};

} // unittest

#endif<commit_msg>Update unittest for BaseSerialPort<commit_after>#ifndef VST_TESTBASESERIALPORT_H
#define VST_TESTBASESERIALPORT_H

#include <QtTest/QtTest>

// redefine protected to public to get access to the member variables of the
// BaseSerialPort class
#define protected public
#include "../../src/BaseSerialPort.h"
#undef protected

namespace unittest
{

/// Unit tests for BaseSerialPort class.
class TestBaseSerialPort : public QObject
{
  Q_OBJECT

private slots:
  /// Tests the default constructor.
  void defaultConstructor();

  /// Tests the error function.
  void error();
};

// Dummy class for testing of BaseSerialPort, implements the pure virtual
// functions.
class DummySerialPort : public BaseSerialPort
{
  Q_OBJECT

public:
  DummySerialPort(QObject *parent = 0)
    : BaseSerialPort(parent)
  {
  }

  ~DummySerialPort()
  {
  }

  virtual bool open(const QString &deviceName,
                    unsigned int baudrate,
                    unsigned short timeoutSecs)
  {
    Q_UNUSED(deviceName)
    Q_UNUSED(baudrate)
    Q_UNUSED(timeoutSecs)

    return true;
  }

  virtual bool isOpen()
  {
    return true;
  }

  virtual bool close()
  {
    return true;
  }

  virtual bool setTimeout(unsigned short timeoutSecs)
  {
    Q_UNUSED(timeoutSecs)

    return true;
  }

  virtual bool write(const QString &data)
  {
    Q_UNUSED(data)

    return true;
  }

  virtual bool writeRaw(const QByteArray &data)
  {
    Q_UNUSED(data)

    return true;
  }
};

} // unittest

#endif
{'fraction_non_alphanumeric': 0.08516579406631762, 'fraction_numerical': 0.0006980802792321117, 'mean_word_length': 3.036619718309859, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3079023', 'n_tokens_mistral': 910, 'n_tokens_neox': 896, 'n_words': 250}