Commit Graph

34 Commits

Author SHA1 Message Date
Anna Schumaker 1b34a9a8a0 index: Update the index design
I updated the design and rewrote the unit tests.  This creates something
more consistent with how I ended up using the index.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:05 -04:00
Anna Schumaker fc8dc9d55e database: Design and test updates
I add:
- Autosaving option
- Real iterators
- Better accessor functions

The new design and unit test also allows me to remove the 300,000+ line
"database.good" file that the old tests were based on.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:05 -04:00
Anna Schumaker 959cac0fe1 Database: Update design for database entries
I changed primary_key() into a function since it is only called once,
and there is no point in using more mmemory than I need to.  I also
created a basic unit test for everything that database entries are
supposed to do.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:05 -04:00
Anna Schumaker 972eb3c2aa tests: Only enable CONFIG_TEST if we are building tests
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:05 -04:00
Anna Schumaker 336024bae9 file: Update design and create a new unit test
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:05 -04:00
Anna Schumaker 3359cbae6f version: Update version test
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:05 -04:00
Anna Schumaker 871914ea90 Clean up the build system
I'm taking a break from gui code to clean up the build system and update
my unit tests.  This patch updates how code is built, and reworks my
"print" test to test version number instead.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:03 -04:00
Anna Schumaker 36b76dcfc3 tests: Exit on test failure
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:58 -04:00
Anna Schumaker 11704b2bfa gui: Add some collection manager tests
Test ok, update, and import buttons in a Glib::timeout based simulator.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:58 -04:00
Anna Schumaker becf7f94bc gui: Begin implementing the gui
This adds the ocarina6.glade file and code for clicking the library
import button.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:58 -04:00
Anna Schumaker c39a9058f4 tests: Update the Sconscript file
I reordered all the tests and adjusted for the subsystem renaming.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:57 -04:00
Anna Schumaker 114c22bb12 playlist: Implement reachitecting of playlists
I changed the two playlists that are supported, added in exception
handling, and removed the list() function since I will always know the
names of playlists.  I also rename everything to "playlist" from
"group".

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:57 -04:00
Anna Schumaker edbdd1c66f audio: Begin implementing audio code
I have written play(), pause(), next() and seek_to() so far.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:56 -04:00
Anna Schumaker fecc10ab5e deck: Implement basic deck features
- Add playlists
- Remove playlists
- Rearrange playlists
- Get a playlist based on id

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:56 -04:00
Anna Schumaker 2d13b74c12 playlist: Create the initial playlist class
Right now it just knows the value of its flags variable.  More to come
soon!

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:56 -04:00
Anna Schumaker 9ddbaf0b97 library: Implement basic path management
I can add and remove root-level directories from the library database.
I do not save the database when modified, and I don't yet run an update
on all the files.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:55 -04:00
Anna Schumaker fc3b5db59e database: Fix multiple issues
- Check if we are finding the "last" iterator in an empty database
- Better print() descriptions
- Print test return codes that aren't 0 to help find segfaults

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:55 -04:00
Anna Schumaker 1f9ff4ae2d config: Simplify setting up initial environment
Rather than setting up all variables twice, just call reset() to
initialize everything.  *BONUS* Reset can be used to initialize the
value of CONFIG.TEST!

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:54 -04:00
Anna Schumaker 9880e98d0d tests: Improve removing old test data
I was using my own cpp file to remove old test data to start with a
clean slate.  I've decided it's easier to just remove the files before
running tests if they exist.

I also use this patch to update the test design and add an idea for the
future.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:54 -04:00
Anna Schumaker 1482f5bcc8 print: Rename test from basic/ to print/
"basic" doesn't really fit the description for what I'm testing here.  I
was expecting to do a series of unrelated tests, but all I'm really
doing it testing the print function.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:54 -04:00
Anna Schumaker f417b48df8 idle: Add an idle queue
The idle queue is used to schedule tasks ... later.  This code was
mostly adoted from a reference TDD experiment by Josh Larson
(themutatedshrimp@gmail.com).  Thanks Josh!

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:53 -04:00
Anna Schumaker 7b7414c755 group: Implement basic groups support
I only handle the "All Music", "Library" and "Banned" groups at the
moment but I'll eventually add in more features (in future versions).

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:53 -04:00
Anna Schumaker 2b15048777 filter: Implement text filtering
Because every programming project needs a test case centered around
Discworld quotes ...

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:53 -04:00
Anna Schumaker be0d3f3da4 index: Implement most of the index
I have everything except for save() and load() written.  My unittest is
fairly comprehensive and tests everything implemented so far, so with
any luck putting in save() and load() features will go quickly.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:53 -04:00
Anna Schumaker fee08b1f94 database: Begin database code
I've been excited about this!  I think it'll be a better design than
what I had for Ocarina 5.x.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:52 -04:00
Bryan Schumaker f76021be99 tests: Remove the debug output file
I changed print to compile in the dprint() function when the testing
flag is enabled.  This allows tests to have the same output regardless
of debugging status.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:52 -04:00
Bryan Schumaker 0ed8e48668 tests: Various improvements
- Don't be verbose when removing files.
- Reverse diff order so output makes more sense.
- Only strip whitespace from the end of lines.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:52 -04:00
Bryan Schumaker e0a32c10ac lib: Add basic file class
The class resolves the path to the ocarina directory based on the file
hint provided.  NOTE: compile-debug.good and compile.good resolve paths
to my home directory.  Other users will need to change the values for
the test to pass.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:52 -04:00
Bryan Schumaker c65e0bdb2a build: Change CONFIG_* variables into a class
The class is in charge of resetting fields at will, and will be able to
maintain everything easier than if I were to do it by hand.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:52 -04:00
Bryan Schumaker 13a0d25e8f build: Only create a single build environment
I was using a debug and a release environment for programs, that way
both versions of tests could be checked.  Instead, it'll be simpler to
only use a single environment and then control debug information using
CONFIG_DEBUG.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker b5d3a663e0 print: Print the Ocarina version to a file
The basic/print.cpp test will write version information to a file using
both dprint() and print().

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker 7c67d062df build: Make it easier to change command line macros
I store release and debug options in a list so that env.Replace() can be
used to set, modify, and restore values.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker 38c074d898 build: Improve aliasing for tests
scons tests - Compile all tests
scons tests/basic - Compile basic tests
scons tests/basic/print - Compile text printing test

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker f75ba5a2b8 tests: Add a basic test
This test checks for the version.h file and then compiles it with and
without debugging enabled.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00