Do some unit tests (Google test, gmock) assignments for my class

Job ID: 32544272

Budget: $10 – $30 USD

Assignment 1

Apart from the positive tests that are sure to succeed, find the weaknesses of the tested types and functions and write negative tests, e.g.: expecting falsehood, or throwing an exception, etc.
Task 1. test the following base types: bool, int/unsigned int, short, unsigned short, char, unsigned char, float, double, long, long/ unsigned.
Task 2: Implement and test the add, subtract, multiply, divide functions.
Task 3. implement the function that calculates n-th expression of fibonacci sequence in iterative and recursive way and write test suite to check its correctness.
Task 4. implement and test, as in the previous task, the function that calculates the greatest common divisor (Euclid's algorithm).

Assignment 2

Using TDD writing technique, perform the following tasks:

1. Write a template class that stores an array of arbitrary types (analogous to std::vector)template <class type> class MyVector;
2. Instead of std iterators, use ordinary pointers, or indexes, as the case may be.
3. Here is a list of methods to implement and test:-
- Constructor to initialize
MyVector<int> cV = { 7, 5, 16, 8 };
MyVector<int>cV2(cV.begin(),cV.end());
MyVector<int> cV3(cV);
MyVector<int> cV4(12, 5);

declarations:

MyVector();
MyVector(size_type count, const T&value);
template< class InputIt > MyVector( InputIt first, InputIt last);
MyVector& operator=( const MyVector& other ) - allocation operator
- copying constructor
- transferring operator
- transferring constructor
reference operator[]( size_type pos ); - Returns a reference to the element that is at the given position in the container
- void assign( size_type count, const T& value ); - Removes all existing elements from the container, then copies the indicated elements into the container.
- template< class InputIt > void assign( InputIt first, InputIt last ); - Applies only to MyVector objects;
- reference at( size_type pos ); - Returns a reference to the element, which is located on the given position in the container
- reference back(); - Returns a reference to the last element in the container
- size_type capacity() const; - Returns the maximum number of elements the container can hold without reallocating memory
- void shrink_to_fit(); - Reduces the amount of reserved MyVector space to the number of elements
- void clear(); - Deletes all elements from the MyVector container
- bool empty() const; - Checks if the container is empty
- ptr begin(); - Returns the pointer pointing to the first element
- ptr end(); - Returns a pointer to the element that is after the last element
- void erase( iterator pos ); Erases one or more elements from the MyVector container occurring at the given position or within the given range
- void erase( iterator first, iterator last );
- reference front(); - Returns reference to first element in container
- void insert( iterator pos, const T& value ); Inserts one element or multiple elements into a MyVector container at the specified position
- void insert( iterator pos, size_type count, const T& value );
- template< class InputIt > void insert( iterator pos, InputIt first, InputIt last );
Applies only to MyVector objects;
- void pop_back(); - Removes one element from the MyVector container, located at its end.
- void push_back( const T& value ); - Adds a new element to the end of the MyVector container,
- void reserve( size_type new_cap ); - Reserves enough space in the container to hold the specified number of elements without having to perform additional memory reallocation when adding them
- void resize( size_type count ); - Sets the new size of the container MyVector- size_type size() const; - Returns the number of elements currently in the container
- void swap( MyVector& other ); - MyVector swap the data it holds

If all methods in the list are not implemented, including information in the interface about which methods have been implemented and tested.
Related categories: Software Testing C++ Programming JUnit