Simple project to test the CATCH framework for unit-tests.
The project implements a keyboard T9 capable of dialing one char only, e.g. type 2
and get an A
.
The enconding is the opposite, the A
is located at key 2
. So on and so forth.
$ ./bin/t9_test
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
t9_test is a Catch v2.11.0 host application.
Run with -? for options
-------------------------------------------------------------------------------
Encode incorrect letter --> return -1
-------------------------------------------------------------------------------
test/t9_test.cpp:8
...............................................................................
test/t9_test.cpp:11:
warning:
WARN: At the top of the TEST CASE
test/t9_test.cpp:15:
warning:
WARN: Inside a scope
test/t9_test.cpp:25: FAILED:
explicitly with messages:
INFO: At the top of the TEST CASE
INFO: Test on Encode("?")
t9 := [?,-1]
I will fail after '?'
===============================================================================
test cases: 1 | 1 failed
assertions: 3 | 2 passed | 1 failed
- The
./bin
directory contains the binaries (executables)t9_main
is a small application using theT9
classt9_test
is the suite of unit tests executable of theT9
class
- The
./src
directory had to be separated as thecatch.hpp
also declares a main function as well as thet9_main.cpp
t9.cpp
implements a simple logic to return the one number based on the letter typed
- The
./main
directory contains thet9_main.cpp
which generates thet9_main
executable- It is used to run a simple instance of the
T9
class
- It is used to run a simple instance of the
- The
./test
directory contains thet9_test.cpp
which generates thet9_test
executable- It is used to run a series of unit tests of the
T9
class
- It is used to run a series of unit tests of the
- The
./inc
directory contains thet9.h
, which is the header oft9.cpp
, and thecatch.hpp
- The
t9.h
defines how theT9
class is structured (its variables and methods) - The
catch.hpp
is the entire implementation of the CATCH framework
- The
- The
./obj
directory contains objects from every.cpp
t9_main.o
generated byt9_main.cpp
t9_test.o
generated byt9_test.cpp
t9.o
generated byt9.cpp
mfurquim/trying-catch
├── bin/
│ ├── t9_main
│ └── t9_test
├── inc/
│ ├── catch.hpp
│ └── t9.h
├── main/
│ └── t9_main.cpp
├── Makefile
├── obj/
│ ├── t9_main.o
│ ├── t9.o
│ └── t9_test.o
├── README.md
├── src/
│ └── t9.cpp
└── test/
└── t9_test.cpp