Вот есть код для С++ Builder 12, который строит полилинию (фигуру) и определяет по клику, находится ли точка клика внутри или снаружи фигуры. Нужно написать код юнитеста, который брал бы функции уже существующие и написанные в коде и проверял их на исходных данных, к которым результат уже известен другим методом. (пример - проверка площади окружности, зная координаты центра и радиуса нахождение площади, которую сравнивают с значением расчитанной другим способом этой же площади. Если отличается, то ложь). //---------------------------------------------------------------------------

#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include <Vcl.ExtCtrls.hpp>
#include <Vcl.Dialogs.hpp>
#include <vector>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
 TPaintBox *PaintBox1;
 TOpenDialog *OpenDialog1;
 TButton *Button1;
 void __fastcall PaintBox1Click(TObject *Sender);
 void __fastcall Button1Click(TObject *Sender);
private: // User declarations
 double scale = 7;
 double centerX = PaintBox1->Width / 2;
 double centerY = PaintBox1->Height / 2;
public:  // User declarations
 __fastcall TForm1(TComponent* Owner);
};
struct point
{
 double x, y;
};

struct triangle
{
 double Vertex1, Vertex2, Vertex3;
};

std::vector<std::vector<point>> polylines;

class CalculationNormal
{
 public:
 double dx, dy, length, direction;
 void Calculation (double x1, double x2, double y1, double y2, double &normal_x, double &normal_y);
};

//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif   а в Unit1.cpp : > Yuriy:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include <math.h>
#include <algorithm>
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
 : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void CalculationNormal::Calculation(double x1, double x2, double y1, double y2, double &normal_x, double &normal_y)
{
 dx = x2 - x1;
 dy = y2 - y1;
 length = sqrt(dx * dx + dy * dy);
 normal_x = - dy / length;
 normal_y = dx / length;
 direction = (x1 + x2) / 2 * normal_x + (y1 + y2) / 2 * normal_y;
 if (direction < 0)
 {
  normal_x = -normal_x;
  normal_y = -normal_y;
 }
}

//---------------------------------------------------------------------------
bool intersect(const point& Point, const point& point1, const point& point2)
{
 if ((point1.y > Point.y && point2.y <= Point.y) || (point2.y > Point.y && point1.y <= Point.y))
    {
  double t = (Point.y - point1.y) / (point2.y - point1.y);
  if (t >= 0 && t <= 1)
  {
   double x_intersect = point1.x + t * (point2.x - point1.x);
   if (x_intersect >= Point.x)
   {
                return true;
   }
  }
    }
 return false;
}

//---------------------------------------------------------------------------

> Yuriy:
bool isInside(const point& Point, const std::vector<point>& polyline)
{
 int intersections = 0;
 for (int i = 0; i < polyline.size(); i++)
 {
  const point& point1 = polyline[i];
  const point& point2 = polyline[(i + 1) % polyline.size()];
  if (intersect(Point, point1, point2))
  {
   intersections++;
  }
 }
    return (intersections % 2) == 1;
}

//---------------------------------------------------------------------------

void __fastcall TForm1::Button1Click(TObject *Sender)
{
    if (OpenDialog1->Execute())
 {
        AnsiString fileName = OpenDialog1->FileName;
        FILE *file = fopen(fileName.c_str(), "r");
        double x, y;
        int NumPolylines;
  fscanf(file, "[Polylines]\n");
        fscanf(file, "%d\n", &NumPolylines);
  polylines.clear();
        polylines.resize(NumPolylines);
        for (int Poly = 0; Poly < NumPolylines; Poly++)
        {
            fscanf(file, "[Polyline]\n");
   int PolyIndex = 0;
            fscanf(file, "%d\n", &PolyIndex);
   int PointsCount = 0;
            fscanf(file, "%d\n", &PointsCount);
            for (int i = 0; i < PointsCount; i++)
            {
                if (fscanf(file, "%lf %lf\n", &x, &y) == 2)
    {
                    polylines[Poly].push_back({x, y});
    }
   }

  }
        fclose(file);

        centerX = PaintBox1->Width / 2;
  centerY = PaintBox1->Height / 2;
        PaintBox1->Canvas->Pen->Color = clBlack;
  PaintBox1->Canvas->Pen->Width = 2;

        for (int Poly = 0; Poly < NumPolylines; Poly++)
  {
            if (!polylines[Poly].empty())
   {
                PaintBox1->Canvas->MoveTo(centerX + scale * polylines[Poly][0].x, centerY - scale * polylines[Poly][0].y);
                for (size_t i = 1; i < polylines[Poly].size(); i++)
                {
                    PaintBox1->Canvas->LineTo(centerX + scale * polylines[Poly][i].x, centerY - scale * polylines[Poly][i].y);
    }
            }
  }
    }
    else
 {
  ShowMessage("Выбор файла отменен");
 }
}

//---------------------------------------------------------------------------

void __fastcall TForm1::PaintBox1Click(TObject *Sender)
{
 TPoint mousePos = PaintBox1->ScreenToClient(Mouse->CursorPos);
 double x = (mousePos.x - centerX) / scale;
 double y = -(mousePos.y - centerY) / scale;
 point testPoint = {x, y};

 PaintBox1->Canvas->Pen->Color = clRed;
 PaintBox1->Canvas->Brush->Color = clRed;
 PaintBox1->Canvas->Ellipse(mousePos.x - 3, mousePos.y - 3, mousePos.x + 3, mousePos.y + 3);

 int totalIntersections = 0;
 for (int Poly = 0; Poly < polylines.size(); Poly++)
 {
  for (int i = 0; i < polylines[Poly].size(); i++)
  {
   const point& point1 = polylines[Poly][i];
   const point& point2 = polylines[Poly][(i + 1) % polylines[Poly].size()];
   if (intersect(testPoint, point1, point2))
   {
    totalIntersections++;
   }
  }
 }

 if (totalIntersections % 2 == 1)
  {
   ShowMessage("Точка внутри фигуры");
  }
 else
  {
   ShowMessage("Точка снаружи фигуры");
  }
}
//---------------------------------------------------------------------------