def test_fgetc_ungetc(self):
    print('TODO: update this test once the musl ungetc-on-EOF-stream bug is fixed upstream and reaches us')
    self.set_setting('SYSCALL_DEBUG', 1)
    self.clear()
    orig_compiler_opts = self.emcc_args[:]
    for fs in ['MEMFS', 'NODEFS']:
        print(fs)
        src = open(path_from_root('tests', 'stdio', 'test_fgetc_ungetc.c')).read()
        self.emcc_args = (orig_compiler_opts + [('-D' + fs)])
        if (fs == 'NODEFS'):
            self.emcc_args += ['-lnodefs.js']
        self.do_run(src, 'success', force_c=True, js_engines=[NODE_JS])
def test_fgetc_ungetc(self):
    print('TODO: update this test once the musl ungetc-on-EOF-stream bug is fixed upstream and reaches us')
    self.set_setting('SYSCALL_DEBUG', 1)
    self.clear()
    orig_compiler_opts = self.emcc_args[:]
    for fs in ['MEMFS', 'NODEFS']:
        print(fs)
        src = open(path_from_root('tests', 'stdio', 'test_fgetc_ungetc.c')).read()
        self.emcc_args = (orig_compiler_opts + [('-D' + fs)])
        if (fs == 'NODEFS'):
            self.emcc_args += ['-lnodefs.js']
        self.do_run(src, 'success', force_c=True, js_engines=[NODE_JS])