|
1234567891011121314151617181920212223242526 |
- #include <stdio.h>
- #include <assert.h>
- #include "midi-utils.h"
-
- int main(void) {
- FILE* f = fopen("cases.txt", "r");
- if (!f) {
- return -1;
- }
- char read_note_name[255] = "";
- unsigned int read_note_value;
- while (!feof(f)) {
- fscanf(f, "%s %d\n", read_note_name, &read_note_value);
- unsigned int actual_note_value = MIDI_GetNoteFromName(read_note_name);
- printf("MIDI_GetNoteFromName(\"%s\")...", read_note_name);
- assert(read_note_value == actual_note_value);
- printf("OK!\n");
-
- printf("MIDI_GetNoteName(%d)...", read_note_value);
- assert(!strcmp(MIDI_GetNoteName(read_note_value), read_note_name));
- printf("OK!\n");
- }
-
- fclose(f);
- return 0;
- }
|