Top "Assertion" questions

An assertion is a software construct where the developer states ("asserts") a condition that he believes will always be true.

What does assert(0) mean?

I had a question like this on one of my exams and I'm still not too sure how to answer …

c++ c assert assertion
golang type assertion using reflect.Typeof()

I've tried to identify a struct with string value(name). reflect.TypeOf returns Type. But type assertion needs a type. …

types go typeof assertion
Equivalent of isTextPresent of Selenium 1 (Selenium RC) in Selenium 2 (WebDriver)

There's no isTextPresent in Selenium 2 (WebDriver) What is the correct way to assert the existence of some text on a …

webdriver selenium-webdriver assertion
What are contracts (as proposed for C++17)?

I read about contracts in Thoughts about C++17 by B. Stroustrup and assisted a small presentation talking about them but …

c++ assertion design-by-contract c++17
Java assertions underused

I'm wondering why the assert keyword is so underused in Java? I've almost never seen them used, but I think …

java assertion
'CityListViewSet' should either include a `serializer_class` attribute, or override the `get_serializer_class()` method

I am assuming by the error in the title, once more here for clarity 'CityListViewSet' should either include a `serializer_…

python django-rest-framework assertion django-rest-viewsets
JMock unexpected invocation

Below I am just trying to mock a class named TestWrapper and set 'allowing' expecations on it. However, when setting …

java junit jmock assertion
countNonZero function gives an assertion error in openCV

I tried to get horizontal projection using countNonZero() function as below. Mat src = imread(INPUT_FILE, CV_LOAD_IMAGE_COLOR); …

c++ opencv assertion projection-matrix
CUDA: How to assert in kernel code?

What is the equivalent technique of an assertion in CUDA kernel code? There does not seem to be an assert …

assertion cuda
Gulp AssertionError [ERR_ASSERTION]: Task function must be specified

I'm trying to customize a template for a demo of a webapp built on AngularJS using MacOS Sierra 10.13.6. I've installed …

angularjs gulp assertion