Files
ioccc/2020/ferguson2/testing-procedure.html
T
Landon Curt Noll ccc360b2fb move non-README.md HTML formation to bin/othermd2html.sh
The core of `bin/gen-other-html.sh` code that converts entry non-README.md
into HTML has been moved into a new tool: `bin/othermd2html.sh`.

The `bin/othermd2html.sh` tool will be useful to the `bin/cvt-submission.sh`
tool that is under development.

Added info about `bin/othermd2html.sh` to `bin/README.md`.

Changed `bin/gen-other-html.sh` VERSION from "1.4.1 2024-08-18"
to "1.5 2024-08-27".

HTML produced by `bin/gen-other-html.sh` now uses a "jump to" mid-bar
test now shows the `YYYY/dir/index.html` link text (with `YYYY/dir/` added).

Performed `make gen_other_html` to accomplish the above and to test under macOS.
Performed `make gen_top_html` to accomplish the above and to test under macOS.
2024-08-27 16:31:56 -07:00

568 lines
20 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- START: two lines up starts content from: inc/top.default.html -->
<!-- END: this line ends content from: inc/top.default.html -->
<!-- START: this line starts content from: inc/head.default.html -->
<head>
<link rel="stylesheet" href="../../ioccc.css">
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@100..900&display=swap" rel="stylesheet">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>The International Obfuscated C Code Contest</title>
<link rel="icon" type="image/x-icon" href="../../favicon.ico">
<meta name="description" content="testing-procedure.md for 2020/ferguson2">
<meta name="keywords" content="IOCCC, 2020/ferguson2, testing-procedure.md">
</head>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- END: this line ends content from: inc/head.default.html -->
<!-- -->
<!-- This web page was formed via the tool: bin/gen-other-html.sh -->
<!-- The content of main section of this web page came from: 2020/ferguson2/testing-procedure.md -->
<!-- -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! Do not modify this web page, instead modify the file: 2020/ferguson2/testing-procedure.md !!! -->
<!-- !!! Do not modify this web page, instead modify the file: 2020/ferguson2/testing-procedure.md !!! -->
<!-- !!! Do not modify this web page, instead modify the file: 2020/ferguson2/testing-procedure.md !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- Markdown content was converted into HTML via the tool: bin/md2html.sh -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<!-- END: this line ends content from: inc/body.default.html -->
<!-- START: this line starts content from: inc/topbar.default.html -->
<div class="theader">
<nav class="topbar">
<div class="container">
<div class="logo">
<a href="../../index.html" class="logo-link">
IOCCC
</a>
</div>
<div class="topbar-items">
<div class="item">
<span class="item-header">
Entries
</span>
<div class="sub-item">
<div class="outfit-font">
<a href="../../years.html" class="sub-item-link">
Winning Entries
</a>
</div>
<div class="outfit-font">
<a href="../../authors.html" class="sub-item-link">
Winning Authors
</a>
</div>
<div class="outfit-font">
<a href="../../location.html" class="sub-item-link">
Location of winning authors
</a>
</div>
<div class="outfit-font">
<a href="../../bugs.html" class="sub-item-link">
Bugs and (mis)features
</a>
</div>
</div>
</div>
<div class="item">
<span class="item-header">
Status
</span>
<div class="sub-item">
<div class="outfit-font">
<a href="../../news.html" class="sub-item-link">
IOCCC News
</a>
</div>
<div class="outfit-font">
<a href="../../status.html" class="sub-item-link">
Contest status
</a>
</div>
<div class="outfit-font">
<a href="../../next/index.html" class="sub-item-link">
Rules and Guidelines
</a>
</div>
</div>
</div>
<div class="item">
<span class="item-header">
FAQ
</span>
<div class="sub-item">
<div class="outfit-font">
<a href="../../faq.html" class="sub-item-link">
FAQ
</a>
</div>
<div class="outfit-font">
<a href="../../faq.html#submit" class="sub-item-link">
How to enter the IOCCC
</a>
</div>
<div class="outfit-font">
<a href="../../faq.html#fix_an_entry" class="sub-item-link">
Fixing IOCCC entries
</a>
</div>
<div class="outfit-font">
<a href="../../faq.html#fix_web_site" class="sub-item-link">
Fixing the website
</a>
</div>
<div class="outfit-font">
<a href="../../faq.html#fix_author" class="sub-item-link">
Updating author info
</a>
</div>
</div>
</div>
<div class="item">
<span class="item-header">
About
</span>
<div class="sub-item">
<div class="outfit-font">
<a href="../../index.html" class="sub-item-link">
IOCCC Home
</a>
</div>
<div class="outfit-font">
<a href="../../judges.html" class="sub-item-link">
The IOCCC Judges
</a>
</div>
<div class="outfit-font">
<a href="../../contact.html" class="sub-item-link">
Contacting the IOCCC
</a>
</div>
<div class="outfit-font">
<a href="../../SECURITY.html" class="sub-item-link">
IOCCC Security Policy
</a>
</div>
<div class="outfit-font">
<a href="../../thanks-for-help.html" class="sub-item-link">
Thanks for the help
</a>
</div>
<div class="outfit-font">
<a href="../../markdown.html" class="sub-item-link">
IOCCC markdown guidelines
</a>
</div>
</div>
</div>
</div>
</div>
</nav>
<div class="header-mobile-menu">
<noscript>
<a href="../../nojs-menu.html" class="topbar-js-label">
Please Enable JavaScript
</a>
</noscript>
<button id="header-open-menu-button" class="topbar-mobile-menu">
<img
src="../../png/hamburger-icon-open.png"
alt="hamburger style menu icon - open state"
width=48
height=48>
</button>
<button id="header-close-menu-button" class="hide-content">
<img
src="../../png/hamburger-icon-closed.png"
alt="hamburger style menu icon - closed state"
width=48
height=48>
</button>
<div id="mobile-menu-panel" class="hide-content">
<div class="mobile-menu-container">
<div class="mobile-menu-wrapper">
<div class="mobile-menu-item">
Entries
</div>
<div class="mobile-submenu-wrapper">
<a class="mobile-submenu-item" href="../../years.html">
Winning Entries
</a>
<a class="mobile-submenu-item" href="../../authors.html">
Authors of winning IOCCC entries
</a>
<a class="mobile-submenu-item" href="../../location.html">
Location of authors
</a>
<a class="mobile-submenu-item" href="../../bugs.html">
Bugs and (mis)features
</a>
</div>
</div>
<div class="mobile-menu-wrapper">
<div class="mobile-menu-item">
Status
</div>
<div class="mobile-submenu-wrapper">
<a class="mobile-submenu-item" href="../../status.html">
Contest status
</a>
<a class="mobile-submenu-item" href="../../next/index.html">
Rules and Guidelines
</a>
<a class="mobile-submenu-item" href="../../news.html">
IOCCC News
</a>
</div>
</div>
<div class="mobile-menu-wrapper">
<div class="mobile-menu-item">
FAQ
</div>
<div class="mobile-submenu-wrapper">
<a class="mobile-submenu-item" href="../../faq.html">
Frequently Asked Questions
</a>
<a class="mobile-submenu-item" href="../../faq.html#submit">
How to enter the IOCCC
</a>
<a class="mobile-submenu-item" href="../../faq.html#fix_an_entry">
Fixing IOCCC entries
</a>
<a class="mobile-submenu-item" href="../../faq.html#fix_web_site">
Fixing the website
</a>
<a class="mobile-submenu-item" href="../../faq.html#fix_author">
Fixing author info
</a>
</div>
</div>
<div class="mobile-menu-wrapper">
<div class="mobile-menu-item">
About
</div>
<div class="mobile-submenu-wrapper">
<a class="mobile-submenu-item" href="../../index.html">
IOCCC Home
</a>
<a class="mobile-submenu-item" href="../../judges.html">
The IOCCC Judges
</a>
<a class="mobile-submenu-item" href="../../contact.html">
Contacting the IOCCC
</a>
<a class="mobile-submenu-item" href="../../thanks-for-help.html">
Thanks for the help
</a>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
var headerOpenMenuButton = document.getElementById("header-open-menu-button");
var headerCloseMenuButton = document.getElementById("header-close-menu-button");
var mobileMenuPanel = document.getElementById("mobile-menu-panel");
headerOpenMenuButton.addEventListener("click", () => {
headerOpenMenuButton.classList.remove("topbar-mobile-menu");
headerOpenMenuButton.classList.add("hide-content");
headerCloseMenuButton.classList.remove("hide-content");
headerCloseMenuButton.classList.add("topbar-mobile-menu");
mobileMenuPanel.classList.remove("hide-content");
mobileMenuPanel.classList.add("topbar-mobile-panel");
});
headerCloseMenuButton.addEventListener("click", () => {
headerCloseMenuButton.classList.remove("topbar-mobile-menu");
headerCloseMenuButton.classList.add("hide-content");
mobileMenuPanel.classList.add("hide-content");
mobileMenuPanel.classList.remove("topbar-mobile-panel");
headerOpenMenuButton.classList.add("topbar-mobile-menu");
headerOpenMenuButton.classList.remove("hide-content");
});
</script>
<!-- END: this line ends content from: inc/topbar.default.html -->
<!-- START: this line starts content from: inc/header.default.html -->
<div class="header">
<a href="../../2011/zucker/index.html">
<img src="../../png/ioccc.png"
alt="IOCCC image by Matt Zucker"
width=300
height=110>
</a>
<h1>The International Obfuscated C Code Contest</h1>
<h2>testing-procedure.html for 2020/ferguson2</h2>
</div>
<!-- END: this line ends content from: inc/header.default.html -->
<!-- START: this line starts content from: inc/navbar.up2index.html -->
<div class="navbar">
<a class="Left" href="index.html">&uarr; jump to 2020/ferguson2/index.html &uarr;</a>
<a class="Right" href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2020%2Fferguson2%2Ftesting-procedure.html">&#x2713;</a>
</div>
<!-- END: this line ends content from: inc/navbar.up2index.html -->
<!-- START: this line starts content from: inc/before-content.default.html -->
<div class="content" id="content">
<!-- END: this line ends content from: inc/before-content.default.html -->
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- BEFORE: 1st line of markdown file: 2020/ferguson2/testing-procedure.md -->
<h1 id="testing-procedure">Testing procedure</h1>
<p>Because of the significant amount of possible combinations of settings and the
fact that based on each setting if the text does not have the same sequence -
even one letter off - then you cannot get the same output - I had to come up
with a way to test the entry. Here’s the problem with just the default settings:
the same number of characters, the same starting, but the moment a letter
differs the rest of the message will change even if the rest of the message is
the same:</p>
<pre><code> $ echo A man and his dog walked in the park...|./prog
G spy ige lqk eav ptccpu di clm erkh...
$ echo A dog and his man walked in the park...|./prog
G luq ige lqk jou ptccpu di clm erkh...
$ echo A man and his dog and its dog walked in the park...|./prog
G spy ige lqk eav mbt bwz iwb jsojus pe hnt imny...</code></pre>
<p>As can be seen as soon as a letter is different in the sequence it changes the
result! So what could be done? First of all I had to make sure that the
invocations I gave could be properly duplicated. To do this I had key files that
I could use via <code>recode</code> and also I did input some manually. This includes the
cake recipe key file that originally was in this entry but is now only in
<a href="../ferguson1/index.html">2020/ferguson1</a>. Now, though, I have a simple
html file with a fun message for you to decipher, if you wish to find the right
key, to explore the entry. The script which I will include below can be modified
to try and find the right key.</p>
<h2 id="general-script-format">General script format</h2>
<pre><code> STR=&quot;$(echo ABC | ./prog|tail -n1)&quot;
if [ &quot;${STR}&quot; != &quot;GYM&quot; ]; then
echo &quot;Failed &#39;ABC&#39; test&quot;
exit 1
fi
STR=&quot;$(echo &quot;${STR}&quot; | ./prog|tail -n1)&quot;
if [ &quot;${STR}&quot; != &quot;ABC&quot; ]; then
echo &quot;Failed &#39;GYM&#39; test&quot;
exit 1
fi
# a simpler way to check that it works:
./recode -Renigma.dat -fenigma.deciphered.html | ./prog - 2&gt;/dev/null &gt; enigma.html
./recode -Renigma.dat -fenigma.html | ./prog - 2&gt;/dev/null | diff -s - enigma.deciphered.html
./recode -Robfuscation.key -fobfuscation.txt | ./prog - 2&gt;/dev/null &gt; out
diff out obfuscation.md || echo &quot;Obfuscation test 0.5 failed&quot;
./recode -Robfuscation.key -fout | ./prog - 2&gt;/dev/null &gt; out2
diff out2 obfuscation.txt || echo &quot;Obfuscation test 1.0 failed&quot;
./prog &lt; prog.c &gt; out
./prog &lt; out &gt; out2
diff out2 prog.c || echo &quot;Self obfuscation test 1.0 failed&quot;
mkdir -p tests || exit 1
cd tests || exit 1
let n=0
while [ &quot;${n}&quot; -lt 100 ]; do
for f in ../input.txt ../prog.c ../README.md ../recode.md ../recode.1 ../enigma.1; do
../recode -r -oconfig -f&quot;${f}&quot; | ../prog - 2&gt;/dev/null &gt; out
../recode -Rconfig -fout | ../prog - 2&gt;/dev/null &gt; out2
diff out2 &quot;${f}&quot; || echo &quot;Failed randomised test for file: ${f}&quot;
done
let n=n+1
done
rm -f out out2
cd ..
rm -f out out2</code></pre>
<p>Please don’t expect the above script to work without a bit of modification as
it’s not been tested recently and I did make some adjustments when putting this
document in the website. Still that should give you the idea.</p>
<h3 id="historical-note">Historical note:</h3>
<p>At the time of development the server was CentOS but as Red Hat decided to axe
it it is now Rocky Linux. The above script was only tested in macOS but it
should work fine in linux too. Also, the enigma.html part was added in June 2024
which expects output so below when I say if I got any output there was a problem
this is no longer true.</p>
<h2 id="back-to-the-testing">Back to the testing:</h2>
<p>Anyway, If I got any output I knew there was a problem. I did not get any output and since
this tested the default settings, two customised settings as well as 100
randomised runs for each of the files listed in the script I believed this
works well. Tests run under Fedora, CentOS and macOS with the same results.</p>
<p>I believe this entry can be used with EBCDIC as it appears that the characters
used are in contiguous sequence but I do not know for certain. Neither do I know
about big endian: I don’t believe it matters but I have no way to test this
either.</p>
<p>If there are any discrepancies in the recode.html or any other thing I
pasted it’s probably because of the way I changed the display (or else the
random option in <code>recode</code>!).</p>
<p>If there are any inconsistencies in input/output one also has to be certain that
input was put in correctly (as I discussed earlier). The results of the script
are the same under Fedora, CentOS and macOS but I have put the main testing
platform as macOS because these days I mostly use my laptop (I tend to ssh into
the other two boxes more and as for the CentOS it’s only console anyway. Since
it’s just text I/O it an terminal emulator shouldn’t matter either.).</p>
<h2 id="command-that-might-be-used-to-decipher-the-enigma.html-file">Command that might be used to decipher the <code>enigma.html</code> file:</h2>
<p>The following command can be used to decipher the file except that you must
provide the key file (or the key as a string) with the correct key (see
<a href="recode.html">recode.html</a> for a list of keys to try) in order to get correct
output:</p>
<pre><code> ./recode -Renigma.dat -fenigma.html | ./prog - 2&gt;/dev/null &gt; enigma.deciphered.html</code></pre>
<p>Enjoy!
<!-- AFTER: last line of markdown file: 2020/ferguson2/testing-procedure.md --></p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content from: inc/after-content.default.html -->
</div>
<!-- END: this line ends content from: inc/after-content.default.html -->
<!-- START: this line starts content from: inc/footer.default.html -->
<!--
Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.
You are free to share and adapt this file under the terms of this license:
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/
-->
<div class="footer">
<div id="copyright"><h3>Copyright &copy; 1984-2024 by Landon Curt Noll:
<a href="https://creativecommons.org/faq/#what-does-some-rights-reserved-mean"
target="_blank"
rel="license noopener noreferrer">Some Rights Reserved</a></h3>
<p>
This work is <b>licensed by Landon Curt Noll</b> under
<b><a href="https://creativecommons.org/licenses/by-sa/4.0/?ref=chooser-v1"
target="_blank"
rel="license noopener noreferrer"
style="display:inline-block;">CC BY-SA 4.0</a></b>.
<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;"
src="../../png/cc.png"
alt="cc inside circle symbol">
<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;"
src="../../png/by.png"
alt="person inside circle symbol">
<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;"
src="../../png/sa.png"
alt="arrow looping back on itself inside circle symbol"><br>
You should <b>carefully review</b> the
<b><a href="https://creativecommons.org/licenses/by-sa/4.0/legalcode.en"
target="_blank"
rel="license noopener noreferrer">CC BY-SA 4.0 LEGAL CODE</a></b>
before using the licensed material.<br>
You may wish to review the
<b><a href="../../license.html"
target="_blank"
rel="license noopener noreferrer">highlights of some of the key features and terms</a></b>
of <b>CC BY-SA 4.0</b>.<br>
</p>
</div>
<div id="coda"><h3>Coda</h3>
<p>
<a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2020%2Fferguson2%2Ftesting-procedure.html" rel="nofollow">Nu HTML check this web page</a><br>
<a href="#top">Jump to top</a> <a href="#content">Jump to Content</a>
</p>
</div>
</div>
<!-- END: this line ends content from: inc/footer.default.html -->
<!-- START: this line starts content from: inc/bottom.default.html -->
</body>
</html>
<!-- END: this line ends content from: inc/bottom.default.html -->