]> gitweb.factorcode.org Git - factor.git/blob - extra/macho/macho-tests.factor
git: fix tests
[factor.git] / extra / macho / macho-tests.factor
1 ! Copyright (C) 2010 Erik Charlebois.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors alien io io.streams.string kernel literals macho
4 multiline sequences strings system tools.test ;
5 IN: macho.tests
6
7 STRING: validation-output
8 0000000100000f1c __stub_helper    stub helpers
9 0000000100001040 __program_vars  _pvars
10 0000000100001068 __data          _NXArgc
11 0000000100001070 __data          _NXArgv
12 0000000100001080 __data          ___progname
13 0000000100000000                 __mh_execute_header
14 0000000100001078 __data          _environ
15 0000000100000ef8 __text          _main
16 0000000100000ebc __text          start
17 0000000000000000                 ___gxx_personality_v0
18 0000000000000000                 _exit
19 0000000000000000                 _printf
20 0000000000000000                 dyld_stub_binder
21
22 ;
23
24 cpu ppc? [
25     { $ validation-output }
26     [ [ "resource:extra/macho/a.macho" macho-nm ] with-string-writer ]
27     unit-test
28
29     { t } [
30         "resource:extra/macho/a2.macho" [
31             >c-ptr fat-binary-members first data>> >c-ptr macho-header 64-bit?
32         ] with-mapped-macho
33     ] unit-test
34 ] unless
35
36 ! Throw an exception if the struct is not defined/handled
37 os macosx? [
38     { } [ vm-path dylib-exports drop ] unit-test
39 ] when