-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test case for program order in native module (#3686)
* add test for program order * Apply suggestions from code review Co-authored-by: Dave Thaler <[email protected]> * cr comments --------- Co-authored-by: Dave Thaler <[email protected]>
- Loading branch information
1 parent
ffb3638
commit d7942ba
Showing
3 changed files
with
93 additions
and
1 deletion.
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,43 @@ | ||
// Copyright (c) eBPF for Windows contributors | ||
// SPDX-License-Identifier: MIT | ||
|
||
// Whenever this sample program changes, bpf2c_tests will fail unless the | ||
// expected files in tests\bpf2c_tests\expected are updated. The following | ||
// script can be used to regenerate the expected files: | ||
// generate_expected_bpf2c_output.ps1 | ||
// | ||
// Usage: | ||
// .\scripts\generate_expected_bpf2c_output.ps1 <build_output_path> | ||
// Example: | ||
// .\scripts\generate_expected_bpf2c_output.ps1 .\x64\Debug\ | ||
#include "bpf_helpers.h" | ||
#include "ebpf_nethooks.h" | ||
|
||
SEC("bind_2") | ||
int | ||
program3(bind_md_t* ctx) | ||
{ | ||
return 3; | ||
} | ||
|
||
SEC("bind_4") | ||
int | ||
program1(bind_md_t* ctx) | ||
{ | ||
return 1; | ||
} | ||
|
||
SEC("bind_3") | ||
int | ||
program2(bind_md_t* ctx) | ||
{ | ||
return 2; | ||
} | ||
|
||
SEC("bind_1") | ||
int | ||
program4(bind_md_t* ctx) | ||
{ | ||
return 4; | ||
} |
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