Skip to content

Commit

Permalink
修正编译警告和错误
Browse files Browse the repository at this point in the history
  • Loading branch information
andywu188 committed May 21, 2024
1 parent b4482c2 commit e91e20e
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
build-publish:

runs-on: ubuntu-latest
runs-on: windows-latest

steps:
- uses: actions/checkout@v4
Expand Down
7 changes: 4 additions & 3 deletions ClientTest/DiagnosticTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Net.Http;
using System.Threading.Tasks;
using NewLife.Log;
using Stardust.Monitors;
using Xunit;
Expand All @@ -9,7 +10,7 @@ namespace ClientTest;
public class DiagnosticTests
{
[Fact]
public async void TestHttp()
public async Task TestHttp()
{
XTrace.WriteLine(nameof(TestHttp));

Expand All @@ -29,7 +30,7 @@ public async void TestHttp()
}

[Fact]
public async void TestHttp2()
public async Task TestHttp2()
{
XTrace.WriteLine(nameof(TestHttp2));

Expand All @@ -49,7 +50,7 @@ public async void TestHttp2()
}

[Fact]
public async void TestHttp3()
public async Task TestHttp3()
{
XTrace.WriteLine(nameof(TestHttp3));

Expand Down
5 changes: 3 additions & 2 deletions ClientTest/StarClientTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Threading.Tasks;
using NewLife;
using NewLife.Security;
using Stardust;
Expand Down Expand Up @@ -43,7 +44,7 @@ public void GetLoginInfoTest()
[InlineData("abcd", "1234")]
[InlineData(null, "1234")]
[InlineData("abcd", null)]
public async void LoginTest(String code, String secret)
public async Task LoginTest(String code, String secret)
{
var client = new StarClient(Server)
{
Expand All @@ -58,7 +59,7 @@ public async void LoginTest(String code, String secret)
}

[Fact]
public async void LogoutTest()
public async Task LogoutTest()
{
var client = new StarClient(Server);

Expand Down
5 changes: 3 additions & 2 deletions ClientTest/StarFactoryTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Linq;
using System.Threading.Tasks;
using NewLife;
using NewLife.Configuration;
using NewLife.Http;
Expand Down Expand Up @@ -54,7 +55,7 @@ public void Normal()
}

[Fact]
public async void CreateForService()
public async Task CreateForService()
{
using var star = new StarFactory("http://127.0.0.1:6600", "test", "xxx");
await star.Service.RegisterAsync("testService", "http://localhost:1234", "tA,tagB,ttC");
Expand Down Expand Up @@ -109,7 +110,7 @@ public void IocTest()
}

[Fact]
public async void SendNodeCommand()
public async Task SendNodeCommand()
{
using var star = new StarFactory("http://127.0.0.1:6600", "StarWeb", "xxx");

Expand Down
7 changes: 4 additions & 3 deletions Stardust.ServerTests/Controllers/OAuthControllerTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.TestHost;
using NewLife.Remoting;
Expand All @@ -20,7 +21,7 @@ public OAuthControllerTests()
}

[Fact]
public async void Token_password()
public async Task Token_password()
{
var model = new TokenInModel
{
Expand All @@ -39,7 +40,7 @@ public async void Token_password()
}

[Fact]
public async void Token_refresh_token()
public async Task Token_refresh_token()
{
var client = _server.CreateClient();

Expand Down
3 changes: 2 additions & 1 deletion Stardust.ServerTests/Controllers/WebSocketTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.TestHost;
using NewLife;
using NewLife.Caching;
Expand Down Expand Up @@ -73,7 +74,7 @@ public async Task WebSocketClient2()
XTrace.WriteLine(rs.ToJson());

var client = _server.CreateWebSocketClient();
client.ConfigureRequest = q => { q.Headers.Add("Authorization", "Bearer " + rs.Token); };
client.ConfigureRequest = q => { q.Headers.Append("Authorization", "Bearer " + rs.Token); };
using var socket = await client.ConnectAsync(new Uri("http://localhost:6600/node/notify"), default);

var ms = new[] { "开灯", "关门", "吃饭" };
Expand Down
4 changes: 2 additions & 2 deletions Stardust/Windows/NativeWifi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Stardust.Windows;
public class NativeWifi
{
#region Win32

#pragma warning disable CS1591
[DllImport("Wlanapi.dll")]
public static extern UInt32 WlanOpenHandle(
UInt32 dwClientVersion,
Expand Down Expand Up @@ -336,7 +336,7 @@ public enum WLAN_INTF_OPCODE : UInt32
const UInt32 WLAN_AVAILABLE_NETWORK_INCLUDE_ALL_MANUAL_HIDDEN_PROFILES = 0x00000002;

const UInt32 ERROR_SUCCESS = 0;

#pragma warning restore CS1591
#endregion

/// <summary>
Expand Down

0 comments on commit e91e20e

Please sign in to comment.