-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: add simplest
post_condition
test with no args
- Loading branch information
Showing
6 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Build the wrapped lib | ||
define_shared_lib(SRCS dav1d.c) | ||
|
||
# Build the test | ||
define_test( | ||
SRCS main.c | ||
NEEDS_LD_WRAP | ||
CRITERION_TEST | ||
) | ||
|
||
# Build the wrapper lib | ||
define_ia2_wrapper() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dav1d_get_picture post condition ran |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
RUN: cat dav1d_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s | ||
*/ | ||
|
||
#include <ia2_test_runner.h> | ||
#include "dav1d.h" | ||
|
||
// LINKARGS: --wrap=dav1d_get_picture | ||
int dav1d_get_picture(Dav1dContext *const c, Dav1dPicture *const out) { | ||
out->stride[0] = -1; | ||
return 0; | ||
} | ||
|
||
void dav1d_get_picture_post_condition() { | ||
cr_log_info("dav1d_get_picture post condition ran"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#pragma once | ||
|
||
#include <stddef.h> | ||
|
||
typedef struct { | ||
int field; | ||
} Dav1dContext; | ||
|
||
typedef struct { | ||
ptrdiff_t stride[2]; | ||
} Dav1dPicture; | ||
|
||
int dav1d_get_picture(Dav1dContext *c, Dav1dPicture *out); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
RUN: sh -c 'if [ ! -s "dav1d_call_gates_0.ld" ]; then echo "No link args as expected"; exit 0; fi; echo "Unexpected link args"; exit 1;' | ||
*/ | ||
|
||
// Check that readelf shows exactly one executable segment | ||
|
||
#include <ia2_test_runner.h> | ||
#include "dav1d.h" | ||
#include <ia2.h> | ||
|
||
INIT_RUNTIME(1); | ||
#define IA2_COMPARTMENT 1 | ||
#include <ia2_compartment_init.inc> | ||
|
||
Test(post_condition, main) { | ||
Dav1dContext c = {0}; | ||
Dav1dPicture pic = {0}; | ||
dav1d_get_picture(&c, &pic); | ||
} |