TEST: Colour.C
Can we create an Colour with the right default values?
red: 0 green: 0 blue: 0
Can we set values; green here is invalid - it should be set to 0 instead
Testing the copy constructor
red: 210 green: 0 blue: 100
Check operator= works
red: 210 green: 0 blue: 100
Check the setColour routine
red: 1 green: 2 blue: 3
Check the getColour routine
red: 1 green: 2 blue: 3
TEST: ColourMap.C
Can we create a ColourMap with the right default Colour + String
Can we get the default colour back out of it?
name: red: 197 green: 211 blue: 125
Can we create a ColourMap with a specified default Colour?
Can we get the information back out of it?
name: red: 210 green: 0 blue: 100
Can we add a Colour
Can we get the info back out?
name: TEST1 red: 100 green: 101 blue: 102
Add a couple more colours
index: 0 name: red: 210 green: 0 blue: 100
index: 1 name: TEST1 red: 100 green: 101 blue: 102
index: 2 name: TEST2 red: 101 green: 102 blue: 103
index: 3 name: TEST3 red: 102 green: 103 blue: 104
index: 4 name: TEST4 red: 103 green: 104 blue: 105
Now try deleting the third item
index: 0 name: red: 210 green: 0 blue: 100
index: 1 name: TEST1 red: 100 green: 101 blue: 102
index: 2 name: TEST2 red: 101 green: 102 blue: 103
index: 4 name: TEST4 red: 103 green: 104 blue: 105
Make sure we get false when we try and modify item number 3
Check we can modify a colour which *is* there
index: 0 name: red: 210 green: 0 blue: 100
index: 1 name: TEST1 red: 100 green: 101 blue: 102
index: 2 name: TEST2 red: 101 green: 102 blue: 103
index: 4 name: YES red: 233 green: 233 blue: 233
Now try adding another item - it should take the place of the one we removed.
index: 0 name: red: 210 green: 0 blue: 100
index: 1 name: TEST1 red: 100 green: 101 blue: 102
index: 2 name: TEST2 red: 101 green: 102 blue: 103
index: 3 name: NEW red: 211 green: 212 blue: 213
index: 4 name: YES red: 233 green: 233 blue: 233
Try swapping two items:
index: 0 name: red: 210 green: 0 blue: 100
index: 1 name: TEST1 red: 100 green: 101 blue: 102
index: 2 name: TEST2 red: 101 green: 102 blue: 103
index: 3 name: YES red: 233 green: 233 blue: 233
index: 4 name: NEW red: 211 green: 212 blue: 213
TEST: Generic Colour routines
Try getting a combination colour:
Original colours:
red: 210 green: 0 blue: 100
red: 100 green: 101 blue: 102
Combination colour:
red: 155 green: 50 blue: 101
TEST: XML Output
For a single colour:
For a colourmap: