<commit_before>#include <BALL/STRUCTURE/geometricProperties.h>

#include <BALL/KERNEL/atom.h>
#include <BALL/KERNEL/molecule.h>

#include <BALL/CONCEPT/classTest.h>

START_TEST(GeometricProperties, "")

using namespace BALL;

CHECK(setTorsionAngle unsuccessful)
	Molecule m;
	Atom a1, a2, a3, a4;
	a1.setPosition(Vector3(0.0f,1.0f,0.0f));
	a2.setPosition(Vector3(0.0f,0.0f,0.0f));
	a3.setPosition(Vector3(1.0f,0.0f,0.0f));
	a4.setPosition(Vector3(1.0f,-1.0f,0.0f));

	m.insert(a1);
	m.insert(a2);
	m.insert(a3);
	m.insert(a4);

	a1.createBond(a2);
	a2.createBond(a3);
	a3.createBond(a4);
	a4.createBond(a1);

	float angle = 90.0f;
	TEST_EQUAL(setTorsionAngle(a1, a2, a3, a4, Angle(angle, false)), false);
RESULT

CHECK(setTorsionAngle successful)
	Molecule m;
	Atom a1, a2, a3, a4;
	a1.setPosition(Vector3(0.0f, 1.0f, 0.0f));
	a2.setPosition(Vector3(0.0f, 0.0f, 0.0f));
	a3.setPosition(Vector3(1.0f, 0.0f, 0.0f));
	a4.setPosition(Vector3(1.0f,-1.0f, 0.0f));

	m.insert(a1);
	m.insert(a2);
	m.insert(a3);
	m.insert(a4);

	a1.createBond(a2);
	a2.createBond(a3);
	a3.createBond(a4);

	PRECISION(1e-5)
	float angle = 90.0f;
	TEST_EQUAL(setTorsionAngle(a1, a2, a3, a4, Angle(angle, false)), true);
	Angle result = calculateTorsionAngle(a1, a2, a3, a4);
	TEST_REAL_EQUAL(result.toDegree(), angle);

	angle = 120.0f;<commit_msg>Made the GeometricProperties_test slightly less sensitive<commit_after>#include <BALL/STRUCTURE/geometricProperties.h>

#include <BALL/KERNEL/atom.h>
#include <BALL/KERNEL/molecule.h>

#include <BALL/CONCEPT/classTest.h>

START_TEST(GeometricProperties, "")

using namespace BALL;

CHECK(setTorsionAngle unsuccessful)
	Molecule m;
	Atom a1, a2, a3, a4;
	a1.setPosition(Vector3(0.0f,1.0f,0.0f));
	a2.setPosition(Vector3(0.0f,0.0f,0.0f));
	a3.setPosition(Vector3(1.0f,0.0f,0.0f));
	a4.setPosition(Vector3(1.0f,-1.0f,0.0f));

	m.insert(a1);
	m.insert(a2);
	m.insert(a3);
	m.insert(a4);

	a1.createBond(a2);
	a2.createBond(a3);
	a3.createBond(a4);
	a4.createBond(a1);

	float angle = 90.0f;
	TEST_EQUAL(setTorsionAngle(a1, a2, a3, a4, Angle(angle, false)), false);
RESULT

CHECK(setTorsionAngle successful)
	Molecule m;
	Atom a1, a2, a3, a4;
	a1.setPosition(Vector3(0.0f, 1.0f, 0.0f));
	a2.setPosition(Vector3(0.0f, 0.0f, 0.0f));
	a3.setPosition(Vector3(1.0f, 0.0f, 0.0f));
	a4.setPosition(Vector3(1.0f,-1.0f, 0.0f));

	m.insert(a1);
	m.insert(a2);
	m.insert(a3);
	m.insert(a4);

	a1.createBond(a2);
	a2.createBond(a3);
	a3.createBond(a4);

	PRECISION(1e-4)
	float angle = 90.0f;
	TEST_EQUAL(setTorsionAngle(a1, a2, a3, a4, Angle(angle, false)), true);
	Angle result = calculateTorsionAngle(a1, a2, a3, a4);
	TEST_REAL_EQUAL(result.toDegree(), angle);

	angle = 120.0f;
{'fraction_non_alphanumeric': 0.18540580789277736, 'fraction_numerical': 0.08786299329858525, 'mean_word_length': 5.307511737089202, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '5986571', 'n_tokens_mistral': 1391, 'n_tokens_neox': 1334, 'n_words': 188}