File: test.c

package info (click to toggle)
interface99 1.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 324 kB
  • sloc: ansic: 951; sh: 48; makefile: 6
file content (26 lines) | stat: -rw-r--r-- 507 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <interface99.h>

#include "../common.h"
#include "../util.h"
#include "types.h"

#include <assert.h>

declImplExtern(Foo, FooImpl);

// Multiple declarations shoud work fine.
declImplExtern(Bar, BarImpl);
declImplExtern(Bar, BarImpl);

int main(void) {
    // Ensure `impl`-generated data.
    {
        assert(VTABLE(FooImpl, Foo).foo == foo1_impl);
        assert(VTABLE(BarImpl, Bar).foo == foo1_impl);
    }

    ENSURE_DYN_OBJ(FooImpl, Foo);
    ENSURE_DYN_OBJ(BarImpl, Bar);

    return 0;
}