Git Product home page Git Product logo

generic_array's Introduction

C Generic Arrays

Travis

A library that abuses C pre-processor macros to generate code for array data structures for nearly any underlying datatype. Just redefine some macros and then include generic_array.h to create a new set of functions. Out of the box 29 basic data types are supported. Adding your own should be trivial.

"Generic" is a bit of a misnomer.

Generating Test Files

This library's test suite uses Unity for unit testing. The sheer number of data types that are supported makes writing all of the tests by hand rather impractical. A Thor script is included that will generate the test source files using some ERB templates and a list of data types. After running bundle install to install Thor, use thor tests:generate to generate the files. To force overwrites and skip confirmation use the --force option.

Unity Fixture Malloc Overrides Patch

Before building the test suite you will need to patch your local copy of the Unity test framework. Unity overrides the default malloc and free functions. I believe this is intended for testing for memory leaks (but I definitely could be wrong). The actual result is that, at least on the systems where I have built this, all sorts of segmentation faults occur. By running thor patch:unity_malloc (optionally with --force) your local copy will have the overrides commented out. It's far from an ideal solution, but the Unity malloc and free functions just seem to cause too many problems with otherwise fine tests.

Running the Tests

The test suite can can be built with make tests or built and run with make all.

If you have valgrind you can run the test suite through it using make valgrind.

generic_array's People

Contributors

seaneshbaugh avatar

Stargazers

 avatar  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.