13 Commits

Author SHA1 Message Date
Jason Travis Smith
d9a3e21aec Fixed the example and tests to use the new Converter trait.
Transmutable was changed to Converter. This needed to be reflected in
the example and tests.

Also, fixed some comments in the new transmutable module.
2016-01-05 23:42:08 -05:00
Jason Travis Smith
e7f2f252fa Now supporting primitive type conversion with a trait!
This changes the old Transmutable trait to Converter and adds a new
Transmutable trait to all the primitive number types.
2016-01-05 17:46:31 -05:00
Jason Travis Smith
010abeff7c Fixed the tests to be correct.
There is now a random test for all the primitive number types.

Also, I fixed my errors with the tests that should panic. I kept thinking
that they should run fine and it was throwing off how I was writing
the code.
2016-01-03 03:22:21 -05:00
Jason Travis Smith
e6f1fbb229 Fixed the uint and int system types to not require num_bytes.
This also fixes the tests for buffer overflow to now work for all
primitive types.
2016-01-02 23:16:39 -05:00
Jason Travis Smith
7617ddb16a Merge branch 'tests'
Used the tests endian asserts.

Conflicts:
	src/endian.rs
2016-01-02 18:29:22 -05:00
Jason Travis Smith
cdd72603e5 Create a buffer overflow test.
This tests buffer overflow for the basic types. It does not currently
test the platform int and uint until the final function definitions
are determined.
2016-01-02 18:27:06 -05:00
Jason Travis Smith
6a623932ed This is trying to remove the num_bytes argument from usize/isize methods.
If num_bytes can be removed then a generic to_bytes and from_bytes
trait can be created that will help with serializing structures
and generic data.
2016-01-02 14:54:03 -05:00
Jason Travis Smith
a3cc3a3515 Merge branch 'examples' 2015-12-30 22:25:09 -05:00
Jason Travis Smith
9b280f8c43 Added a README file to the project. 2015-12-30 22:24:41 -05:00
Jason Travis Smith
8ae59008fe This is an example of how to use the library.
This example converts a 32-bit floating point value
to and from a byte array.
2015-12-30 17:54:23 -05:00
Jason Travis Smith
f48b8ba98b Creating the tests for the Alchemy library. 2015-12-30 17:14:48 -05:00
Jason Travis Smith
039c093b92 The library can now convert numbers to and from bytes.
Numbers can be converted to and from bytes in both
BigEndian and LittleEndian styles. This does not yet take care of
the other mathematical structures provided by Sigil.

Also, no tests of these capabilities have been written yet.
2015-12-30 17:06:48 -05:00
Jason Travis Smith
fee27b18a3 Initial library commit.
The dependency on Sigils was also added.
2015-12-29 19:48:46 -05:00