TEST_F(FileSystemJsObjectTest, StatIllegalArguments)
{
  ASSERT_ANY_THROW(jsEngine->Evaluate("_fileSystem.stat()"));
  ASSERT_ANY_THROW(jsEngine->Evaluate("_fileSystem.stat('', '')"));
}
TEST(TPointerMatrix, throws_when_create_matrix_with_negative_length) {
	ASSERT_ANY_THROW(TPointerMatrix<int> m(-5));
}
TEST(TPointerMatrix, cant_subtract_matrixes_with_not_equal_size) {
	TPointerMatrix<int> a(3), b(4);
	ASSERT_ANY_THROW(a - b);
}
TEST(TBitField, throws_when_clear_bit_with_negative_index)
{
  TBitField bf(10);

  ASSERT_ANY_THROW(bf.ClrBit(-3));
}
Beispiel #5
0
// Testing nullptr input vector.
TEST_F(PointVecTest, TestPointVecCtorNullptr)
{
	ASSERT_ANY_THROW(GeoLib::PointVec(name, nullptr));
	delete ps_ptr;
}
TEST(TMatrix, cant_create_too_large_matrix)
{
	ASSERT_ANY_THROW(TMatrix<int> m(MAX_MATRIX_SIZE + 1));
}
TEST(TBitField, throws_when_get_bit_with_negative_index)
{
  TBitField bf(10);

  ASSERT_ANY_THROW(bf.GetBit(-3));
}
TEST(Stack, can_not_SetSize_negativ_length) 
{
	Stack<int> a(10);
	a.SetSize(15);
	ASSERT_ANY_THROW(a.SetSize(-10));
}
TEST(TVector, throws_when_create_vector_with_negative_length)
{
  ASSERT_ANY_THROW(TVector<int> v(-5));
}
TEST(Stack, can_not_pop_from_empty_stack) 
{
	Stack<int> a(10);
	int b;
	ASSERT_ANY_THROW(b = a.pop());
}
TEST(Stack, can_not_create_stack_whith_negativ_length)
{
	ASSERT_ANY_THROW(Stack<int> a(-10));
}
Beispiel #12
0
TEST_F(CoreFixture, Unzip_NonExistTest)
{
  openstudio::path p = resourcesPath()/openstudio::toPath("utilities/Zip/blarg.zip");

  ASSERT_ANY_THROW(openstudio::UnzipFile f(p));
}
TEST(STACK, throws_when_pop_from_empty_stack)
{
	Stack<int>* s = new Stack<int>;
	ASSERT_ANY_THROW(s->Pop());
}
TEST(TMatrix, throws_when_set_element_with_too_large_index)
{
	TMatrix<int> m(5);

	ASSERT_ANY_THROW(m[1][10] = 3);
}
TEST(TMatrix, throws_when_set_element_with_too_large_index)//  ASSERT_ANY_THROW(m[MAX_MATRIX_SIZE+1][2]);вытекает как следствие
{  
	TMatrix<int> m(5);
	ASSERT_ANY_THROW(m[7][2]);
}
TEST(TVector, throws_when_create_vector_with_negative_startindex)
{
  ASSERT_ANY_THROW(TVector<int> v(5, -2));
}
TEST(TMatrix, throws_when_set_element_with_index_less_then_startindex)
{
	TMatrix<int> m(2);
	ASSERT_ANY_THROW(m[1][0]);
}
TEST(TVector, throws_when_set_element_with_negative_index)
{
	TVector<int> v(3);
	ASSERT_ANY_THROW(v[-3] = 5);
}
TEST(TBitField, throws_when_create_bitfield_with_negative_length)
{
  ASSERT_ANY_THROW(TBitField bf(-3));
}
TEST(TVector, throws_when_set_element_with_too_large_index)
{
	TVector<int> v(3);
	ASSERT_ANY_THROW(v[5] = 6);
}
TEST(TBitField, throws_when_get_bit_with_too_large_index)
{
  TBitField bf(10);

  ASSERT_ANY_THROW(bf.GetBit(11));
}
TEST(TVector, cant_create_too_large_vector)
{
  ASSERT_ANY_THROW(TVector<int> v(MAX_VECTOR_SIZE + 1));
}
TEST(TBitField, throws_when_clear_bit_with_too_large_index)
{
  TBitField bf(10);

  ASSERT_ANY_THROW(bf.ClrBit(11));
}
TEST(TParser, cant_divide_on_zero_inf)
{
	TParser p("2/0");

	ASSERT_ANY_THROW(p.Calc());
}
Beispiel #25
0
// Testing empty input vector.
TEST_F(PointVecTest, TestPointVecCtorEmpty)
{
	ASSERT_ANY_THROW(GeoLib::PointVec(name, ps_ptr));
}
TEST(TParser, cant_calculate_ln_from_negative_number)
{
	TParser p("ln(-3)");

	ASSERT_ANY_THROW(p.Calc());
}
TEST(TPointerMatrix, cant_add_matrices_with_not_equal_size) {
	TPointerMatrix<int> a(3), b(4);
	ASSERT_ANY_THROW(a + b);
}
TEST(TMatrix, throws_when_set_element_with_negative_index)
{
	TMatrix<int> m(5);
	ASSERT_ANY_THROW(m[-1][2]);
}
TEST(TPointerMatrix, can_not_multiplied_matrix_with_different_size) {
	TPointerMatrix<int> a(2), b(3);

	ASSERT_ANY_THROW(a*b);
}
TEST_F(FileSystemJsObjectTest, RemoveIllegalArguments)
{
  ASSERT_ANY_THROW(jsEngine->Evaluate("_fileSystem.remove()"));
  ASSERT_ANY_THROW(jsEngine->Evaluate("_fileSystem.remove('', '')"));
}