libgrading
A simple library for grading C and C++ assignments.
 All Classes Namespaces Files Functions Enumerations Enumerator
Namespaces | Functions
checks.cpp File Reference

Implementation of various expectation checks. More...

#include <libgrading.h>
#include <distance.h>
#include <cassert>
#include <cmath>
#include <functional>
+ Include dependency graph for checks.cpp:

Go to the source code of this file.

Namespaces

 grading
 Container for all libgrading names.
 

Functions

CheckResult grading::operator&& (CheckResult &&, CheckResult &&)
 Combine the results of two checks using a product (AND): both must pass. More...
 
CheckResult grading::operator&& (CheckResult &&, CheckResult &)
 L-value version of above. More...
 
CheckResult grading::operator|| (CheckResult &&, CheckResult &&)
 Combine the results of two checks using a sum (OR): at least one must pass. More...
 
CheckResult grading::operator|| (CheckResult &&, CheckResult &)
 L-value version of above. More...
 
CheckResult grading::Check (bool, std::string description)
 Check an arbitrary condition, failing the test if false. More...
 
CheckResult grading::CheckInt (int expected, int actual)
 Check that two integers are equal, failing the test if they are not. More...
 
CheckResult grading::CheckFloat (double exp, double act, double tolerance=0.000001)
 Check that two floating-point numbers are equal within some tolerance. More...
 
CheckResult grading::CheckString (std::string expected, std::string actual, size_t maxEditDistance=0)
 Check that two strings are (approximately) equal. More...
 

Detailed Description

Implementation of various expectation checks.

Author
Jonathan Anderson jonat.nosp@m.han..nosp@m.ander.nosp@m.son@.nosp@m.mun.c.nosp@m.a
License:
Apache License, Version 2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file checks.cpp.