Code Monkey home page Code Monkey logo

trying-catch's Introduction

Using CATCH

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.

Example output

$ ./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

Structure of the project

  • The ./bin directory contains the binaries (executables)
    • t9_main is a small application using the T9 class
    • t9_test is the suite of unit tests executable of the T9 class
  • The ./src directory had to be separated as the catch.hpp also declares a main function as well as the t9_main.cpp
    • t9.cpp implements a simple logic to return the one number based on the letter typed
  • The ./main directory contains the t9_main.cpp which generates the t9_main executable
    • It is used to run a simple instance of the T9 class
  • The ./test directory contains the t9_test.cpp which generates the t9_test executable
    • It is used to run a series of unit tests of the T9 class
  • The ./inc directory contains the t9.h, which is the header of t9.cpp, and the catch.hpp
    • The t9.h defines how the T9 class is structured (its variables and methods)
    • The catch.hpp is the entire implementation of the CATCH framework
  • The ./obj directory contains objects from every .cpp
    • t9_main.o generated by t9_main.cpp
    • t9_test.o generated by t9_test.cpp
    • t9.o generated by t9.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

trying-catch's People

Contributors

mfurquimdev avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.