Skip to content

Commit

Permalink
ulpatch_test: Add Asm.{sleep,write} tests
Browse files Browse the repository at this point in the history
    $ ./src/tests/ulpatch_test -f Asm. -v --lv dbg
    =========================================
    ===
    === ULPatch Testing
    ===
    ===  version: v0.5.7-121-g8e4a
    === ---------------------------
    ===   22/76   Asm.sleep
    1000420us OK
    ===   23/76   Asm.write
    Hello-
    Hello
    5us OK
    =========================================
    === Total 2 tested
    ===  Success 2
    ===  Failed 0
    ===  Spend 1000ms 500.21ms/per
    =========================================

Signed-off-by: Rong Tao <[email protected]>
  • Loading branch information
Rtoax committed Aug 6, 2024
1 parent 8e4aba9 commit 6f1df0e
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/tests/patch/asm.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// SPDX-License-Identifier: GPL-2.0-or-later
/* Copyright (C) 2024 Rong Tao <[email protected]> */
#include <errno.h>

#include <utils/log.h>
#include <utils/util.h>
#include <patch/asm.h>

#include <tests/test_api.h>

TEST(Asm, sleep, 0)
{
ASM_SLEEP(1);
return 0;
}

TEST(Asm, write, 0)
{
char msg[] = {"Hello-\n"};
int len = 7;
ASM_WRITE(1, msg, len);
ASM_WRITE_HELLO();
return 0;
}

0 comments on commit 6f1df0e

Please sign in to comment.