add a test which ensures that bit shift right is an arithmetic shift, not logical shift.

This commit is contained in:
2025-07-13 12:21:37 +02:00
parent bcf7c9be60
commit d1d5e14971
2 changed files with 10 additions and 0 deletions

View File

@@ -2,10 +2,12 @@
#include "../src/util/conf.h" #include "../src/util/conf.h"
#include "../src/util/types.h" #include "../src/util/types.h"
#include "t_arith.h"
#include "t_conf.h" #include "t_conf.h"
#include "test.h" #include "test.h"
testdat tests[] = { testdat tests[] = {
{"ensure SAR", test_sar, NULL },
{"k=v", test_procbuf, &(struct test_procbuf){"key=val", "key", "val", 0} }, {"k=v", test_procbuf, &(struct test_procbuf){"key=val", "key", "val", 0} },
{"sometxt", test_procbuf, &(struct test_procbuf){"sometxt", "sometxt", "", CONF_ESYNTAX} }, {"sometxt", test_procbuf, &(struct test_procbuf){"sometxt", "sometxt", "", CONF_ESYNTAX} },
{"comment", test_procbuf, &(struct test_procbuf){"# comment", "", "", CONF_ENODAT} }, {"comment", test_procbuf, &(struct test_procbuf){"# comment", "", "", CONF_ENODAT} },

8
test/t_arith.h Normal file
View File

@@ -0,0 +1,8 @@
#pragma once
#include "test.h"
int test_sar(void *dat) {
(void)dat;
return assert_true(-3 >> 5 == -1);
}