# Copyright (c) 2012 MIT License by 6.172 Staff
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.


# Instructions for writing a test:
#
# t: initializes new test
# n: initializes bit array
# r: rotates bit array subset at offset, length by amount
# e: expects raw bit array value

# 0: headerexample (Verify the examples given in bitarray.h)
t 0

n 10010110
r 0 8 -1
e 00101101

# 1: second headerexample (Verify the examples given in bitarray.h)
t 1

n 10010110
r 2 5 2
e 10110100


# 2: 8bit
t 2

n 10000101
r 0 8 0
e 10000101

r 0 8 1
e 11000010

r 0 8 -1
e 10000101

r 0 8 -1
e 00001011

r 0 8 -11
e 01011000

