Skip to content

Instantly share code, notes, and snippets.

@gjtorikian
Created September 19, 2013 21:03
Show Gist options
  • Save gjtorikian/6629795 to your computer and use it in GitHub Desktop.
Save gjtorikian/6629795 to your computer and use it in GitHub Desktop.
Org mode test
require 'org-ruby'
x = <<-EOS
* TODO WHAT
* Functionality
** TODO Integer correctness
*** Use smallest integer sizes always
*** Overflow-check all integer multiplication
*** Overflow-check all integer addition
** TODO Send failure messages
The broker should inform a worker if it couldn't forward a message.
It should send a diagnostic message back to the worker.
** TODO Idle Channels and Workers
Track time of last valid message received from each worker and on each channel.
When a connection request occurs, if all connects are full, cull an idle connection.
When a call request occurs, if all channels are full, cull an idle channel.
** TODO Timeouts
Every message forwarded to a client that requires a response should have a timeout.
Call Request
Clear Request
Reset Request
** TODO Throttling
*** TODO Message rate
For each worker, keep track of messages sent in the last XX (10?) seconds.
Kick any worker that sends too many messages.
*** TODO Data rate
For each worker, keep track of data sent in the last XX seconds.
Kick any worker that sends data too fast.
** More useful diagnostic messages
In a diagnostic, give more context on failure.
** Worker->Broker messages
DIRECTORY_REQUEST message asks broker for list of workers
DIRECTORY response lists workers
** Control->Broker interface
Add a req/rep socket to all curses-based control program to query
List of workers and their stats
List of channels
Reset channel / clear channel
Disconnect worker
** Memory limitation
Have broker monitor memory size in real-time.
** TODO Add OpenID registration
* Missing Documentation
All the documentation is missing. ;-)
* Missing Test Cases
** Tests for Invalid ps
*** DONE should error if first message sent has non-zero ps
*** DONE should error if ps increases by more than 1
*** TODO should error if ps is repeated
*** TODO should error if ps decreased
*** TODO should error is ps is greater than 32767
*** TODO should not error when ps wraps from 32767 to 0
*** TODO should error is ps is not in window
** Missing tests for Invalid pr
*** TODO should error if pr is more than last ps + 1
*** TODO should error if pr is more than last pr + window + 1
*** TODO should not error when pr wraps from 32767 to 0
** Missing tests for invalid packet types for a given state
*** TODO state 1
*** TODO state 2
*** TODO etc
** Missing tests unidentifiable packets
*** TODO should ignore packets with bad format from unknown connections
*** TODO should error if packet has bad format from known connection
** Missing tests for calls on one-way logical channel
*** TODO should error when an output-barred worker tries to call
** Missing tests for invalid packet type on permanent virtual circuit
None
** Missing tests for packet on unassigned logical channel
*** TODO should reject all packets except for CONNECT
** Missing tests for reject not subscribed to
** Missing tests for packet too short
*** TODO should reject short data packets
** Missing tests for packet too long
*** TODO should reject all long data packets
*** TODO should reject all long call requests
*** TODO should reject all long call accepts
** Missing tests for invalid general format identifier
None. Handled by Joza MSG
** Missing tests for restart packet with non-zero ...
This is N/A.
** Missing tests for packet-type not compatible with facility
N/A until INTERRUPT or REJ packets are implemented
** Missing tests for unauthorized interrupt confirmation
N/A until INTERRUPT is implemented
** Missing tests for unauthorized interrupt
N/A until INTERRUPT is implemented
** Missing tests for unauthorized reject
N/A until REJ is implemented
** TOA/NPI address subscription facility not subscribed to
N/A until multiple address types are implemented
** Missing tests for time expired for incoming call
*** TODO should take action if worker doesn't respond to a call request within threshold
** Missing tests for time expired for clear indication
*** TODO should take action if worker doesn't respond to clear request within threshold
** Missing tests for time expired for reset indication
*** TODO should error if worker doesn't respond to reset request within threshold
** time expired for restart indication
** time expired for call deflection
** facility code not allowed
*** TODO (if facility codes were dictionaries) would error on bad facility code key
** facility parameter not allowed
*** TODO should error if thoroughput, window, packet size, directionality
is out of range
*** TODO should error if thoroughput, window, packet size, directionality
does bad negotiation
** invalid calling address
*** TODO should error if connect request has a bad address
*** TODO should error if a connect request has a duplicate address
** invalid called address
*** TODO should error if call request has a bad address
** invalid facility length
*** TODO (if facility codes were dictionaries) would error if the dictionary
length were wrong
** incoming call barred
*** TODO should error when a worker tries to call an input-barred worker
** no logical channel available
*** TODO should error when there are more than XXX active channels
*** TODO [call should hand up when it has been idle for too long]
** call collision
*** TODO should send diagnostic when call collision occurs
** duplicate facility requested
*** TODO (if facility codes were dictionaries) should error if the same facility
appeared twice
** non-zero address length
*** TODO error if the call accepted packet has an non-zero address length,
and the called address hasn't been modified
** non-zero facility length
** facility not provided when expected
** maximum number of call redirections...
** improper cause code from worker
*** TODO error if worker sends a clear request with cause code that is other than "worker generated" cause
** not aligned octet
** inconsistent Q-bit setting
** NUI problem
*** TODO invalid network user identifier (part of billing)
** ICRD problem
*** TODO inter-network call redirection and deflection control
** remote network problem
** remote network problem
** international protocol problem
** international link out of order
** international link busy
** transit network facility problem
** remote network facility problem
** international routing problem
*** TODO give call progress when requested ROA invalid or not supported
** temporary routing problem
** unknown called DNIC
*** TODO should error if X.121 address has a DNIC that is different that the broker
** maintenance action
*** TODO should send diagnostics if broker is in SIGHUP mode
================================================================
"network congestion" cause is momentary failure
"network out of order" cause is longer failure
EOS
# Renders HTML
puts Orgmode::Parser.new(x).to_html
# => "<h1>Hello world!</h1>\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment