Annotation of hatari/tests/tosboot/disk/gemdos.c, revision 1.1

1.1     ! root        1: /*
        !             2:  * Hatari - gemdos.c
        !             3:  *
        !             4:  * Copyright (C) 2012 by Eero Tamminen
        !             5:  *
        !             6:  * This file is distributed under the GNU Public License, version 2 or
        !             7:  * at your option any later version. Read the file gpl.txt for details.
        !             8:  * 
        !             9:  * Atari code for testing some basic Hatari GEMDOS device and file handle
        !            10:  * operations in co-operations with tos_tester.py Hatari test driver.
        !            11:  * 
        !            12:  * Full test should eventually be something like:
        !            13:  * - clear screen
        !            14:  * - open INPUT_FILE for reading
        !            15:  * - write INPUT_FILE content to OUTPUT_FILE
        !            16:  * - close OUTPUT_FILE and INPUT_FILE
        !            17:  * - make OUTPUT_FILE read-only
        !            18:  * - TODO: execute another instance of tester with option that
        !            19:  *         tell the second instance to do rest of tests
        !            20:  * - TODO: dup stdin & stdout handles
        !            21:  * - output OUTPUT_FILE to CON:
        !            22:  *   - open OUTPUT_FILE for reading
        !            23:  *   - TODO: force that to stdin
        !            24:  *   - open "CON:" (console) for writing
        !            25:  *   - TODO: force stdout there
        !            26:  *   - TODO: read stdin and write it to stdout
        !            27:  *     - for now, directly copy OUTPUT_FILE -> "CON:"
        !            28:  *   - TODO: restore stdin & stdout
        !            29:  *    - close OUTPUT_FILE & "CON:"
        !            30:  * - output same file similarly to PRN: (printer)
        !            31:  *   - NOTE: this fails for TOS v1.02 - v2.06 when done in a program
        !            32:  *     auto-started from the AUTO-folder or from DESKTOP.INF
        !            33:  * - output same file similarly to AUX: (serial)
        !            34:  * - truncate OUTPUT_FILE -> expected to fail
        !            35:  * - make OUTPUT_FILE writable
        !            36:  * - truncate OUTPUT_FILE
        !            37:  * 
        !            38:  * As last step, output SUCCESS/FAILURE to MIDI to indicate whether
        !            39:  * everything (except for the expected failure) succeeded.
        !            40:  * 
        !            41:  * TOS tester will additionally verify that the pipeline worked fine
        !            42:  * by checking that the device output file contents match what's
        !            43:  * expected i.e. this whole pipeline works as expected:
        !            44:  *     INPUT_FILE --(OUTPUT_FILE)--> device
        !            45:  * 
        !            46:  * And that OUTPUT_FILE is again empty after test.
        !            47:  */
        !            48: #include "common.h"
        !            49: 
        !            50: int main()
        !            51: {
        !            52:        clear_screen();
        !            53: 
        !            54:        copy_file(INPUT_FILE, OUTPUT_FILE);
        !            55:        write2console(OUTPUT_FILE);
        !            56:        write2printer(OUTPUT_FILE);
        !            57:        write2serial(OUTPUT_FILE);
        !            58:        truncate_file(OUTPUT_FILE);
        !            59: 
        !            60:        write_midi();
        !            61:        wait_enter();
        !            62:        return 0;
        !            63: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.